summaryrefslogtreecommitdiff
path: root/src/passes/SimplifyLocals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/SimplifyLocals.cpp')
-rw-r--r--src/passes/SimplifyLocals.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp
index a4a36c895..f0c786b1c 100644
--- a/src/passes/SimplifyLocals.cpp
+++ b/src/passes/SimplifyLocals.cpp
@@ -75,10 +75,11 @@ struct SimplifyLocals : public WalkerPass<LinearExecutionWalker<SimplifyLocals,
}
void visitSetLocal(SetLocal *curr) {
- // if we are a potentially-sinkable thing, forget it - this
- // write overrides the last TODO: optimizable
+ // if we are a potentially-sinkable thing, then the previous
+ // store is dead, leave just the value
auto found = sinkables.find(curr->index);
if (found != sinkables.end()) {
+ *found->second.item = (*found->second.item)->cast<SetLocal>()->value;
sinkables.erase(found);
}
}