aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/simplify.c
diff options
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index a8f4d7fe..8b56df4b 100644
--- a/simplify.c
+++ b/simplify.c
@@ -657,6 +657,10 @@ static int simplify_mask_or(struct instruction *insn, unsigned long long mask, s
// if (C & M) == M: OR(x, C) -> M
return replace_pseudo(insn, &insn->src1, value_pseudo(mask));
}
+ if (nval != oval && !multi_users(or->target)) {
+ // if (C & M) != C: OR(x, C) -> OR(x, (C & M))
+ return replace_pseudo(or, &or->src2, value_pseudo(nval));
+ }
}
return 0;
}