From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123253 invoked by alias); 1 May 2018 18:30:30 -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 122794 invoked by uid 89); 1 May 2018 18:30:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=stride, considerable X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 May 2018 18:30:15 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F30903DE30; Tue, 1 May 2018 18:30:12 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-53.rdu2.redhat.com [10.10.112.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9BE69CB0; Tue, 1 May 2018 18:30:11 +0000 (UTC) Subject: Re: [PATCH 1/2] Introduce prefetch-minimum stride option To: Luis Machado , gcc-patches@gcc.gnu.org Cc: james.greenhalgh@arm.com, Richard.Earnshaw@arm.com References: <1516628770-25036-1-git-send-email-luis.machado@linaro.org> <1516628770-25036-2-git-send-email-luis.machado@linaro.org> From: Jeff Law Openpgp: preference=signencrypt Autocrypt: addr=law@redhat.com; prefer-encrypt=mutual; keydata= xsBNBFkbIO8BCACVIqDhDVh9ur8C+zNV1J/cXfwvVDAUcphDEFl4jyHqZORK4Pd3Db8oWqLm Q8lOCr/VOS7lrCtdpVMQkLGOGA16oJ8g7hzhnojpjY09UjsoUiG7oKacuxj8skfp6SIx93Zl +iNYPRa4S+za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P5P/8PpRq8fP682pgzWwUCWRsg7wIbDAAKCRC8fP682pgzW3REB/9cT7iKRPg/ OK9bpLlllIEDM90IaKC79DQrv+fRudOR78cdV4XUwPSFnyHUsP3VJ4lDy5FhiKCwGie0BK53 EsxgMrLy1L8hboFdTE4Vi0xzCheMaMVp4hATDU29k1cuxu1VPpCa8E3mYeHjNV7ip0HN5L4D rfs8lRPJE/oM1vGs9DgQFZrCPPNRNGKC97BH+DHccesEJr7tSsQrkPkt0z/FTKr5wIM02vSx OJjgmcVbGB7dc2j/Sx8loXmuKnuKtM35668kUG8jeJvSQk3o/VHpD27bhl0rR68R2jN6G6kQ egMVb6dPu1Ius8rBE5rFw88J4JEb5q4hMNClWWUFHIdP Message-ID: <959bcc92-0d0f-a680-8677-e6e2294a0fe8@redhat.com> Date: Tue, 01 May 2018 18:30: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: <1516628770-25036-2-git-send-email-luis.machado@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00034.txt.bz2 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