From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68010 invoked by alias); 7 May 2018 15:51:24 -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 67999 invoked by uid 89); 7 May 2018 15:51:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-yw0-f173.google.com Received: from mail-yw0-f173.google.com (HELO mail-yw0-f173.google.com) (209.85.161.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 May 2018 15:51:21 +0000 Received: by mail-yw0-f173.google.com with SMTP id i17-v6so8735612ywg.13 for ; Mon, 07 May 2018 08:51:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YEfkQ0MRQV3XRif5PsTAApeNySplaxGR95CK+tRSs08=; b=E4sUsb1Voc/n5qz26YQvSNAlGehCuKHBGOurQFmjNgrnuCd6b6oE02HVv+YeuIC5Ra Dk4POUTcXvmaozu3v7IlypK0uCR0bxIep1hRvoRWWiznet2TETN3eo4MIkj5fwLM2s66 9VbdtQcgCECe/q5xBFm6w22glyaBJeOLeRmPFVyfGOVRn9Erwphh9K5PYbqVTj44B8Of Le7twPKHPD9F3/0fbTyO8brnYN/6JebvUeZlGFMUpLB28iU0Y2Mdh3r5ejDZm6FBLSFh SodjdRH/llBU4ELJU3cAa5OHuafAaPzEeZH9REAB07rW3CWdFdZEtD2BCqGOXKDv9g0j P5Xg== X-Gm-Message-State: ALQs6tBiM4BeVxo4/9zLqV8BsozU+6JfAd0ZDhStjnLJuCWfyKeZ5k6D m0v45cERLigHLWnxK3BTRLBusA== X-Google-Smtp-Source: AB8JxZr77GO8nwEp368QdhJDf33olFBkKky1DdalBItU50a1m4bq5tZRqlHR3hCaUiyML3ub3w5LBA== X-Received: by 2002:a81:b64b:: with SMTP id h11-v6mr20013869ywk.82.1525708279864; Mon, 07 May 2018 08:51:19 -0700 (PDT) Received: from [192.168.6.17] ([24.213.126.67]) by smtp.gmail.com with ESMTPSA id d23-v6sm10254059ywb.69.2018.05.07.08.51.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 May 2018 08:51:19 -0700 (PDT) Subject: Re: [PATCH 1/2] Introduce prefetch-minimum stride option To: "H.J. Lu" Cc: Jeff Law , GCC Patches , James Greenhalgh , Richard Earnshaw References: <1516628770-25036-1-git-send-email-luis.machado@linaro.org> <1516628770-25036-2-git-send-email-luis.machado@linaro.org> <959bcc92-0d0f-a680-8677-e6e2294a0fe8@redhat.com> <702726ab-1287-6042-3d7c-ac2119d23fb9@linaro.org> From: Luis Machado Message-ID: Date: Mon, 07 May 2018 15:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00287.txt.bz2 On 05/07/2018 12:15 PM, H.J. Lu wrote: > On Mon, May 7, 2018 at 7:09 AM, Luis Machado wrote: >> >> >> On 05/01/2018 03:30 PM, Jeff Law wrote: >>> >>> On 01/22/2018 06:46 AM, Luis Machado wrote: >>>> >>>> This patch adds a new option to control the minimum stride, for a memory >>>> reference, after which the loop prefetch pass may issue software prefetch >>>> hints for. There are two motivations: >>>> >>>> * Make the pass less aggressive, only issuing prefetch hints for bigger >>>> strides >>>> that are more likely to benefit from prefetching. I've noticed a case in >>>> cpu2017 >>>> where we were issuing thousands of hints, for example. >>>> >>>> * For processors that have a hardware prefetcher, like Falkor, it allows >>>> the >>>> loop prefetch pass to defer prefetching of smaller (less than the >>>> threshold) >>>> strides to the hardware prefetcher instead. This prevents conflicts >>>> between >>>> the software prefetcher and the hardware prefetcher. >>>> >>>> I've noticed considerable reduction in the number of prefetch hints and >>>> slightly positive performance numbers. This aligns GCC and LLVM in terms >>>> of >>>> prefetch behavior for Falkor. >>>> >>>> The default settings should guarantee no changes for existing targets. >>>> Those >>>> are free to tweak the settings as necessary. >>>> >>>> No regressions in the testsuite and bootstrapped ok on aarch64-linux. >>>> >>>> Ok? >>>> >>>> 2018-01-22 Luis Machado >>>> >>>> Introduce option to limit software prefetching to known constant >>>> strides above a specific threshold with the goal of preventing >>>> conflicts with a hardware prefetcher. >>>> >>>> gcc/ >>>> * config/aarch64/aarch64-protos.h (cpu_prefetch_tune) >>>> : New const int field. >>>> * config/aarch64/aarch64.c (generic_prefetch_tune): Update to >>>> include >>>> minimum_stride field. >>>> (exynosm1_prefetch_tune): Likewise. >>>> (thunderxt88_prefetch_tune): Likewise. >>>> (thunderx_prefetch_tune): Likewise. >>>> (thunderx2t99_prefetch_tune): Likewise. >>>> (qdf24xx_prefetch_tune): Likewise. Set minimum_stride to 2048. >>>> (aarch64_override_options_internal): Update to set >>>> PARAM_PREFETCH_MINIMUM_STRIDE. >>>> * doc/invoke.texi (prefetch-minimum-stride): Document new option. >>>> * params.def (PARAM_PREFETCH_MINIMUM_STRIDE): New. >>>> * params.h (PARAM_PREFETCH_MINIMUM_STRIDE): Define. >>>> * tree-ssa-loop-prefetch.c (should_issue_prefetch_p): Return >>>> false if >>>> stride is constant and is below the minimum stride threshold. >>> >>> OK for the trunk. >>> jeff >>> >> >> Thanks. Committed as revision 259995 now. > > This breaks bootstrap on x86: > > ../../src-trunk/gcc/tree-ssa-loop-prefetch.c: In function ‘bool > should_issue_prefetch_p(mem_ref*)’: > ../../src-trunk/gcc/tree-ssa-loop-prefetch.c:1010:54: error: > comparison of integer expressions of different signedness: ‘long long > unsigned int’ and ‘int’ [-Werror=sign-compare] > && absu_hwi (int_cst_value (ref->group->step)) < PREFETCH_MINIMUM_STRIDE) > ../../src-trunk/gcc/tree-ssa-loop-prefetch.c:1014:4: error: format > ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long > long int’ [-Werror=format=] > "Step for reference %u:%u (%d) is less than the mininum " > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > "required stride of %d\n", > ~~~~~~~~~~~~~~~~~~~~~~~~~ > ref->group->uid, ref->uid, int_cst_value (ref->group->step), > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > I've reverted this for now while i address the bootstrap problem.