From patchwork Fri Jan 17 17:08:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 312154 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DD6672C009E for ; Sat, 18 Jan 2014 04:08:10 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=d1L/8FUO8ph9KF0A4Tf4WTCFEYNlDRKBTiTc2TrwB5t MmVsHNJHUi0jQiphOkNx6sKFJL/MsNEbnbjdRvyMVwcwpZrZWTLjsaKbbDTmfOaa fvwGNghQZi0c1k6xs6ZQHJMBQyug/s2ylCxG9DWHQ0VjgWtmjJOAuQEA24DLbFGo = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=p6TM8/d82YNiA+ZiZUhpDegouKQ=; b=DLja7AAOsAeOvUPlj VOEFfU1Shb4nmIMJ9/LPMENd3Z1mEpwGALa/nvwjbsgrCbaAsTrGA95Px/IHHWLM BytVYUYEvN3kpKAKTtrq+AiDDMrv3uduwguckuojq5XZSPWvU5vhh2602418M1p9 Irb1fd4uvg2GEwBYDzH7JpqWrc= Received: (qmail 4340 invoked by alias); 17 Jan 2014 17:08:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 4328 invoked by uid 89); 17 Jan 2014 17:08:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f182.google.com Received: from mail-ie0-f182.google.com (HELO mail-ie0-f182.google.com) (209.85.223.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 17 Jan 2014 17:08:02 +0000 Received: by mail-ie0-f182.google.com with SMTP id as1so5806356iec.41 for ; Fri, 17 Jan 2014 09:08:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=B2SUQy1mqXQ4BpbOhz+1zP2pb/6iHXMmaV4ZOMDUjbs=; b=jyNl0v5Xyt2k3fbiiczWOJAGpepRPRCDJA97dR2uyTjZyBC7d9O8UnsDnniAiTdAGI 4ApBwpCAkvrmyNsCMY8harQ77Kx1otBm0UdmLKf3PdBTgBdk0G5uOsybWQFC/DFQH3cq 3KerYV7/m80c6SX7a4awSZrn7tYqzYVhSgRcvxCWPKqC5asM37NKkn/oG2AIK+So4mcR JHnyROZtbpPr6OrmksEVLpp/gVjkgGEZUCLudvzK+/kvlaNOIO8LkD6bvzjRBT+npVO2 6g2KqT/uPaceQapLrBsAZPNvD1ySxvsDoo46M5RMRfwvjL9Bfg58epkBLMMIjMGTVG/U stFA== X-Gm-Message-State: ALoCoQkxtNLUMtYVcZ/dmy+YPZlU8NSGmf1EQxzXmrIQJjcLVNpMNYrRaHKGswYSuERGDgIMC/N6QgwhBe6do70Gbo82nyH4WVeSHmpTy/CU8QNNHJ2RI3YkvYMHyDBdNQ6rxPageVXsF5iZ41U8x9QSLQMSrffbOvdD05o9IeB8NVh1db/u5upByNOU7gvANcDAIuF2b5GQ99GhKHGsKMJVNCRwDXTClw== MIME-Version: 1.0 X-Received: by 10.50.30.166 with SMTP id t6mr3793412igh.7.1389978480384; Fri, 17 Jan 2014 09:08:00 -0800 (PST) Received: by 10.64.252.101 with HTTP; Fri, 17 Jan 2014 09:08:00 -0800 (PST) Date: Fri, 17 Jan 2014 09:08:00 -0800 Message-ID: Subject: [GOOGLE] don't overwrite precomputed loop bound in AutoFDO From: Dehao Chen To: GCC Patches Cc: David Li , Cong Hou X-IsSubscribed: yes If a loop is cunrolled/vectorized, the AutoFDO computed trip count will be very small. This patch disallows overwritting of precomputed loop bound in AutoFDO mode. Bootstrapped and passed regression test. Performance test on-going. OK for Google branches? Thanks, Dehao Index: tree-ssa-loop-niter.c =================================================================== --- tree-ssa-loop-niter.c (revision 206674) +++ tree-ssa-loop-niter.c (working copy) @@ -2520,7 +2520,8 @@ record_niter_bound (struct loop *loop, double_int } if (realistic && (!loop->any_estimate - || i_bound.ult (loop->nb_iterations_estimate))) + || (!flag_auto_profile && + i_bound.ult (loop->nb_iterations_estimate)))) { loop->any_estimate = true; loop->nb_iterations_estimate = i_bound;