summaryrefslogtreecommitdiff
path: root/src/passes/OptimizeInstructions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/OptimizeInstructions.cpp')
-rw-r--r--src/passes/OptimizeInstructions.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp
index cc263d228..d18990e8e 100644
--- a/src/passes/OptimizeInstructions.cpp
+++ b/src/passes/OptimizeInstructions.cpp
@@ -3350,14 +3350,9 @@ private:
curr->ifTrue->type != Type::unreachable &&
curr->ifFalse->type != Type::unreachable) {
Unary* un;
- Expression* x;
Const* c;
auto check = [&](Expression* a, Expression* b) {
- if (matches(a, unary(&un, EqZ, any(&x))) && matches(b, ival(&c))) {
- auto value = c->value.getInteger();
- return value == 0 || value == 1;
- }
- return false;
+ return matches(b, bval(&c)) && matches(a, unary(&un, EqZ, any()));
};
if (check(curr->ifTrue, curr->ifFalse) ||
check(curr->ifFalse, curr->ifTrue)) {