diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2021-11-02 09:46:53 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2021-11-03 10:13:32 -0400 |
commit | 6d936684fcf9bbb55837e3a87ae2221d5ec9b5b7 (patch) | |
tree | c63f2cb2f3cbb53d3bfe57ef2bebdfebebe6cacb /gcc | |
parent | b18394ce15639489a91a502d3b9db30d73898191 (diff) | |
download | gcc-6d936684fcf9bbb55837e3a87ae2221d5ec9b5b7.zip gcc-6d936684fcf9bbb55837e3a87ae2221d5ec9b5b7.tar.gz gcc-6d936684fcf9bbb55837e3a87ae2221d5ec9b5b7.tar.bz2 |
For ranges, PHIs don't need to process arg == def.
If an argument of a phi is the same as the DEF of the phi, then the range
on the incoming edge doesn't need to be taken into account since it can't
be anything other than itself.
* gimple-range-fold.cc (fold_using_range::range_of_phi): Don't import
a range from edge if arg == phidef.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimple-range-fold.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index 6cc7753..608d98b 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -779,6 +779,10 @@ fold_using_range::range_of_phi (irange &r, gphi *phi, fur_source &src) for (x = 0; x < gimple_phi_num_args (phi); x++) { tree arg = gimple_phi_arg_def (phi, x); + // An argument that is the same as the def provides no new range. + if (arg == phi_def) + continue; + edge e = gimple_phi_arg_edge (phi, x); // Get the range of the argument on its edge. |