diff options
author | Alon Zakai <azakai@google.com> | 2024-09-04 14:47:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 14:47:19 -0700 |
commit | 0812ad3564ab802db5c2df7f0fe9fdb22709a535 (patch) | |
tree | 6ad2dabc342652f2fcc48bb7bc92ffba211ed021 /src/passes/MergeLocals.cpp | |
parent | 9671b985aca3ce8ee18e7886229ba03c02e73fac (diff) | |
download | binaryen-0812ad3564ab802db5c2df7f0fe9fdb22709a535.tar.gz binaryen-0812ad3564ab802db5c2df7f0fe9fdb22709a535.tar.bz2 binaryen-0812ad3564ab802db5c2df7f0fe9fdb22709a535.zip |
[NFC] Convert LocalGraph influences accesses to function calls (#6899)
This replaces direct access of the data structure graph.*influences[foo] with a call
graph.get*influences(foo). This will allow a later PR to make those calls optionally
lazy.
Diffstat (limited to 'src/passes/MergeLocals.cpp')
-rw-r--r-- | src/passes/MergeLocals.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/passes/MergeLocals.cpp b/src/passes/MergeLocals.cpp index b04215d73..e6cf71538 100644 --- a/src/passes/MergeLocals.cpp +++ b/src/passes/MergeLocals.cpp @@ -115,7 +115,7 @@ struct MergeLocals for (auto* copy : copies) { auto* trivial = copy->value->cast<LocalSet>(); bool canOptimizeToCopy = false; - auto& trivialInfluences = preGraph.setInfluences[trivial]; + auto& trivialInfluences = preGraph.getSetInfluences(trivial); if (!trivialInfluences.empty()) { canOptimizeToCopy = true; for (auto* influencedGet : trivialInfluences) { @@ -156,7 +156,7 @@ struct MergeLocals // if the trivial set we added has influences, it means $y lives on if (!trivialInfluences.empty()) { - auto& copyInfluences = preGraph.setInfluences[copy]; + auto& copyInfluences = preGraph.getSetInfluences(copy); if (!copyInfluences.empty()) { bool canOptimizeToTrivial = true; for (auto* influencedGet : copyInfluences) { @@ -198,7 +198,7 @@ struct MergeLocals LocalGraph postGraph(func, getModule()); postGraph.computeSetInfluences(); for (auto& [copy, trivial] : optimizedToCopy) { - auto& trivialInfluences = preGraph.setInfluences[trivial]; + auto& trivialInfluences = preGraph.getSetInfluences(trivial); for (auto* influencedGet : trivialInfluences) { // verify the set auto& sets = postGraph.getSets(influencedGet); @@ -212,7 +212,7 @@ struct MergeLocals } } for (auto& [copy, trivial] : optimizedToTrivial) { - auto& copyInfluences = preGraph.setInfluences[copy]; + auto& copyInfluences = preGraph.getSetInfluences(copy); for (auto* influencedGet : copyInfluences) { // verify the set auto& sets = postGraph.getSets(influencedGet); |