aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2024-06-14 11:01:08 -0400
committerAndrew MacLeod <amacleod@redhat.com>2024-06-14 15:16:38 -0400
commite5e341243bf4a8a93fc9b5776124c64015326356 (patch)
treeeb714e03b99b9809645ae36f20490fae6c8431c3
parentd40034c489c3d4ae149759ba051ef1d661a6c243 (diff)
downloadgcc-e5e341243bf4a8a93fc9b5776124c64015326356.zip
gcc-e5e341243bf4a8a93fc9b5776124c64015326356.tar.gz
gcc-e5e341243bf4a8a93fc9b5776124c64015326356.tar.bz2
Dont add varying values to gori_on_edge mass calculations.
gori_on_edge will return an ssa_lazy_cache with all contextual ranges that can be generated by an edge. This patch adjusts it so that a VARYING range is never added. * gimple-range-gori.cc (gori_calc_operands): Do not continue nor add the range when VARYING is produced for an operand.
-rw-r--r--gcc/gimple-range-gori.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index d489aef..4f6073c 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -1605,11 +1605,14 @@ gori_calc_operands (vrange &lhs, gimple *stmt, ssa_cache &r, range_query *q)
tmp.set_type (TREE_TYPE (si.ssa1));
if (si.calc_op1 (tmp, lhs, si.op2_range))
si.op1_range.intersect (tmp);
- r.set_range (si.ssa1, si.op1_range);
- gimple *src = SSA_NAME_DEF_STMT (si.ssa1);
- // If defintion is in the same basic lock, evaluate it.
- if (src && gimple_bb (src) == gimple_bb (stmt))
- gori_calc_operands (si.op1_range, src, r, q);
+ if (!si.op1_range.varying_p ())
+ {
+ r.set_range (si.ssa1, si.op1_range);
+ gimple *src = SSA_NAME_DEF_STMT (si.ssa1);
+ // If defintion is in the same basic lock, evaluate it.
+ if (src && gimple_bb (src) == gimple_bb (stmt))
+ gori_calc_operands (si.op1_range, src, r, q);
+ }
}
if (si.ssa2 && !r.has_range (si.ssa2))
@@ -1617,10 +1620,13 @@ gori_calc_operands (vrange &lhs, gimple *stmt, ssa_cache &r, range_query *q)
tmp.set_type (TREE_TYPE (si.ssa2));
if (si.calc_op2 (tmp, lhs, si.op1_range))
si.op2_range.intersect (tmp);
- r.set_range (si.ssa2, si.op2_range);
- gimple *src = SSA_NAME_DEF_STMT (si.ssa2);
- if (src && gimple_bb (src) == gimple_bb (stmt))
- gori_calc_operands (si.op2_range, src, r, q);
+ if (!si.op2_range.varying_p ())
+ {
+ r.set_range (si.ssa2, si.op2_range);
+ gimple *src = SSA_NAME_DEF_STMT (si.ssa2);
+ if (src && gimple_bb (src) == gimple_bb (stmt))
+ gori_calc_operands (si.op2_range, src, r, q);
+ }
}
}