diff options
Diffstat (limited to 'src/passes/SimplifyLocals.cpp')
-rw-r--r-- | src/passes/SimplifyLocals.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp index 02be1ceec..77b8f1a93 100644 --- a/src/passes/SimplifyLocals.cpp +++ b/src/passes/SimplifyLocals.cpp @@ -140,9 +140,11 @@ struct SimplifyLocals } else if (curr->is<If>()) { assert(!curr->cast<If>() ->ifFalse); // if-elses are handled by doNoteIf* methods - } else if (curr->is<Switch>()) { - auto* sw = curr->cast<Switch>(); - auto targets = BranchUtils::getUniqueTargets(sw); + } else { + // Not one of the recognized instructions, so do not optimize here: mark + // all the targets as unoptimizable. + // TODO optimize BrOn, Switch, etc. + auto targets = BranchUtils::getUniqueTargets(curr); for (auto target : targets) { self->unoptimizableBlocks.insert(target); } |