summaryrefslogtreecommitdiffhomepage
path: root/ir/opt
diff options
context:
space:
mode:
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>2019-08-09 22:31:24 +0200
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>2019-08-09 22:33:07 +0200
commit7d3271b487626d5e24eb96990c0cd392fac94dbe (patch)
tree73da0512d61cdc76e8580b470f0fb9a879bbba98 /ir/opt
parent61632845739b34924e8b9e128162899c252df7e6 (diff)
Extend a + b == a + c → b == c to reference modesriscv
Diffstat (limited to 'ir/opt')
-rw-r--r--ir/opt/iropt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ir/opt/iropt.c b/ir/opt/iropt.c
index 3b28860..80938f0 100644
--- a/ir/opt/iropt.c
+++ b/ir/opt/iropt.c
@@ -5081,7 +5081,7 @@ restart:
ir_relation rel_eq = get_complementary_relations(ir_relation_equal, relation, possible);
/* The following operations are NOT safe for floating point operations, for instance
* 1.0 + inf == 2.0 + inf, =/=> x == y */
- if (rel_eq != ir_relation_false && mode_is_int(mode)) {
+ if (rel_eq != ir_relation_false && (mode_is_int(mode) || mode_is_reference(mode))) {
unsigned const lop = get_irn_opcode(left);
if (lop == get_irn_opcode(right)) {
/* same operation on both sides, try to remove */
@@ -5169,6 +5169,7 @@ restart:
}
if (x) {
cmp_x_eq_0:
+ mode = get_irn_mode(x);
left = x;
right = new_r_Const_null(irg, mode);
relation = rel_eq;