aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--simplify.c4
-rw-r--r--validation/optim/and-or-constant1.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/simplify.c b/simplify.c
index 2ede16b8..a8f4d7fe 100644
--- a/simplify.c
+++ b/simplify.c
@@ -653,6 +653,10 @@ static int simplify_mask_or(struct instruction *insn, unsigned long long mask, s
// if (C & M) == 0: OR(x, C) -> x
return replace_pseudo(insn, &insn->src1, src1);
}
+ if (nval == mask) {
+ // if (C & M) == M: OR(x, C) -> M
+ return replace_pseudo(insn, &insn->src1, value_pseudo(mask));
+ }
}
return 0;
}
diff --git a/validation/optim/and-or-constant1.c b/validation/optim/and-or-constant1.c
index 3f1c9052..49823d5c 100644
--- a/validation/optim/and-or-constant1.c
+++ b/validation/optim/and-or-constant1.c
@@ -6,7 +6,6 @@ int foo(int x)
/*
* check-name: or-and-constant1
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-contains: ret\\..*\\$0xfff