From 4f6cb8e54aa073f15f7ce622ea25905283683d5f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 30 Nov 2022 12:08:59 -0800 Subject: [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. --- src/passes/GlobalTypeOptimization.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3