diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/CoalesceLocals.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/passes/CoalesceLocals.cpp b/src/passes/CoalesceLocals.cpp index 87eefb85c..5ab68da23 100644 --- a/src/passes/CoalesceLocals.cpp +++ b/src/passes/CoalesceLocals.cpp @@ -597,11 +597,13 @@ void CoalesceLocals::pickIndices(std::vector<Index>& indices) { // Remove a copy from a set of an if, where one if arm is a get of the same set static void removeIfCopy(Expression** origin, SetLocal* set, If* iff, Expression*& copy, Expression*& other, Module* module) { // replace the origin with the if, and sink the set into the other non-copying arm + bool tee = set->isTee(); *origin = iff; set->value = other; set->finalize(); other = set; - if (!isConcreteWasmType(set->type)) { + // if this is not a tee, then we can get rid of the copy in that arm + if (!tee) { // we don't need the copy at all copy = nullptr; if (!iff->ifTrue) { |