diff options
author | Alon Zakai <azakai@google.com> | 2022-11-30 12:08:59 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-30 12:08:59 -0800 |
commit | 4f6cb8e54aa073f15f7ce622ea25905283683d5f (patch) | |
tree | 2c5510724a69c8cb6eecce4f2b4a583189f5ec5c /src | |
parent | 757c4689f5d75d4f29de442ae1db10dc143954f6 (diff) | |
download | binaryen-4f6cb8e54aa073f15f7ce622ea25905283683d5f.tar.gz binaryen-4f6cb8e54aa073f15f7ce622ea25905283683d5f.tar.bz2 binaryen-4f6cb8e54aa073f15f7ce622ea25905283683d5f.zip |
[NFC] Avoid unneeded work in GTO (#5304)
As noticed in #5303, the test changes here are because we did unnecessary work
which created a new rec group, which then led to a rec group being printed out.
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/GlobalTypeOptimization.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/passes/GlobalTypeOptimization.cpp b/src/passes/GlobalTypeOptimization.cpp index 4f7ce7ac7..9015f3ab5 100644 --- a/src/passes/GlobalTypeOptimization.cpp +++ b/src/passes/GlobalTypeOptimization.cpp @@ -243,7 +243,9 @@ struct GlobalTypeOptimization : public Pass { } // Update the types in the entire module. - updateTypes(*module); + if (!indexesAfterRemovals.empty() || !canBecomeImmutable.empty()) { + updateTypes(*module); + } } void updateTypes(Module& wasm) { |