aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--simplify.c6
-rw-r--r--validation/optim/bool-sext-test.c1
2 files changed, 5 insertions, 2 deletions
diff --git a/simplify.c b/simplify.c
index fb63aa9b..db2fba7f 100644
--- a/simplify.c
+++ b/simplify.c
@@ -607,9 +607,13 @@ static int simplify_seteq_setne(struct instruction *insn, long long value)
remove_usage(old, &insn->src1);
return REPEAT_CSE;
+ case OP_SEXT:
+ if (value && (def->orig_type->bit_size == 1))
+ break;
+ /* Fall through */
case OP_ZEXT:
// Convert:
- // zext.m %s <- (1) %a
+ // *ext.m %s <- (1) %a
// setne.1 %r <- %s, $0
// into:
// setne.1 %s <- %a, $0
diff --git a/validation/optim/bool-sext-test.c b/validation/optim/bool-sext-test.c
index 0ca3dea9..bd85e06e 100644
--- a/validation/optim/bool-sext-test.c
+++ b/validation/optim/bool-sext-test.c
@@ -6,7 +6,6 @@ _Bool nes1( signed char a) { return a != 1; }
/*
* check-name: bool-sext-test
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-excludes: sext\\.