diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-05 12:25:44 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-05 12:25:44 -0700 |
commit | f81355b2750717584e309699dfcae3c814167578 (patch) | |
tree | ecd909a66689b7023ec344ffa028a8ce2e2aad41 /src/passes/SimplifyLocals.cpp | |
parent | e6f6d700054ce30e9455697a39328f5366543096 (diff) | |
download | binaryen-f81355b2750717584e309699dfcae3c814167578.tar.gz binaryen-f81355b2750717584e309699dfcae3c814167578.tar.bz2 binaryen-f81355b2750717584e309699dfcae3c814167578.zip |
clear sinkables on unoptimizable blocks, as they have a control flow merge
Diffstat (limited to 'src/passes/SimplifyLocals.cpp')
-rw-r--r-- | src/passes/SimplifyLocals.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp index dfefd515d..fbd1e7e57 100644 --- a/src/passes/SimplifyLocals.cpp +++ b/src/passes/SimplifyLocals.cpp @@ -162,12 +162,16 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals, // post-block cleanups if (curr->name.is()) { - unoptimizableBlocks.erase(curr->name); - } - if (hasBreaks) { - // more than one path to here, so nonlinear - sinkables.clear(); - blockBreaks.erase(curr->name); + if (unoptimizableBlocks.count(curr->name)) { + sinkables.clear(); + unoptimizableBlocks.erase(curr->name); + } + + if (hasBreaks) { + // more than one path to here, so nonlinear + sinkables.clear(); + blockBreaks.erase(curr->name); + } } } |