diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-12-04 12:33:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 12:33:36 -0800 |
commit | 26ef829628b1dd0d4b36a173e3db53a8b148f8b0 (patch) | |
tree | 0b3ebca72a668378a83b3384ab04095addb2686c /src | |
parent | b650f20121d7e1e79c12e6abfaf317f0d00e5f3b (diff) | |
download | binaryen-26ef829628b1dd0d4b36a173e3db53a8b148f8b0.tar.gz binaryen-26ef829628b1dd0d4b36a173e3db53a8b148f8b0.tar.bz2 binaryen-26ef829628b1dd0d4b36a173e3db53a8b148f8b0.zip |
remove unnecessary constraint on remove-unused-br optimization of if-br-* into br_if,* - we can handle a concretely typed if as well, which can happen at the end of a block (#1799)
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/RemoveUnusedBrs.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/passes/RemoveUnusedBrs.cpp b/src/passes/RemoveUnusedBrs.cpp index 361e57ad6..cb3ff69ee 100644 --- a/src/passes/RemoveUnusedBrs.cpp +++ b/src/passes/RemoveUnusedBrs.cpp @@ -633,7 +633,7 @@ struct RemoveUnusedBrs : public WalkerPass<PostWalker<RemoveUnusedBrs>> { auto& list = curr->list; for (Index i = 0; i < list.size(); i++) { auto* iff = list[i]->dynCast<If>(); - if (!iff || !iff->ifFalse || isConcreteType(iff->type)) continue; // if it lacked an if-false, it would already be a br_if, as that's the easy case + if (!iff || !iff->ifFalse) continue; // if it lacked an if-false, it would already be a br_if, as that's the easy case auto* ifTrueBreak = iff->ifTrue->dynCast<Break>(); if (ifTrueBreak && !ifTrueBreak->condition && canTurnIfIntoBrIf(iff->condition, ifTrueBreak->value, passOptions)) { // we are an if-else where the ifTrue is a break without a condition, so we can do this |