summaryrefslogtreecommitdiff
path: root/src/passes
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes')
-rw-r--r--src/passes/Heap2Local.cpp4
-rw-r--r--src/passes/LocalSubtyping.cpp2
-rw-r--r--src/passes/LoopInvariantCodeMotion.cpp2
-rw-r--r--src/passes/MergeLocals.cpp4
-rw-r--r--src/passes/OptimizeAddedConstants.cpp2
-rw-r--r--src/passes/Precompute.cpp2
-rw-r--r--src/passes/SSAify.cpp2
7 files changed, 9 insertions, 9 deletions
diff --git a/src/passes/Heap2Local.cpp b/src/passes/Heap2Local.cpp
index fccbc3321..7e2b02add 100644
--- a/src/passes/Heap2Local.cpp
+++ b/src/passes/Heap2Local.cpp
@@ -184,8 +184,8 @@ struct Heap2LocalOptimizer {
Heap2LocalOptimizer(Function* func,
Module* module,
const PassOptions& passOptions)
- : func(func), module(module), passOptions(passOptions), localGraph(func),
- parents(func->body), branchTargets(func->body) {
+ : func(func), module(module), passOptions(passOptions),
+ localGraph(func, module), parents(func->body), branchTargets(func->body) {
// We need to track what each set influences, to see where its value can
// flow to.
localGraph.computeSetInfluences();
diff --git a/src/passes/LocalSubtyping.cpp b/src/passes/LocalSubtyping.cpp
index 0d41434fc..eeaaaaefa 100644
--- a/src/passes/LocalSubtyping.cpp
+++ b/src/passes/LocalSubtyping.cpp
@@ -60,7 +60,7 @@ struct LocalSubtyping : public WalkerPass<PostWalker<LocalSubtyping>> {
//
// TODO: Optimize this, as LocalGraph computes more than we need, and on
// more locals than we need.
- LocalGraph localGraph(func);
+ LocalGraph localGraph(func, getModule());
// For each local index, compute all the the sets and gets.
std::vector<std::vector<LocalSet*>> setsForLocal(numLocals);
diff --git a/src/passes/LoopInvariantCodeMotion.cpp b/src/passes/LoopInvariantCodeMotion.cpp
index 1329c02a1..4239e39c3 100644
--- a/src/passes/LoopInvariantCodeMotion.cpp
+++ b/src/passes/LoopInvariantCodeMotion.cpp
@@ -49,7 +49,7 @@ struct LoopInvariantCodeMotion
void doWalkFunction(Function* func) {
// Compute all local dependencies first.
- LocalGraph localGraphInstance(func);
+ LocalGraph localGraphInstance(func, getModule());
localGraph = &localGraphInstance;
// Traverse the function.
super::doWalkFunction(func);
diff --git a/src/passes/MergeLocals.cpp b/src/passes/MergeLocals.cpp
index a7f765cb4..c43ec8534 100644
--- a/src/passes/MergeLocals.cpp
+++ b/src/passes/MergeLocals.cpp
@@ -107,7 +107,7 @@ struct MergeLocals
}
// compute all dependencies
auto* func = getFunction();
- LocalGraph preGraph(func);
+ LocalGraph preGraph(func, getModule());
preGraph.computeInfluences();
// optimize each copy
std::unordered_map<LocalSet*, LocalSet*> optimizedToCopy,
@@ -193,7 +193,7 @@ struct MergeLocals
// if one does not work, we need to undo all its siblings (don't extend
// the live range unless we are definitely removing a conflict, same
// logic as before).
- LocalGraph postGraph(func);
+ LocalGraph postGraph(func, getModule());
postGraph.computeSetInfluences();
for (auto& [copy, trivial] : optimizedToCopy) {
auto& trivialInfluences = preGraph.setInfluences[trivial];
diff --git a/src/passes/OptimizeAddedConstants.cpp b/src/passes/OptimizeAddedConstants.cpp
index 8b4793940..696aeaa1c 100644
--- a/src/passes/OptimizeAddedConstants.cpp
+++ b/src/passes/OptimizeAddedConstants.cpp
@@ -296,7 +296,7 @@ struct OptimizeAddedConstants
helperIndexes.clear();
propagatable.clear();
if (propagate) {
- localGraph = std::make_unique<LocalGraph>(func);
+ localGraph = std::make_unique<LocalGraph>(func, getModule());
localGraph->computeSetInfluences();
localGraph->computeSSAIndexes();
findPropagatable();
diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp
index 18139de3f..cddf8785f 100644
--- a/src/passes/Precompute.cpp
+++ b/src/passes/Precompute.cpp
@@ -370,7 +370,7 @@ private:
// compute other sets as locals (since some of the gets they read may be
// constant).
// compute all dependencies
- LocalGraph localGraph(func);
+ LocalGraph localGraph(func, getModule());
localGraph.computeInfluences();
// prepare the work list. we add things here that might change to a constant
// initially, that means everything
diff --git a/src/passes/SSAify.cpp b/src/passes/SSAify.cpp
index 3d9b8bda6..fb952933e 100644
--- a/src/passes/SSAify.cpp
+++ b/src/passes/SSAify.cpp
@@ -89,7 +89,7 @@ struct SSAify : public Pass {
void runOnFunction(Module* module_, Function* func_) override {
module = module_;
func = func_;
- LocalGraph graph(func);
+ LocalGraph graph(func, module);
graph.computeSetInfluences();
graph.computeSSAIndexes();
// create new local indexes, one for each set