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.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/passes/SimplifyLocals.cpp b/src/passes/SimplifyLocals.cpp
index 6b76faed3..a3fa4a34d 100644
--- a/src/passes/SimplifyLocals.cpp
+++ b/src/passes/SimplifyLocals.cpp
@@ -256,7 +256,7 @@ struct SimplifyLocals
} else {
this->replaceCurrent(set);
assert(!set->isTee());
- set->setTee(true);
+ set->makeTee(this->getFunction()->getLocalType(set->index));
}
// reuse the local.get that is dying
*found->second.item = curr;
@@ -271,7 +271,7 @@ struct SimplifyLocals
auto* set = curr->value->dynCast<LocalSet>();
if (set) {
assert(set->isTee());
- set->setTee(false);
+ set->makeSet();
this->replaceCurrent(set);
}
}
@@ -559,7 +559,7 @@ struct SimplifyLocals
auto* set = (*breakLocalSetPointer)->template cast<LocalSet>();
if (br->condition) {
br->value = set;
- set->setTee(true);
+ set->makeTee(this->getFunction()->getLocalType(set->index));
*breakLocalSetPointer =
this->getModule()->allocator.template alloc<Nop>();
// in addition, as this is a conditional br that now has a value, it now
@@ -728,7 +728,8 @@ struct SimplifyLocals
ifTrueBlock->finalize();
assert(ifTrueBlock->type != none);
// Update the ifFalse side.
- iff->ifFalse = builder.makeLocalGet(set->index, set->value->type);
+ iff->ifFalse = builder.makeLocalGet(
+ set->index, this->getFunction()->getLocalType(set->index));
iff->finalize(); // update type
// Update the get count.
getCounter.num[set->index]++;