summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/passes/GlobalTypeOptimization.cpp4
-rw-r--r--test/lit/passes/Oz.wast9
-rw-r--r--test/passes/Oz_fuzz-exec_all-features.txt5
-rw-r--r--test/reduce/imports.wast.txt5
-rw-r--r--test/reduce/memory_table.wast.txt6
-rw-r--r--test/reduce/simple.wast.txt5
6 files changed, 12 insertions, 22 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) {
diff --git a/test/lit/passes/Oz.wast b/test/lit/passes/Oz.wast
index 07385a4a4..56b27c047 100644
--- a/test/lit/passes/Oz.wast
+++ b/test/lit/passes/Oz.wast
@@ -5,14 +5,13 @@
(module
(memory 100 100)
- ;; CHECK: (rec
- ;; CHECK-NEXT: (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
+ ;; CHECK: (type $i32_i32_=>_i32 (func (param i32 i32) (result i32)))
- ;; CHECK: (type $i32_=>_i32 (func (param i32) (result i32)))
+ ;; CHECK: (type $i32_=>_i32 (func (param i32) (result i32)))
- ;; CHECK: (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32)))
+ ;; CHECK: (type $i32_i32_i32_i32_=>_i32 (func (param i32 i32 i32 i32) (result i32)))
- ;; CHECK: (type $none_=>_v128 (func (result v128)))
+ ;; CHECK: (type $none_=>_v128 (func (result v128)))
;; CHECK: (memory $0 100 100)
diff --git a/test/passes/Oz_fuzz-exec_all-features.txt b/test/passes/Oz_fuzz-exec_all-features.txt
index ba7d11406..aa8d3d6c9 100644
--- a/test/passes/Oz_fuzz-exec_all-features.txt
+++ b/test/passes/Oz_fuzz-exec_all-features.txt
@@ -454,10 +454,7 @@ ignoring comparison of ExecutionResults!
[fuzz-exec] calling foo
[host limit allocation failure]
(module
- (rec
- (type $none_=>_i32 (func (result i32)))
- (type $[mut:i8] (array (mut i8)))
- )
+ (type $none_=>_i32 (func (result i32)))
(export "foo" (func $0))
(func $0 (type $none_=>_i32) (; has Stack IR ;) (result i32)
(i32.const 0)
diff --git a/test/reduce/imports.wast.txt b/test/reduce/imports.wast.txt
index 143240b49..1c2a8c63f 100644
--- a/test/reduce/imports.wast.txt
+++ b/test/reduce/imports.wast.txt
@@ -1,8 +1,5 @@
(module
- (rec
- (type $none_=>_none (func))
- (type $none_=>_i32 (func (result i32)))
- )
+ (type $none_=>_i32 (func (result i32)))
(export "x" (func $0))
(func $0 (result i32)
(i32.const 5678)
diff --git a/test/reduce/memory_table.wast.txt b/test/reduce/memory_table.wast.txt
index 9da5e8739..fe9e82072 100644
--- a/test/reduce/memory_table.wast.txt
+++ b/test/reduce/memory_table.wast.txt
@@ -1,8 +1,6 @@
(module
- (rec
- (type $none_=>_i32 (func (result i32)))
- (type $none_=>_none (func))
- )
+ (type $none_=>_i32 (func (result i32)))
+ (type $none_=>_none (func))
(memory $0 256 256)
(export "f1" (func $0))
(export "f2" (func $1))
diff --git a/test/reduce/simple.wast.txt b/test/reduce/simple.wast.txt
index e621ce52a..1c2a8c63f 100644
--- a/test/reduce/simple.wast.txt
+++ b/test/reduce/simple.wast.txt
@@ -1,8 +1,5 @@
(module
- (rec
- (type $none_=>_i32 (func (result i32)))
- (type $none_=>_none (func))
- )
+ (type $none_=>_i32 (func (result i32)))
(export "x" (func $0))
(func $0 (result i32)
(i32.const 5678)