From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12649 invoked by alias); 1 Feb 2015 07:56:11 -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 12637 invoked by uid 89); 1 Feb 2015 07:56:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f45.google.com Received: from mail-la0-f45.google.com (HELO mail-la0-f45.google.com) (209.85.215.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 01 Feb 2015 07:56:09 +0000 Received: by mail-la0-f45.google.com with SMTP id gd6so32341846lab.4 for ; Sat, 31 Jan 2015 23:56:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:subject:date:message-id:cc:to :mime-version; bh=6ymWEFHSykCtRk8d6i2I9XcOy+9PRtO6tfPW36DJH6Q=; b=PIzIwIeV2Ol8DoxVWVNyXEuHvAP09qbvlr0uKVQziiL7+FUyCqBIXwNjf7T9c88pwI UkXwWHSZUsIeGTurtwnOGb5RlD/qKs8Q7gFYmYj/V6IJpJrn61rdX5b7yP56ar7m6KLe WoPnQ5j5PsxLNAW6mEsugMO0cR2bxz+hDoLDSZsXZ+ZgsTOeI9ZcJjoZKqQhn7DkpH+Y oiMJvRLWGOPvN+NlW5k0Eqy/Z0GjTti6oEbVhHW6Rib/ObAKi+k4aOCrudBmDNVI+WCu HxqmhM98jmGEWIQBRK6S8G6u/O8QyRR110Z6ITM6QKQllLNdcfGm2h++NMTjmqh881OP F7+g== X-Gm-Message-State: ALoCoQnw4C/nmj283IMX5Jz7GTcOuZoxYcKX0ax57tk2HJwx1aqdXnw/chvtaHAZnVPdo2JtLzl7 X-Received: by 10.152.198.200 with SMTP id je8mr13750377lac.93.1422777366553; Sat, 31 Jan 2015 23:56:06 -0800 (PST) Received: from [192.168.1.64] (ppp91-76-180-33.pppoe.mtu-net.ru. [91.76.180.33]) by mx.google.com with ESMTPSA id ei4sm2001794lad.40.2015.01.31.23.56.05 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 31 Jan 2015 23:56:05 -0800 (PST) From: Maxim Kuvyrkov Content-Type: multipart/mixed; boundary="Apple-Mail=_81DA0412-DC94-4D46-8AA4-2E228651D1C2" Subject: [PATCH] Support disabling of sched autoprefetcher from command line Date: Sun, 01 Feb 2015 07:56:00 -0000 Message-Id: <83557C87-8594-4191-B760-1CC7D06C14D2@linaro.org> Cc: Vladimir Makarov To: GCC Patches Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-SW-Source: 2015-02/txt/msg00006.txt.bz2 --Apple-Mail=_81DA0412-DC94-4D46-8AA4-2E228651D1C2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Content-length: 650 Hi, It turned out that the values for PARAM_SCHED_AUTOPREF_QUEUE_DEPTH that I i= nitially selected were unfortunate. The value of "-1" is special in parame= ter handling code, and it can't be used on command line. This makes it imp= ossible to disable scheduler autoprefetcher from command line ("-1" corresp= onds to "disable autoprefetcher model"). This patch shifts the set of a allowed values for PARAM_SCHED_AUTOPREF_QUEU= E_DEPTH by +1, so that the "disable" value is "0". OK for stage 1? Tested on arm-linux-gnueabihf, and I will bootstrap and te= st the patch on trunk before committing. Thank you, -- Maxim Kuvyrkov www.linaro.org --Apple-Mail=_81DA0412-DC94-4D46-8AA4-2E228651D1C2 Content-Disposition: attachment; filename=0002-Support-disabling-of-sched-autoprefetcher-from-comma.patch Content-Type: application/octet-stream; name="0002-Support-disabling-of-sched-autoprefetcher-from-comma.patch" Content-Transfer-Encoding: quoted-printable Content-length: 5288 >From b86515013dec067419d16d11c138ba8b74ede1c5 Mon Sep 17 00:00:00 2001=0A= From: Maxim Kuvyrkov =0A= Date: Sun, 18 Jan 2015 13:22:56 +0000=0A= Subject: [PATCH 2/2] Support disabling of sched autoprefetcher from command= =0A= line=0A= =0A= * config/arm/arm.c (arm_cortex_a15_tune, arm_cortex_a57_tune): Update.=0A= * haifa-sched.c: Increase values for PARAM_SCHED_AUTOPREF_QUEUE_DEPTH=0A= by +1 throughout.=0A= (rank_for_schedule, autopref_multipass_dfa_lookahead_guard): Update.=0A= * params.def (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH): Update.=0A= ---=0A= gcc/config/arm/arm.c | 6 +++---=0A= gcc/haifa-sched.c | 16 ++++++++--------=0A= gcc/params.def | 4 ++--=0A= 3 files changed, 13 insertions(+), 13 deletions(-)=0A= =0A= diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c=0A= index 246298a..cbf6ce0 100644=0A= --- a/gcc/config/arm/arm.c=0A= +++ b/gcc/config/arm/arm.c=0A= @@ -3173,11 +3173,11 @@ arm_option_override (void)=0A= relevant for L2 auto-prefetcher. */=0A= int param_sched_autopref_queue_depth;=0A= if (current_tune->sched_autopref =3D=3D ARM_SCHED_AUTOPREF_OFF)=0A= - param_sched_autopref_queue_depth =3D -1;=0A= - else if (current_tune->sched_autopref =3D=3D ARM_SCHED_AUTOPREF_RANK)=0A= param_sched_autopref_queue_depth =3D 0;=0A= + else if (current_tune->sched_autopref =3D=3D ARM_SCHED_AUTOPREF_RANK)=0A= + param_sched_autopref_queue_depth =3D 1;=0A= else if (current_tune->sched_autopref =3D=3D ARM_SCHED_AUTOPREF_FULL)=0A= - param_sched_autopref_queue_depth =3D max_insn_queue_index + 1;=0A= + param_sched_autopref_queue_depth =3D max_insn_queue_index + 2;=0A= else=0A= gcc_unreachable ();=0A= maybe_set_param_value (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH,=0A= diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c=0A= index 25b96d3..3f934b8 100644=0A= --- a/gcc/haifa-sched.c=0A= +++ b/gcc/haifa-sched.c=0A= @@ -2744,7 +2744,7 @@ rank_for_schedule (const void *x, const void *y)=0A= if (flag_sched_critical_path_heuristic && priority_val)=0A= return rfs_result (RFS_PRIORITY, priority_val, tmp, tmp2);=0A= =20=0A= - if (PARAM_VALUE (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH) >=3D 0)=0A= + if (PARAM_VALUE (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH) >=3D 1)=0A= {=0A= int autopref =3D autopref_rank_for_schedule (tmp, tmp2);=0A= if (autopref !=3D 0)=0A= @@ -5552,11 +5552,11 @@ insn_finishes_cycle_p (rtx_insn *insn)=0A= insns in the ready list (or the queue) that have same memory base, but= =0A= different offsets, then we delay the insns with larger offsets until in= sns=0A= with smaller offsets get scheduled. If PARAM_SCHED_AUTOPREF_QUEUE_DEPT= H=0A= - is "1", then we look at the ready list; if it is N>1, then we also look= =0A= - through N-1 queue entries.=0A= - If the param is N>=3D0, then rank_for_schedule will consider auto-prefe= tching=0A= + is "2", then we look at the ready list; if it is N>2, then we also look= =0A= + through N-2 queue entries.=0A= + If the param is N>=3D1, then rank_for_schedule will consider auto-prefe= tching=0A= among its heuristics.=0A= - Param value of "-1" disables modelling of the auto-prefetcher. */=0A= + Param value of "0" disables modelling of the auto-prefetcher. */=0A= =20=0A= /* Initialize autoprefetcher model data for INSN. */=0A= static void=0A= @@ -5680,7 +5680,7 @@ autopref_multipass_dfa_lookahead_guard (rtx_insn *ins= n1, int ready_index)=0A= {=0A= int r =3D 0;=0A= =20=0A= - if (PARAM_VALUE (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH) <=3D 0)=0A= + if (PARAM_VALUE (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH) <=3D 1)=0A= return 0;=0A= =20=0A= if (sched_verbose >=3D 2 && ready_index =3D=3D 0)=0A= @@ -5733,14 +5733,14 @@ autopref_multipass_dfa_lookahead_guard (rtx_insn *i= nsn1, int ready_index)=0A= }=0A= }=0A= =20=0A= - if (PARAM_VALUE (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH) =3D=3D 1)=0A= + if (PARAM_VALUE (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH) <=3D 2)=0A= continue;=0A= =20=0A= /* Everything from the current queue slot should have been moved to= =0A= the ready list. */=0A= gcc_assert (insn_queue[NEXT_Q_AFTER (q_ptr, 0)] =3D=3D NULL_RTX);=0A= =20=0A= - int n_stalls =3D PARAM_VALUE (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH) - 1;= =0A= + int n_stalls =3D PARAM_VALUE (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH) - 2;= =0A= if (n_stalls > max_insn_queue_index)=0A= n_stalls =3D max_insn_queue_index;=0A= =20=0A= diff --git a/gcc/params.def b/gcc/params.def=0A= index 4d3b398..a422078 100644=0A= --- a/gcc/params.def=0A= +++ b/gcc/params.def=0A= @@ -670,8 +670,8 @@ DEFPARAM (PARAM_SCHED_MEM_TRUE_DEP_COST,=0A= =20=0A= DEFPARAM (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH,=0A= "sched-autopref-queue-depth",=0A= - "Hardware autoprefetcher scheduler model control flag. Number of looka= head cycles the model looks into; at '0' only enable instruction sorting he= uristic. Disabled by default.",=0A= - -1, 0, 0)=0A= + "Hardware autoprefetcher scheduler model control flag. Number of looka= head cycles the model looks into; at '1' only enable instruction sorting he= uristic. Disabled by default.",=0A= + 0, 0, 0)=0A= =20=0A= DEFPARAM(PARAM_MAX_LAST_VALUE_RTL,=0A= "max-last-value-rtl",=0A= --=20=0A= 1.7.9.5=0A= =0A= --Apple-Mail=_81DA0412-DC94-4D46-8AA4-2E228651D1C2--