From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32051 invoked by alias); 20 Feb 2017 12:41:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 32042 invoked by uid 89); 20 Feb 2017 12:41:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-ot0-f172.google.com Received: from mail-ot0-f172.google.com (HELO mail-ot0-f172.google.com) (74.125.82.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Feb 2017 12:41:24 +0000 Received: by mail-ot0-f172.google.com with SMTP id w44so4890595otw.2 for ; Mon, 20 Feb 2017 04:41:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=smWoihNzIUL5cM9FZZsuPNPS7lx0Xa6bstORiXcHvZw=; b=gV07CBSDFcyrzOLJXdCb7fTzsZjhzoHzREkSl7RpCGt+crU0qvnRtnE/xLDaJjTWmV pdkcG+Li1oJhu17ZufXTO9tEjd6Z1ElUHxOwMUIi6bSIYWmtLUjxkLlvrTVJveTrp+us DUPJyz7ArVL0hvX/1VZn63iMSCVRiSmtzdD/hVu7nXQsrQhqWJN7pFc8anty8bveg5jI 7tBIcKy/9QoQqhjA5vtmU7lbNeryWxc4pUuDngdA5n81UTmwsclevxI/cKlUU3UacIey 2KVFrxewbKklcNJ8dQR1dG4O7mXJ6MoaDt3OzwyertNN/7Q6V8yvx1ATvzu+h9Jl/GiF u0eg== X-Gm-Message-State: AMke39l4ltlnbcyvSiUG5FEatEwm20FcZEJJMVij/r/885NgFQq5gJKMPYxsEpg27B5HAMwBggI1RfkUWqOV/Q== X-Received: by 10.157.59.72 with SMTP id z66mr10155457otb.191.1487594482817; Mon, 20 Feb 2017 04:41:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.40.120 with HTTP; Mon, 20 Feb 2017 04:41:22 -0800 (PST) In-Reply-To: References: From: Richard Biener Date: Mon, 20 Feb 2017 12:54:00 -0000 Message-ID: Subject: Re: [PATCH PR77536]Generate correct profiling information for vectorized loop To: Bin Cheng , Jan Hubicka Cc: "gcc-patches@gcc.gnu.org" , nd , "pthaugen@linux.vnet.ibm.com" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg01219.txt.bz2 On Thu, Feb 16, 2017 at 6:48 PM, Bin Cheng wrote: > Hi, > After fixing PR79347, the main problem with vectorizer is we scale down profiling counters > for vect_loop by VF, regardless of context CFG's profiling information. This is wrong and > sometimes makes vect_loop not hot code, which may confuses following optimizers. This > patch generates well-formed profiling information as generic tree unroller does. It borrows > code from tree-ssa-loop-manip.c and does small refactors to existing code. Vectorizer will > not introduce mismatch counters with it, and unroll and vrp2 are the two major passes > messing up profiling counters now. Though it removes all mismatch in vectorizer, I am not > sure if this counts as a regression fix. > BTW, it may also help PR78116? Hi Pat, could you please help verify this? Thanks! > > Bootstrap and test on x86_64 and AArch64 ongoing. Is it OK if no failures? The patch looks good to me but please wait for Honza to comment. Thanks, Richard. > Thanks, > bin > > 2017-02-16 Bin Cheng > > PR tree-optimization/77536 > * tree-ssa-loop-manip.c (niter_for_unrolled_loop): New function. > (tree_transform_and_unroll_loop): Use above function to compute the > estimated niter of unrolled loop. > * tree-ssa-loop-manip.h niter_for_unrolled_loop(): New declaration. > * tree-vect-loop.c (scale_profile_for_vect_loop): New function. > (vect_transform_loop): Call above function. > > gcc/testsuite/ChangeLog > 2017-02-16 Bin Cheng > > PR tree-optimization/77536 > * gcc.dg/vect/pr79347.c: Revise testing string.