Re: [PATCH] Loop unswitching: support gswitch statements.

2021-11-08 Thread Andrew MacLeod via Gcc-patches
On 11/8/21 10:05 AM, Martin Liška wrote: On 9/28/21 22:39, Andrew MacLeod wrote: In Theory, modifying the IL should be fine, it happens already in places, but its not extensively tested under those conditions yet. Hello Andrew. I've just tried using a global gimple_ranger and it crashes when

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-11-08 Thread Andrew MacLeod via Gcc-patches
On 11/8/21 10:05 AM, Martin Liška wrote: On 9/28/21 22:39, Andrew MacLeod wrote: In Theory, modifying the IL should be fine, it happens already in places, but its not extensively tested under those conditions yet. Hello Andrew. I've just tried using a global gimple_ranger and it crashes when

[COMMITTED] tree-optimization/103022 - Don't calculate new values when using the private context, callback.

2021-11-08 Thread Andrew MacLeod via Gcc-patches
the safety trap.  This patch makes sure we make the request in read-only mode . Bootstraps with no regressions on x86_64-pc-linux-gnu.  Pushed. Andrew commit 0cd653bd2559701da9cc4c9bf51f22bdd68623b5 Author: Andrew MacLeod Date: Mon Nov 8 09:32:42 2021 -0500 Don't calculate new values when using

Re: [COMMITTED] path oracle: Do not look at root oracle for killed defs.

2021-11-08 Thread Andrew MacLeod via Gcc-patches
On 11/6/21 11:35 AM, Aldy Hernandez wrote: [This is more Andrew's domain, but this is a P1 PR and I'd like to unbreak the SPEC run, since this is a straigthforward fix. When he returns he can double check my work and give additional suggestions.] The problem here is that we are incorrectly

Re: [COMMITTED] path oracle: Do not look at root oracle for killed defs.

