]> gcc.gnu.org Git - gcc.git/commitdiff
Allow PHIs to pick up global values.
authorAndrew MacLeod <amacleod@redhat.com>
Fri, 25 Jun 2021 19:31:39 +0000 (15:31 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Tue, 29 Jun 2021 18:57:01 +0000 (14:57 -0400)
We can also apply known global values to PHI nodes in EVRP.

* value-query.cc (gimple_range_global): Allow phis.

gcc/value-query.cc

index 17dfdb1ccbe95e0f118a2ba63d309e2b1d29d45b..730a214927533e66e23c89b75d570983fe7be845 100644 (file)
@@ -419,7 +419,8 @@ gimple_range_global (tree name)
   gcc_checking_assert (gimple_range_ssa_p (name));
   tree type = TREE_TYPE (name);
 
-  if (SSA_NAME_IS_DEFAULT_DEF (name) || (cfun && cfun->after_inlining))
+  if (SSA_NAME_IS_DEFAULT_DEF (name) || (cfun && cfun->after_inlining)
+      || is_a<gphi *> (SSA_NAME_DEF_STMT (name)))
     {
       value_range vr;
       get_range_global (vr, name);
This page took 0.061577 seconds and 5 git commands to generate.