summaryrefslogtreecommitdiff
path: root/src/passes/Precompute.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Precompute.cpp')
-rw-r--r--src/passes/Precompute.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index d5cfdc968..2e8c8fe31 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -41,7 +41,7 @@ namespace wasm {
static const Name NOTPRECOMPUTABLE_FLOW("Binaryen|notprecomputable");
-typedef std::unordered_map<GetLocal*, Literal> GetValues;
+typedef std::unordered_map<LocalGet*, Literal> GetValues;
// Precomputes an expression. Errors if we hit anything that can't be
// precomputed.
@@ -80,7 +80,7 @@ public:
Flow visitCallIndirect(CallIndirect* curr) {
return Flow(NOTPRECOMPUTABLE_FLOW);
}
- Flow visitGetLocal(GetLocal* curr) {
+ Flow visitLocalGet(LocalGet* curr) {
auto iter = getValues.find(curr);
if (iter != getValues.end()) {
auto value = iter->second;
@@ -90,7 +90,7 @@ public:
}
return Flow(NOTPRECOMPUTABLE_FLOW);
}
- Flow visitSetLocal(SetLocal* curr) {
+ Flow visitLocalSet(LocalSet* curr) {
// If we don't need to replace the whole expression, see if there
// is a value flowing through a tee.
if (!replaceExpression) {
@@ -101,14 +101,14 @@ public:
}
return Flow(NOTPRECOMPUTABLE_FLOW);
}
- Flow visitGetGlobal(GetGlobal* curr) {
+ Flow visitGlobalGet(GlobalGet* curr) {
auto* global = module->getGlobal(curr->name);
if (!global->imported() && !global->mutable_) {
return visit(global->init);
}
return Flow(NOTPRECOMPUTABLE_FLOW);
}
- Flow visitSetGlobal(SetGlobal* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); }
+ Flow visitGlobalSet(GlobalSet* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); }
Flow visitLoad(Load* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); }
Flow visitStore(Store* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); }
Flow visitAtomicRMW(AtomicRMW* curr) { return Flow(NOTPRECOMPUTABLE_FLOW); }
@@ -296,7 +296,7 @@ private:
work.insert(curr);
}
// the constant value, or none if not a constant
- std::unordered_map<SetLocal*, Literal> setValues;
+ std::unordered_map<LocalSet*, Literal> setValues;
// propagate constant values
while (!work.empty()) {
auto iter = work.begin();
@@ -305,7 +305,7 @@ private:
// see if this set or get is actually a constant value, and if so,
// mark it as such and add everything it influences to the work list,
// as they may be constant too.
- if (auto* set = curr->dynCast<SetLocal>()) {
+ if (auto* set = curr->dynCast<LocalSet>()) {
if (setValues[set].isConcrete()) {
continue; // already known constant
}
@@ -317,7 +317,7 @@ private:
}
}
} else {
- auto* get = curr->cast<GetLocal>();
+ auto* get = curr->cast<LocalGet>();
if (getValues[get].isConcrete()) {
continue; // already known constant
}