File tree 1 file changed +11
-12
lines changed
1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -2924,18 +2924,17 @@ struct OptimizeInstructions
2924
2924
return binary;
2925
2925
}
2926
2926
}
2927
- } else if (binary->op == LtUInt32) {
2928
- auto value = Properties::getFallthrough (
2929
- binary->right , getPassOptions (), *getModule ());
2930
- if (Properties::isConstantExpression (value)) {
2931
- if (Properties::getLiteral (value).isZero ()) {
2932
- // Hoist potential zero to be good for constant propagation
2933
- // in case of being blocked by side effect.
2934
- // (unsigned)x < 0 ==> i32(0)
2935
- Builder builder (*getModule ());
2936
- return getDroppedChildrenAndAppend (
2937
- binary, LiteralUtils::makeZero (Type::i32, *getModule ()));
2938
- }
2927
+ }
2928
+ if (auto * block = binary->right ->dynCast <Block>()) {
2929
+ auto fallthrough =
2930
+ Properties::getFallthrough (block, getPassOptions (), *getModule ());
2931
+ if (auto * c = fallthrough->dynCast <Const>()) {
2932
+ Builder builder (*getModule ());
2933
+ auto ret = getDroppedChildrenAndAppend (
2934
+ binary,
2935
+ LiteralUtils::makeFromInt32 (
2936
+ c->value .geti32 (), Type::i32, *getModule ()));
2937
+ return ret;
2939
2938
}
2940
2939
}
2941
2940
if (auto * ext = Properties::getSignExtValue (binary)) {
You can’t perform that action at this time.
0 commit comments