public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4869] For ranges, PHIs don't need to process arg == def.
@ 2021-11-03 14:38 Andrew Macleod
  0 siblings, 0 replies; only message in thread
From: Andrew Macleod @ 2021-11-03 14:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6d936684fcf9bbb55837e3a87ae2221d5ec9b5b7

commit r12-4869-g6d936684fcf9bbb55837e3a87ae2221d5ec9b5b7
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Tue Nov 2 09:46:53 2021 -0400

    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.

Diff:
---
 gcc/gimple-range-fold.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc
index 6cc7753a750..608d98b43d5 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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-03 14:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 14:38 [gcc r12-4869] For ranges, PHIs don't need to process arg == def Andrew Macleod

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).