aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--simplify.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/simplify.c b/simplify.c
index a5bed73f..0ccd7c9f 100644
--- a/simplify.c
+++ b/simplify.c
@@ -599,12 +599,11 @@ static int simplify_mask_or_and(struct instruction *insn, unsigned long long mas
return 0;
omask = src2->value;
nmask = omask & mask;
- if (nmask != 0)
- return 0;
- // replace OP(((x & M') | b), K)
- // by OP(b, K)
- // when (M' & M) == 0
- return replace_pseudo(insn, &insn->src1, orb);
+ if (nmask == 0) {
+ // if (M' & M) == 0: ((a & M') | b) -> b
+ return replace_pseudo(insn, &insn->src1, orb);
+ }
+ return 0;
}
///