diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-05-17 08:00:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-17 08:00:59 -0700 |
commit | cb64ec3879db3422ac4afd3119938f8dfe7b7b05 (patch) | |
tree | 33c3f05b15813c4f836461e4603e2e5d8f508f2d /src | |
parent | 3c5a2de669542caebd7ef001db6678b70375f0b5 (diff) | |
download | binaryen-cb64ec3879db3422ac4afd3119938f8dfe7b7b05.tar.gz binaryen-cb64ec3879db3422ac4afd3119938f8dfe7b7b05.tar.bz2 binaryen-cb64ec3879db3422ac4afd3119938f8dfe7b7b05.zip |
Fix optimizing equivalent locals bug introduced in #1540 (#1556)
Don't skip through flowing tee values, just drop the current outermost which we find is redundant. the child tees may still be necessary.
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/SimplifyLocals.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp index 27d868da1..d941ce0d4 100644 --- a/src/passes/SimplifyLocals.cpp +++ b/src/passes/SimplifyLocals.cpp @@ -685,11 +685,9 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals<a // This is an unnecessary copy! if (removeEquivalentSets) { if (curr->isTee()) { - this->replaceCurrent(value); - } else if (curr->value->is<GetLocal>()) { - ExpressionManipulator::nop(curr); + this->replaceCurrent(curr->value); } else { - this->replaceCurrent(Builder(*module).makeDrop(value)); + this->replaceCurrent(Builder(*module).makeDrop(curr->value)); } anotherCycle = true; } |