From 95ddd057424b996a0a2a54f282c6c567246d8cc9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 28 Aug 2024 09:13:33 -0700 Subject: [NFC] Refactor LocalGraph's core getSets API (#6877) Before we just had a map that people would access with localGraph.getSetses[get], while now it is a call localGraph.getSets(get), which more nicely hides the internal implementation details. Also rename getSetses => getSetsMap. This will allow a later PR to optimize the internals of this API. This is performance-neutral as far as I can measure. (We do replace a direct read from a data structure with a call, but the call is in a header and should always get inlined.) --- src/wasm/wasm-stack-opts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/wasm/wasm-stack-opts.cpp') diff --git a/src/wasm/wasm-stack-opts.cpp b/src/wasm/wasm-stack-opts.cpp index cf4c094b5..5902b40a5 100644 --- a/src/wasm/wasm-stack-opts.cpp +++ b/src/wasm/wasm-stack-opts.cpp @@ -225,7 +225,7 @@ void StackIROptimizer::local2Stack() { if (set->index == get->index) { // This might be a proper set-get pair, where the set is // used by this get and nothing else, check that. - auto& sets = localGraph.getSetses[get]; + auto& sets = localGraph.getSets(get); if (sets.size() == 1 && *sets.begin() == set) { auto& setInfluences = localGraph.setInfluences[set]; // If this has the proper value of 1, also do the potentially- -- cgit v1.2.3