From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110269 invoked by alias); 20 May 2016 11:15:55 -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 110259 invoked by uid 89); 20 May 2016 11:15:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=enkovich.gnu@gmail.com, enkovichgnugmailcom X-HELO: mail-wm0-f50.google.com Received: from mail-wm0-f50.google.com (HELO mail-wm0-f50.google.com) (74.125.82.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 20 May 2016 11:15:53 +0000 Received: by mail-wm0-f50.google.com with SMTP id a17so168351447wme.0 for ; Fri, 20 May 2016 04:15:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=D7FFBwxNeWZHcE0pNCjW/FhmqxKR6jjwdvPe3Uif+F0=; b=QapLQl6irk71j/yE/RABNoZWAEn3fdZ8qMbRVnAlAUJtseyNzSazrpVh1CfBaQzf4f hC3Jlfv0k3bglhPZz3MQw3LUNtn/Zsr3VUoNSGH0HzdT/D58Q9GWKvQp5qNytZ3yIApO KSNgAhY1/PPKpjujIiySiE+Lu/WvIOIxhUsQsb9fUTJNDAVwPqSquW79qdNxqF0FREb6 ud5Wl7k6XK8BzUg0XoaukqqaDtq58KxkbbrQWI3ollHE3RlEilF0QHtsMijDjG8ttdUZ XRp+6spicetU3vUr01UUTmaXOhP8/18UdhIy7bgd4qywf/78uqd8shogam6MJvsXRnrP s/dA== X-Gm-Message-State: AOPr4FWcaE1BElhe0MuB4XYr0VVuwQgBVC97mmLp/WUXhlzgUsV6QLgaqZYH0ZcQja5bP05utNM9ms7bq1TkyQ== MIME-Version: 1.0 X-Received: by 10.194.223.70 with SMTP id qs6mr2657539wjc.119.1463742950588; Fri, 20 May 2016 04:15:50 -0700 (PDT) Received: by 10.194.87.34 with HTTP; Fri, 20 May 2016 04:15:50 -0700 (PDT) In-Reply-To: References: <20160519194036.GE40563@msticlxl57.ims.intel.com> Date: Fri, 20 May 2016 11:15:00 -0000 Message-ID: Subject: Re: [PATCH, vec-tails 04/10] Add masking cost From: Richard Biener To: Ilya Enkovich Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg01624.txt.bz2 On Fri, May 20, 2016 at 11:44 AM, Ilya Enkovich wrote: > 2016-05-20 12:24 GMT+03:00 Richard Biener : >> On Thu, May 19, 2016 at 9:40 PM, Ilya Enkovich wrote: >>> Hi, >>> >>> This patch extends vectorizer cost model to include masking cost by >>> adding new cost model locations and new target hook to compute >>> masking cost. >> >> Can you explain a bit why you add separate overall >> masking_prologue/body_cost rather >> than using the existing prologue/body cost for that? > > When I make a decision I need vector loop cost without masking (what > we currently > have) and with masking (what I add). This allows me to compute > profitability for > all options (scalar epilogue, combined epilogue, masked epilogue) and choose one > of them. Using existing prologue/body cost would allow me compute masking > profitability with no fall back to scalar loop profitability. Yes, but for this kind of purpose you could simply re-start separate costing via the init_cost hook? >> I realize that the current vectorizer cost infrastructure is a big >> mess, but isn't it possible >> to achieve what you did with the current add_stmt_cost hook? (by >> inspecting stmt_info) > > Cost of a statement and cost of masking a statement are different things. > Two hooks called for the same statement return different values. I can > add vect_cost_for_stmt enum elements to cover masking but I thought > having stmt_masking_cost would me more clear. I agree we need some kind of overloading and I'm not against a separate hook for this. On a related note what is "masking cost" here? I could imagine that masking doesn't unconditionally add a cost to a stmt but its execution cost may now depend on whether an element is masked or not. Does the hook return the cost of the masked stmt or the cost of masking the stmt only (so you need to do add_stmt_cost as well on the same stmt)? Thanks, Richard. > Thanks, > Ilya > >> >> Richard. >> >>> Thanks, >>> Ilya