diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-08-02 10:58:37 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-08-03 14:19:54 -0400 |
commit | 33f080a7f1d70440d02de70af8f08eca21714abb (patch) | |
tree | 67eb408c3fee6b61b7c4068aef9310d6550ea1fb /gcc/gimple-range-gori.cc | |
parent | c47ceea55118d00d4bf68eaae6f9ac7707c1b9fc (diff) | |
download | gcc-33f080a7f1d70440d02de70af8f08eca21714abb.zip gcc-33f080a7f1d70440d02de70af8f08eca21714abb.tar.gz gcc-33f080a7f1d70440d02de70af8f08eca21714abb.tar.bz2 |
Provide a routine for NAME == NAME relation.
We've been assuming x == x s VREL_EQ in GORI, but this is not always going to
be true with floating point. Provide an API to return the relation.
* gimple-range-gori.cc (gori_compute::compute_operand1_range):
Use identity relation.
(gori_compute::compute_operand2_range): Ditto.
* value-relation.cc (get_identity_relation): New.
* value-relation.h (get_identity_relation): New prototype.
Diffstat (limited to 'gcc/gimple-range-gori.cc')
-rw-r--r-- | gcc/gimple-range-gori.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index 6dc15a0..c37e54b 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -1142,7 +1142,10 @@ gori_compute::compute_operand1_range (vrange &r, // If op1 == op2, create a new trio for just this call. if (op1 == op2 && gimple_range_ssa_p (op1)) - trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), VREL_EQ); + { + relation_kind k = get_identity_relation (op1, op1_range); + trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), k); + } if (!handler.calc_op1 (r, lhs, op2_range, trio)) return false; } @@ -1218,7 +1221,10 @@ gori_compute::compute_operand2_range (vrange &r, // If op1 == op2, create a new trio for this stmt. if (op1 == op2 && gimple_range_ssa_p (op1)) - trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), VREL_EQ); + { + relation_kind k = get_identity_relation (op1, op1_range); + trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), k); + } // Intersect with range for op2 based on lhs and op1. if (!handler.calc_op2 (r, lhs, op1_range, trio)) return false; |