2021-11-08 Thread Andrew MacLeod via Gcc-patches
On 11/8/21 3:44 AM, Richard Biener via Gcc-patches wrote: On Sat, Nov 6, 2021 at 4:38 PM Aldy Hernandez via Gcc-patches wrote: [This is more Andrew's domain, but this is a P1 PR and I'd like to unbreak the SPEC run, since this is a straigthforward fix. When he returns he can double check my

[COMMITTED] PR-tree-optimization/103093 - Remove def chain import assert from GORI.

2021-11-05 Thread Andrew MacLeod via Gcc-patches
the offending assert. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From 1f6dd5de33912c261a5003150212c290165ac1b6 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 5 Nov 2021 11:25:09 -0400 Subject: [PATCH 2/2] Remove def chain import assert from GORI. When the IL

[COMMITTED] PR tree-optimization/102943 - Abstract ranger cache update list.

2021-11-05 Thread Andrew MacLeod via Gcc-patches
. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From 98244c68e77cf75f93b66ee02df059f718c3fbc0 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 4 Nov 2021 15:08:06 -0400 Subject: [PATCH 1/2] Abstract ranger cache update list. Make it more efficient by removing the c

[COMMITTED] PR tree-optimization/103079 - Treat undefined operands as varying in GORI.

2021-11-04 Thread Andrew MacLeod via Gcc-patches
004afb984beb6efbe25f44a5857b1c27ebc2ec82 Author: Andrew MacLeod Date: Thu Nov 4 11:07:28 2021 -0400 Treat undefined operands as varying in GORI. If the LHS is UNDEFINED simply stop calculating. Treat op1 and op2 as VARYING if they are UNDEFINED. PR tree

[COMMITTED] Switch vrp2 to ranger.

2021-11-03 Thread Andrew MacLeod via Gcc-patches
. Andrew >From 502ffb1f389011b28ee51815242c7397790802d5 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 2 Nov 2021 21:26:44 -0400 Subject: [PATCH 6/6] Switch vrp2 to ranger. This patch flips the default for the VRP2 pass to execute ranger vrp rather than the assert_expr version of VRP. * params.opt (param_vrp2

[COMMITTED] Testcase adjustments for pass vrp1.

2021-11-03 Thread Andrew MacLeod via Gcc-patches
hecking for a symbolic range.. Dmalcolm adjusted the testcase for me to accomplish his original goal without depending on symbolics. Thanks!! no regressions on x86_64-pc-linux-gnu,  pushed. Andrew >From 1410b208013e4ccd9438cda178c7ea995684e7e8 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod

[COMMITTED] For ranges, PHIs don't need to process arg == def.

2021-11-03 Thread Andrew MacLeod via Gcc-patches
_2 can never be anything other than [0,0], no matter what value comes in on edge 6, so lets not even check. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From 6d936684fcf9bbb55837e3a87ae2221d5ec9b5b7 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 2 Nov 2021

[COMMITTED] Check for constant builtin value first.

2021-11-03 Thread Andrew MacLeod via Gcc-patches
on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From b18394ce15639489a91a502d3b9db30d73898191 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 1 Nov 2021 16:20:59 -0400 Subject: [PATCH 3/6] Check for constant builtin value first. The original code imported from E

[COMMITTED] Fix --param=ranger-debug=all to include a trace.

2021-11-03 Thread Andrew MacLeod via Gcc-patches
.  Pushed. Andrew >From 309bb7ff6e2807ecd849c133c3639705f20e5894 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 1 Nov 2021 16:40:45 -0400 Subject: [PATCH 2/6] Fix --param=ranger-debug=all to include a trace. A recent change made each debug flag its own value, but the 'all' va

[COMMITTED] Provide some context to folding via ranger.

2021-11-03 Thread Andrew MacLeod via Gcc-patches
otstraps on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From fc4076752067fb400b43adbd629081df658da246 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 1 Nov 2021 13:32:11 -0400 Subject: [PATCH 1/6] Provide some context to folding via ranger. Provide an internal mechanism to supply conte

[COMMITTED] PR tree-optimization/103003 - Don't register nonsensical relations.

2021-11-01 Thread Andrew MacLeod via Gcc-patches
94f0ff1aa Author: Andrew MacLeod Date: Sat Oct 30 11:00:49 2021 -0400 Don't register nonsensical relations. gcc/ PR tree-optimization/103003 * value-relation.cc (dom_oracle::register_relation): If the 2 ssa names are the same, don't reg

[COMMITTED] PR tree-optimization/102983 - Perform on-entry propagation after range_of_stmt on a gcond.

2021-10-29 Thread Andrew MacLeod via Gcc-patches
rom cb596fd43667f92c4cb037a4ee8b2061c393ba60 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 28 Oct 2021 13:31:17 -0400 Subject: [PATCH] Perform on-entry propagation after range_of_stmt on a gcond. Propagation is automatically done by the temporal cache when defs are out of date from the names on the RHS, but a gc

[COMMITTED] Fix ifcvt-4.c to not depend on VRP2 asserts.

2021-10-28 Thread Andrew MacLeod via Gcc-patches
the be the primaries.  Pushed. Andrew >From d123daec0c237533cf974334d98bc6d357d4273e Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 25 Oct 2021 13:34:36 -0400 Subject: [PATCH 3/3] Fix ifcvt-4.c to not depend on VRP2 asserts. The testcase fails if VRP2 is replaced with a non-assert ba

[COMMITTED] Unify EVRP and VRP folding predicate message.

2021-10-28 Thread Andrew MacLeod via Gcc-patches
rts a couple of EVRP tests to expect the new format. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From a6bbf1cc9f2847115543d720a99152d7dc2c4892 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 26 Oct 2021 13:19:05 -0400 Subject: [PATCH 2/3] Unify EVRP and VRP f

[COMMITTED] tree-optimization/102940 - Reset scev before invoking array_checker.

2021-10-28 Thread Andrew MacLeod via Gcc-patches
As pointed out, we need to reset scev before invoking the array-checker in execute_ranger_vrp. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From d46aeb5906b8ed7ee255cfbacc5cf9d2f56b850c Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 26 Oct 2021 14

Re: [COMMITTED] Fold all statements in Ranger VRP.

2021-10-28 Thread Andrew MacLeod via Gcc-patches
On 10/28/21 9:38 AM, Jeff Law wrote: On 10/25/2021 6:03 PM, Andrew MacLeod via Gcc-patches wrote: This patch changes the ranger VRP pass to simplify all statements, not just the ones with ranges.  I believe Jeff had mentioned we were no longer doing this a while back.  Now we need it when

[COMMITTED] Move vrp_simplify_cond_using_ranges to the simplifier.

2021-10-25 Thread Andrew MacLeod via Gcc-patches
a standalone static function in tree-vrp.c. Bootstrapped on x86_64-pc-linux-gnu with no regressions. Pushed. Andrew >From f5bacd9c5be5e129688d9c91eeed05e7b968117e Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 25 Oct 2021 18:04:06 -0400 Subject: [PATCH 2/2] Move vrp_simplify_cond_using_ran

[COMMITTED] Fold all statements in Ranger VRP.

2021-10-25 Thread Andrew MacLeod via Gcc-patches
with no regressions. Pushed. Andrew >From cb153222404e2e149aa65a4b3139b09477551203 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 20 Oct 2021 13:37:29 -0400 Subject: [PATCH 1/2] Fold all statements in Ranger VRP. Until now, ranger VRP has only simplified statements with ran

Re: Make full use of context-sensitive ranges in access warnings

2021-10-25 Thread Andrew MacLeod via Gcc-patches
On 10/25/21 4:24 PM, Jeff Law via Gcc-patches wrote: On 10/25/2021 1:31 PM, Martin Sebor wrote: On 10/25/21 12:57 PM, Jeff Law wrote: On 10/23/2021 5:49 PM, Martin Sebor via Gcc-patches wrote: Somewhat belatedly following Aldy's lead on finishing the conversion to Ranger, the attached

Re: [PATCH] Try to resolve paths in threader without looking further back.

2021-10-25 Thread Andrew MacLeod via Gcc-patches
On 10/20/21 6:28 AM, Aldy Hernandez wrote: Sometimes we can solve a candidate path without having to recurse further back. This can mostly happen in fully resolving mode, because we can ask the ranger what the range on entry to the path is, but there's no reason this can't always apply. This

Re: how does vrp2 rearrange this?

2021-10-25 Thread Andrew MacLeod via Gcc-patches
On 10/21/21 3:59 PM, Andrew Pinski wrote: On Thu, Oct 21, 2021 at 8:04 AM Andrew MacLeod wrote: On 10/19/21 7:13 PM, Andrew Pinski wrote: On Tue, Oct 19, 2021 at 3:32 PM Andrew MacLeod wrote: On 10/19/21 5:13 PM, Andrew Pinski wrote: On Tue, Oct 19, 2021 at 1:29 PM Andrew MacLeod via Gcc

[COMMITTED] Always output exported ranges to a dump_file.

2021-10-25 Thread Andrew MacLeod via Gcc-patches
8ac Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 20 Oct 2021 13:41:12 -0400 Subject: [PATCH 2/3] Always output exported ranges to a dump_file. * gimple-range.cc (gimple_ranger::export_global_ranges): Remove check for TDF_DETAILS. --- gcc/gimple-range.cc | 2 +- 1 file changed, 1 insert

[COMMITTED] Tweak ranger-debug flags

2021-10-25 Thread Andrew MacLeod via Gcc-patches
that situation. Bootstraps onx86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From 2bfb21bb8ce16698926576870e4b1f2609e0c909 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 21 Oct 2021 10:58:16 -0400 Subject: [PATCH 1/3] Tweak ranger-debug flags. Set the 3 possible fl

[COMMITTED] Re: [PATCH] Possible use before def in fortran/trans-decl.c.

2021-10-25 Thread Andrew MacLeod via Gcc-patches
On 10/21/21 3:02 PM, Andrew MacLeod wrote: As I'm tweaking installing ranger as the VRP2 pass, I am getting a stage 2 bootstrap failure now: In file included from /opt/notnfs/amacleod/master/gcc/gcc/fortran/trans-decl.c:28: /opt/notnfs/amacleod/master/gcc/gcc/tree.h: In function ‘void

[PATCH] Possible use before def in fortran/trans-decl.c.

2021-10-21 Thread Andrew MacLeod via Gcc-patches
Andrew PS as a side note, it would be handy to have the def point *and* the use point that might be undefined.   Its a big function and it took me a while just to see where a possible use might be. commit ed571a93c54e3967fbf445624e47817be5e333ed Author: Andrew MacLeod Date: Thu Oct 2

Re: how does vrp2 rearrange this?

2021-10-21 Thread Andrew MacLeod via Gcc-patches
On 10/19/21 7:13 PM, Andrew Pinski wrote: On Tue, Oct 19, 2021 at 3:32 PM Andrew MacLeod wrote: On 10/19/21 5:13 PM, Andrew Pinski wrote: On Tue, Oct 19, 2021 at 1:29 PM Andrew MacLeod via Gcc-patches wrote: using testcase ifcvt-4.c: typedef int word __attribute__((mode(word))); word foo

[COMMITTED 3/3] Split --param=evrp-mode into evrp-mode and ranger-debug.

2021-10-21 Thread Andrew MacLeod via Gcc-patches
gnu with no regressions.  Pushed. >From 9cb114fd5550eb02dfd6b8db5cb5b8fb72827d53 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 19 Oct 2021 14:09:51 -0400 Subject: [PATCH 3/3] Split --param=evrp-mode into evrp-mode and ranger-debug. With Ranger being used in more than EVRP, the debug output should no longer

[COMMITTED 2/3] Add --param=vrp1-mode and --param=vrp2-mode.

2021-10-21 Thread Andrew MacLeod via Gcc-patches
352db00f84d382e33a8 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 15 Oct 2021 12:06:27 -0400 Subject: [PATCH 2/3] Add --param=vrp1-mode and --param=vrp2-mode. Add 2 new params to select between VRP and RANGER to be used for each pass. * doc/invoke.texi: (vrp1-mode, vrp2-mode): Document.

[COMMITED 1/3] Move ranger only VRP folder to tree-vrp.

2021-10-21 Thread Andrew MacLeod via Gcc-patches
version of VRP to be instantiated. There is no functional change. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. >From 434ebc1e08b1d83ecd3622ee2a3c7270869bda52 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 15 Oct 2021 12:26:13 -0400 Subject: [PATCH 1/3] M

Re: [RFC] Remove VRP threader passes in exchange for better threading pre-VRP.

2021-10-20 Thread Andrew MacLeod via Gcc-patches
On 10/20/21 5:27 AM, Aldy Hernandez wrote: On Wed, Oct 20, 2021 at 1:00 AM Jeff Law wrote: On 10/18/2021 8:03 AM, Aldy Hernandez wrote: On 10/18/21 3:41 PM, Aldy Hernandez wrote: I've been experimenting with reducing the total number of threading passes, and I'd like to see if there's

Re: how does vrp2 rearrange this?

2021-10-19 Thread Andrew MacLeod via Gcc-patches
On 10/19/21 5:13 PM, Andrew Pinski wrote: On Tue, Oct 19, 2021 at 1:29 PM Andrew MacLeod via Gcc-patches wrote: using testcase ifcvt-4.c: typedef int word __attribute__((mode(word))); word foo (word x, word y, word a) { word i = x; word j = y; /* Try to make taking the branch

how does vrp2 rearrange this?

2021-10-19 Thread Andrew MacLeod via Gcc-patches
using testcase ifcvt-4.c: typedef int word __attribute__((mode(word))); word foo (word x, word y, word a) {   word i = x;   word j = y;   /* Try to make taking the branch likely.  */   __builtin_expect (x > y, 1);   if (x > y)     {   i = a;   j = i;     }   return i * j; The current

[COMMITTED] tree-optimization/102796 - Process EH edges again.

2021-10-18 Thread Andrew MacLeod via Gcc-patches
/audit  that in a follow up so there is better consistency between when we check gimple_range_ssa_p and irange::type_support_p() Andrew commit 4d92a69fc5882c86aab63d52382b393d4f20b3ed Author: Andrew MacLeod Date: Mon Oct 18 13:52:18 2021 -0400 Process EH edges again and call

Re: [PATCH] Ranger : Do not process abnormal ssa-names.

2021-10-18 Thread Andrew MacLeod via Gcc-patches
On 10/16/21 5:27 AM, Andrew Pinski wrote: On Fri, Oct 15, 2021 at 6:53 AM Andrew MacLeod via Gcc-patches wrote: I've been looking at the pathological time issue ranger has with the testcase from, uh.. PR 97623 I think. I've lost the details, but kept the file since it was showing

[COMMITTED] Ranger : Do not process abnormal ssa-names.

2021-10-15 Thread Andrew MacLeod via Gcc-patches
On 10/15/21 10:17 AM, Jeff Law wrote: I don't want to push it quite yet as I wanted feedback to make sure we don't actually do anything I'm not aware of with SSA_NAMES which have the ABNORMAL_PHI flag set.  Most of the code i can find in VRP and vr-values appears to punt, so I presume not

[PATCH] Ranger : Do not process abnormal ssa-names.

2021-10-15 Thread Andrew MacLeod via Gcc-patches
rom 146744fcde6a67f759ffc4aa3e8340861e229829 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 7 Oct 2021 10:12:29 -0400 Subject: [PATCH] Ranger : Do not process abnormal ssa-names. * gimple-range-fold.h (gimple_range_ssa_p): Don't process names that occur in abnormal phis. * gimple-range.cc (gimple_ran

Re: [PATCH] Convert strlen pass from evrp to ranger.

2021-10-14 Thread Andrew MacLeod via Gcc-patches
On 10/14/21 6:07 PM, Martin Sebor via Gcc-patches wrote: On 10/9/21 12:47 PM, Aldy Hernandez via Gcc-patches wrote: We seem to be passing a lot of context around in the strlen code.  I certainly don't want to contribute to more. Most of the handle_* functions are passing the gsi as well as

Re: [r12-4413 Regression] FAIL: gcc.dg/pr102738.c (test for excess errors) on Linux/x86_64

2021-10-14 Thread Andrew MacLeod via Gcc-patches
On 10/14/21 8:19 PM, sunil.k.pandey wrote: On Linux/x86_64, f0b7d4cc49ddb1c2c7474cc3f61e260aa93a96c0 is the first bad commit commit f0b7d4cc49ddb1c2c7474cc3f61e260aa93a96c0 Author: Andrew MacLeod Date: Thu Oct 14 10:43:58 2021 -0400 Simplification for right shift. caused FAIL: gcc.dg

Re: [COMMITTED] tree-optimization/102738 - Simplification for right shift.

2021-10-14 Thread Andrew MacLeod via Gcc-patches
On 10/14/21 7:42 PM, H.J. Lu wrote: On Thu, Oct 14, 2021 at 11:06 AM Andrew MacLeod via Gcc-patches wrote: As the PR observes, if the first operand of a right shift is 0 or -1, operand 2 doesn't matter and the result will be the same as op1, so it can be turned into a copy. This patch checks

[COMMITTED] tree-optimization/102738 - Simplification for right shift.

2021-10-14 Thread Andrew MacLeod via Gcc-patches
with no regressions.  Pushed. Andrew commit f0b7d4cc49ddb1c2c7474cc3f61e260aa93a96c0 Author: Andrew MacLeod Date: Thu Oct 14 10:43:58 2021 -0400 Simplification for right shift. When the first operand of a signed right shift is zero or negative one, the RHS doesn't matter and the shift can

Re: [RFC] Replace VRP with EVRP passes

2021-10-14 Thread Andrew MacLeod via Gcc-patches
On 10/14/21 8:54 AM, Richard Biener wrote: On Thu, Oct 14, 2021 at 2:46 PM Andrew MacLeod wrote: I always test ada, objc.. anything that can be built as part of my normal build :-) so yes. As far as I am aware, we are not missing any symbolic/relational cases, that has all been functioning

Re: [RFC] Replace VRP with EVRP passes

2021-10-14 Thread Andrew MacLeod via Gcc-patches
On 10/14/21 4:27 AM, Richard Biener wrote: On Wed, Oct 13, 2021 at 10:58 PM Andrew MacLeod wrote: As work has progressed, we're pretty close to being able to functionally replace VRP with another EVRP pass. At least it seems close enough that we should discuss if thats something we might want

[RFC] Replace VRP with EVRP passes

2021-10-13 Thread Andrew MacLeod via Gcc-patches
As work has progressed, we're pretty close to being able to functionally replace VRP with another EVRP pass.  At least it seems close enough that we should discuss if thats something we might want to consider for this release.   Replacing just one of the 2 VRP passes is another option. First,

Re: [PATCH] Convert strlen pass from evrp to ranger.

2021-10-08 Thread Andrew MacLeod via Gcc-patches
On 10/8/21 12:51 PM, Martin Sebor via Gcc-patches wrote: I.e., in the test: void g (char *s1, char *s2) {   char b[1025];   size_t n = __builtin_strlen (s1), d = __builtin_strlen (s2);   if (n + d + 1 >= 1025)     return;   sprintf (b, "%s.%s", s1, s2); // { dg-bogus "\\\[-Wformat-overflow"

[COMMITTED] Add range intersect with 2 wide-ints.

2021-10-06 Thread Andrew MacLeod via Gcc-patches
-linux-gnu with no regressions.  Pushed. Andrew >From ad451b020a24fe7111e668f8c41a3ba648104569 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 4 Oct 2021 15:30:44 -0400 Subject: [PATCH 4/4] Add range intersect with 2 wide-ints. Add a more efficent intersect using a lower/upper bo

[COMMITTED] Introduce a param-switch-limit for EVRP.

2021-10-06 Thread Andrew MacLeod via Gcc-patches
.  Limiting the number of subranges had no measurable effect on things. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From 3ca950c3525527846f13e8c547368ef432547a23 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 29 Sep 2021 17:25:50 -0400 Subject: [PATCH

[COMMITTED] Use TYPE_MIN/MAX_VALUE in set_varying when possible.

2021-10-06 Thread Andrew MacLeod via Gcc-patches
this produces decent results.  Over a set of 380 GCC source files, it produces a further 4.5% speedup in EVRP. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From e828f4b5898896240b2ae5d5030c539aff28ea24 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 28 Sep 2021 13

[COMMITTED] Ranger: More efficient zero/nonzero check.

2021-10-06 Thread Andrew MacLeod via Gcc-patches
001 From: Andrew MacLeod Date: Mon, 27 Sep 2021 18:53:54 -0400 Subject: [PATCH 1/4] Ranger: More efficient zero/nonzero check. A recent change introduced a frequent check for zero and non-zero which has caused a lot of extra temporary trees to be created. Make the check more efficent as it is alw

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-10-05 Thread Andrew MacLeod via Gcc-patches
On 9/28/21 7:50 AM, Richard Biener wrote: On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote: Hello. The patch extends the loop unswitching pass so that gswitch statements are supported. The pass now uses ranger which marks switch edges that are known to be unreachable in a versioned loop.

Re: [PATCH] Remove static marker for range in alloca pass.

2021-10-04 Thread Andrew MacLeod via Gcc-patches
On 10/4/21 4:15 AM, Richard Biener via Gcc-patches wrote: On Mon, Oct 4, 2021 at 8:55 AM Aldy Hernandez via Gcc-patches wrote: The m_ranges[] field in int_range are trees, so they live in GC space. Since invalid_range is static, it must be marked with GTY magic. However, calculating

Re: [PATCH] Pass relations down to range_operator::op[12]_range.

2021-10-01 Thread Andrew MacLeod via Gcc-patches
On 10/1/21 8:43 AM, Aldy Hernandez wrote: It looks like we don't pass relations down to the op[12]_range operators. This is causing problems when implementing some relational magic for the shift operators. Andrew, this looks like an oversight. If so, how does this look? Hrm.  It's at least

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-09-29 Thread Andrew MacLeod via Gcc-patches
On 9/29/21 11:28 AM, Jeff Law wrote: On 9/29/2021 9:20 AM, Andrew MacLeod via Gcc-patches wrote: On 9/29/21 4:43 AM, Richard Biener wrote: On Tue, Sep 28, 2021 at 10:39 PM Andrew MacLeod wrote: On 9/28/21 7:50 AM, Richard Biener wrote: On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-09-29 Thread Andrew MacLeod via Gcc-patches
On 9/29/21 4:43 AM, Richard Biener wrote: On Tue, Sep 28, 2021 at 10:39 PM Andrew MacLeod wrote: On 9/28/21 7:50 AM, Richard Biener wrote: On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote: /* Unswitch single LOOP. NUM is number of unswitchings done; we do not allow @@ -269,6 +311,7

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-09-28 Thread Andrew MacLeod via Gcc-patches
On 9/28/21 7:50 AM, Richard Biener wrote: On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote: /* Unswitch single LOOP. NUM is number of unswitchings done; we do not allow @@ -269,6 +311,7 @@ tree_unswitch_single_loop (class loop *loop, int num) class loop *nloop; unsigned i,

[COMMITTED] tree-optimization/102463 - Look for a relation between operands only when possible.

2021-09-23 Thread Andrew MacLeod via Gcc-patches
ts... The phi will never overtly give us a relation between the first and second operand, so no need to check. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew >From fe4e6c824a580012bf9034cc33f0b440df93f56f Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 23 Sep

[COMMITTED] Ranger converted to a local edge flag instead of EDGE_EXECUTABLE.

2021-09-23 Thread Andrew MacLeod via Gcc-patches
s.  Pushed. Andrew >From 053e1d642104d19d5f9e5fb08a9e7354a0db28f5 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 22 Sep 2021 16:58:22 -0400 Subject: [PATCH 1/2] Create a ranger-local flag for non-executable edges. Instead of repurposing EDGE_EXECUTABLE, ranger creates a local fla

Re: [COMMITTED] Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges.

2021-09-22 Thread Andrew MacLeod via Gcc-patches
On 9/22/21 4:25 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 3:50 PM Andrew MacLeod wrote: On 9/21/21 9:32 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 2:57 PM Andrew MacLeod wrote: On 9/21/21 2:14 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 8:09 AM Richard Biener wrote

Re: [PATCH 2/7] Do not query SCEV in range_of_phi unless dominators are available.

2021-09-21 Thread Andrew MacLeod via Gcc-patches
On 9/21/21 12:53 PM, Aldy Hernandez wrote: SCEV won't work without dominators and we can get called without dominators from debug_ranger. Another option would be to rename scev_initialized_p to something like scev_available_p and move the check there. For now, this will do. Committed.

Re: [COMMITTED] Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges.

2021-09-21 Thread Andrew MacLeod via Gcc-patches
On 9/21/21 9:32 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 2:57 PM Andrew MacLeod wrote: On 9/21/21 2:14 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 8:09 AM Richard Biener wrote: On Tue, Sep 21, 2021 at 12:01 AM Andrew MacLeod via Gcc-patches wrote: The patch sets

Re: [COMMITTED] Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges.

2021-09-21 Thread Andrew MacLeod via Gcc-patches
On 9/21/21 2:14 AM, Richard Biener wrote: On Tue, Sep 21, 2021 at 8:09 AM Richard Biener wrote: On Tue, Sep 21, 2021 at 12:01 AM Andrew MacLeod via Gcc-patches wrote: The patch sets the EXECUTABLE property on edges like VRP does, and then removes that flag when an edge is determined

[COMMITTED] Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges.

2021-09-20 Thread Andrew MacLeod via Gcc-patches
with no regressions. pushed. Andrew >From 73cf73af2392e00917de042a4692f6a0b6329ee8 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 24 Aug 2021 12:13:24 -0400 Subject: [PATCH 2/2] Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges. If an incoming edge is UNDEFINED, don't proc

[COMMITTED] Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges.

2021-09-20 Thread Andrew MacLeod via Gcc-patches
with no regressions. pushed. Andrew >From 73cf73af2392e00917de042a4692f6a0b6329ee8 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Tue, 24 Aug 2021 12:13:24 -0400 Subject: [PATCH 2/2] Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges. If an incoming edge is UNDEFINED, don't proc

[COMMITTED] Relation oracle: Make each def a new equivalency record.

2021-09-20 Thread Andrew MacLeod via Gcc-patches
tion based analysis, but for now this takes care of most of the issue. bootstrapped on x86_64-pc-linux-gnu with no regressions.  pushed. Andrew >From 5d110fe90afcd850ea21aee6429f22edd6b1b592 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 17 Sep 2021 14:58:06 -0400 Subject: [PATCH 1/2]

[COMMITTED] Provide a relation oracle for paths.

2021-09-17 Thread Andrew MacLeod via Gcc-patches
shortly. Andrew >From 534c5352a02485a41ebfb133b42edbbecba7eba3 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 17 Sep 2021 09:48:35 -0400 Subject: [PATCH 2/2] Provide a relation oracle for paths. This provides a path_oracle class which can optionally be used in conjunction with anot

[COMMITTED] Virtualize relation oracle and various cleanups.

2021-09-17 Thread Andrew MacLeod via Gcc-patches
rom 3674d8e6fc6305507ed50b501f049f25f868458a Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 15 Sep 2021 14:43:51 -0400 Subject: [PATCH 1/2] Virtualize relation oracle and various cleanups. Standardize equiv_oracle API onto the new relation_oracle virtual base, and then have dom_oracle inherit from that. equiv_

Re: [PATCH] Implement POINTER_DIFF_EXPR entry in range-op.

2021-09-03 Thread Andrew MacLeod via Gcc-patches
On 9/3/21 10:41 AM, Aldy Hernandez wrote: [Andrew, do you see any problem with using the minus relational code here? It seems like everything matches up.] I've seen cases in the upcoming jump threader enhancements where we see a difference of two pointers that are known to be equivalent, and

Re: [PATCH] avoid printing range table header alone

2021-08-26 Thread Andrew MacLeod via Gcc-patches
On 8/25/21 7:49 PM, Martin Sebor wrote: On 8/25/21 1:34 PM, Andrew MacLeod wrote: FWIW, I see duplicate output in the EVRP1 dump that looks just like it could be the output under Non-varying global ranges. I wonder if it's the result of the block in ranger_cache::fill_block_cache guarded

Re: [PATCH] avoid printing range table header alone

2021-08-25 Thread Andrew MacLeod via Gcc-patches
On 8/25/21 3:15 PM, Martin Sebor wrote: On 8/25/21 11:46 AM, Andrew MacLeod wrote: On 8/25/21 1:25 PM, Martin Sebor wrote: I noticed that the output of -fdump-tree-walloca (and probably all passes that call gimple_ranger::export_global_ranges()) includes the following two lines for all

Re: [PATCH] avoid printing range table header alone

2021-08-25 Thread Andrew MacLeod via Gcc-patches
On 8/25/21 1:25 PM, Martin Sebor wrote: I noticed that the output of -fdump-tree-walloca (and probably all passes that call gimple_ranger::export_global_ranges()) includes the following two lines for all functions, even when there's nothing else of relevance after them: Exported global range

Re: [PING][PATCH] enable ranger and caching in pass_waccess

2021-08-25 Thread Andrew MacLeod via Gcc-patches
On 8/25/21 11:20 AM, Martin Sebor wrote: Ping: Andrew, did I answer your questions?  Do you (or anyone else) have any other comments on the latest patch below? https://gcc.gnu.org/pipermail/gcc-patches/2021-August/577865.html I wasn't attempting to block it, its outside my review purview..

[COMMITTED] Add transitive operations to the relation oracle.

2021-08-24 Thread Andrew MacLeod via Gcc-patches
pushed. Andrew commit 675a3e40567e1d0dd6d7e7be3efab74b22731415 Author: Andrew MacLeod Date: Wed Aug 18 16:36:19 2021 -0400 Add transitive operations to the relation oracle. When registering relations in the oracle, search for other relations which imply new transitive relation

Re: [PATCH] enable ranger and caching in pass_waccess

2021-08-20 Thread Andrew MacLeod via Gcc-patches
On 8/19/21 7:09 PM, Martin Sebor via Gcc-patches wrote: The attached patch changes the new access warning pass to use the per-function ranger instance.  To do that it makes a number of the global static functions members of the pass (that involved moving one to a later point in the file,

Re: [PATCH] document enable/disable_ranger

2021-08-19 Thread Andrew MacLeod via Gcc-patches
On 8/19/21 2:00 PM, David Malcolm wrote: On Thu, 2021-08-19 at 11:30 -0600, Martin Sebor via Gcc-patches wrote: Hey Aldy & Andrew, I introduced a leak by calling enable_ranger() without pairing it with one to disable_ranger() on the same function (PR 101984). I didn't realize (or look to see)

Re: [PATCH] document enable/disable_ranger

2021-08-19 Thread Andrew MacLeod via Gcc-patches
On 8/19/21 1:30 PM, Martin Sebor wrote: Hey Aldy & Andrew, I introduced a leak by calling enable_ranger() without pairing it with one to disable_ranger() on the same function (PR 101984). I didn't realize (or look to see) that enable_ranger() dynamically allocates memory. The patch below adds

[COMMITTED 3/3] Add GORI tracing faciltiies.

2021-08-17 Thread Andrew MacLeod via Gcc-patches
o the bug in op1_range for ABS_EXPR. Im sure there will be more tweaking to this, but its a start. Anyway, Bootstrapped on x86_64-pc-linux-gnu  with no regressions. Pushed. Andrew >From 4759e1e0453bef163d8dbeebbb96dc40b049c117 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 12 Aug 2

[COMMITTED 2/3] Change evrp-mode options.

2021-08-17 Thread Andrew MacLeod via Gcc-patches
  with no regressions. Pushed. Andrew >From 0bb74a28e1318cbac9c895f1079b384a42513a9c Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 12 Aug 2021 14:02:20 -0400 Subject: [PATCH 2/3] Change evrp-mode options. Remove tracing in hybrid mode. Add trace/gori/cache tracing options. tracing opti

[COMMITTED 1/3] Abstract range tracing routines into a class.

2021-08-17 Thread Andrew MacLeod via Gcc-patches
ound when something is wrong. Bootstrapped on x86_64-pc-linux-gnu  with no regressions. Pushed. Andrew >From e68c8280fa2e1b7071378cfdd876155c73ec944f Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Fri, 30 Jul 2021 15:15:29 -0400 Subject: [PATCH 1/3] Abstract tracing routines

Re: [COMMITTED] PR tree-optimization/101741 - Ensure toupper and tolower follow the expected pattern.

2021-08-10 Thread Andrew MacLeod via Gcc-patches
On 8/10/21 3:45 AM, Richard Biener wrote: On Mon, Aug 9, 2021 at 10:31 PM Andrew MacLeod via Gcc-patches wrote: The user has overridden the function name "toupper" . Its marked as a builtin function, presumably because it matches the name. In range folding, we were assumi

[COMMITTED] PR tree-optimization/101741 - Ensure toupper and tolower follow the expected pattern.

2021-08-09 Thread Andrew MacLeod via Gcc-patches
commit c86c95edd165d674614516cda0b1fcb6616c1096 Author: Andrew MacLeod Date: Mon Aug 9 15:53:42 2021 -0400 Ensure toupper and tolower follow the expected pattern. If the parameter is not compatible with the LHS, assume this is not really a builtin function to avoid a trap. gcc/

[COMMITTED] Handle constants in wi_fold for trunc_mod.

2021-07-30 Thread Andrew MacLeod via Gcc-patches
. Andrew >From 145bc41dae7c7bfa093d61e77346f98e6a595a0e Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 29 Jul 2021 11:22:28 -0400 Subject: [PATCH 3/3] Handle constants in wi_fold for trunc_mod. Handle const % const, as wi_fold_in_parts may now provide this. Before this [10, 10] % [4

[COMMITTED] Change integral divide by zero to produce UNDEFINED range.

2021-07-30 Thread Andrew MacLeod via Gcc-patches
rom ebbcdd7fae1f802763850e4afedfdfa09cf10e1a Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 28 Jul 2021 13:14:22 -0400 Subject: [PATCH 2/3] Change integral divide by zero to produce UNDEFINED. Instead of VARYING, we can get better results by treating divide by zero as producing an undefined result.

[COMMITTED] Change const basic_block to const_basic_block in gimple-range-cache.

2021-07-30 Thread Andrew MacLeod via Gcc-patches
AS mentioned elsewhere, its const_basic_block not const basic_block. bootstrapped on x86_64-pc-linux-gnu  with no regressions. pushed. Andrew >From d242acc396d645267cd1ccbdb4d0d73cc9b1ef48 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Thu, 29 Jul 2021 09:15:45 -0400 Subject: [PATCH

Re: Question about divide by 0 and what we can do with it

2021-07-29 Thread Andrew MacLeod via Gcc-patches
On 7/29/21 3:19 AM, Richard Biener wrote: On Wed, Jul 28, 2021 at 4:39 PM Andrew MacLeod wrote: Which has removed the second call to builtin_abort()(Even before we get to EVRP!) SO the issue doesn't seem to be removing the divide by 0, it seems to be a pattern match for [0,1

Question about divide by 0 and what we can do with it

2021-07-28 Thread Andrew MacLeod via Gcc-patches
So Im seeing what appears to me to be inconsistent behaviour. in pr96094.c we see: int foo (int x) {   if (x >= 2U)     return 34;   return 34 / x; } x has a range of [0,1] and since / 0  in undefined, the expectation is that we fold this to "return 34" and vrp1 does this:   [local count:

[COMMITTED] Return undefined range on edges which are not executed.

2021-07-28 Thread Andrew MacLeod via Gcc-patches
in successor blocks. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  pushed. Andrew commit 04600a47224b1ff85c6fb870218b51969cceff21 Author: Andrew MacLeod Date: Wed Jul 28 08:30:02 2021 -0400 Return undefined on edges which are not executed. When a branch has been

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
On 7/26/21 5:01 PM, Jakub Jelinek wrote: On Mon, Jul 26, 2021 at 04:57:14PM -0400, Andrew MacLeod wrote: Handle ASCII and EBCDIC in toupper and tolower ranges. gcc/ PR tree-optimization/7 * gimple-range-fold.cc (get_letter_range): New

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
vid is right, that their difference is 25. I think we don't support EBCDIC on the host, but what if. Jakub Fine by me.  This is running thru testing now :-) This seems good yes? Andrew commit f13a661874b772e473ee78fe8133899db51ea642 Author: Andrew MacLeod Date: Mon Jul 26 15:38:42 2021 -0400

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
... Andrew On 7/26/21 2:39 PM, David Malcolm wrote: On Mon, 2021-07-26 at 14:21 -0400, Andrew MacLeod via Gcc-patches wrote: Remove lower case characters from the range of to_upper and likewise, upper case characters from to_lower. I looked at also only adding the upper case characters

Re: [COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
On 7/26/21 2:39 PM, David Malcolm wrote: On Mon, 2021-07-26 at 14:21 -0400, Andrew MacLeod via Gcc-patches wrote: Remove lower case characters from the range of to_upper and likewise, upper case characters from to_lower. I looked at also only adding the upper case characters for which

[COMMITTED] tree-optimization/78888 - Adjust ranges for to_upper and to_lower.

2021-07-26 Thread Andrew MacLeod via Gcc-patches
rapped on  x86_64-pc-linux-gnu  with no regressions. Pushed. commit 1ce0b26e6e1e6c348b1d54f1f462a44df6fe47f5 Author: Andrew MacLeod Date: Mon Jul 26 09:40:32 2021 -0400 Adjust ranges for to_upper and to_lower. Exclude lower case chars from to_upper and upper case

[COMMITTED] PR tree-optimization/101511 - Allow non-symmetrical equivalences.

2021-07-22 Thread Andrew MacLeod via Gcc-patches
Andrew >From d3fa77472b78c5ddada03a1052b229bea11cb76f Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 19 Jul 2021 15:54:57 -0400 Subject: [PATCH 3/3] Allow non-symmetrical equivalences. Don't trap if equivalences are processed out of DOM order, and aren't completely symmetrical. We will eventually resolve

[COMMITTED] PR tree-optimization/101497 - Check for undefined on COND_EXPR before querying type.

2021-07-22 Thread Andrew MacLeod via Gcc-patches
Can't ask for the type of an UNDEFINED value. Bootstrapped on x86_64 & powerpc64-unknown-linux-gnu with no regressions.  Pushed. Andrew >From ea789238b2c24eedf70b56257235adf3d33c5a0a Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 19 Jul 2021 15:16:25 -0400 Subject: [PA

[COMMITTED] PR tree-optimization/101496 - Only call vrp_visit_cond_stmt if range_of_stmt doesn't resolve to a const.

2021-07-22 Thread Andrew MacLeod via Gcc-patches
p 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 19 Jul 2021 14:02:57 -0400 Subject: [PATCH 1/3] Only call vrp_visit_cond_stmt if range_of_stmt doesn't resolve to a const. Eevntually all functionality will be subsumed. Until then, call it only if needed. gcc/ PR tree-optimization/10149

[COMMITTED] tree-optimization/96542 - Add wi_fold_in_parts.

2021-07-16 Thread Andrew MacLeod via Gcc-patches
es in the PR.  pushed. Andrew commit 704e8a825c78b9a8424c291509413bbb48e602c7 Author: Andrew MacLeod Date: Fri Jul 16 11:42:14 2021 -0400 Add wi_fold_in_parts. range-ops uses wi_fold to individually fold subranges one at a time and then combined them. This patch first calls wi_f

Re: [PATCH 1/3] Remove gimple_expr_type uses from value-range code

2021-07-16 Thread Andrew MacLeod via Gcc-patches
On 7/16/21 9:02 AM, Richard Biener wrote: This removes the last uses from value-range code. Bootstrap & regtest running on x86_64-unknown-linux-gnu, OK? absolutely.

[COMMITTED] Add gimple_range_type for statements.

2021-07-15 Thread Andrew MacLeod via Gcc-patches
find the type in an orderly fashion, and then determine if it is also supported by ranger. Bootstrapped on x86_64-pc-linux-gnu with no regressions.  Pushed. Andrew commit 478cc962ad174bfc64c573152a0658935651fce3 Author: Andrew MacLeod Date: Thu Jul 15 11:07:12 2021 -0400 Add

<    1   2   3   4   5   6   7   8   9   10   >