summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ir/names.h64
-rw-r--r--test/ctor-eval/gc-2.wast.out6
-rw-r--r--test/ctor-eval/gc.wast.out12
-rw-r--r--test/ctor-eval/partial-locals-tee.wast.out4
-rw-r--r--test/ctor-eval/partial-locals.wast.out4
-rw-r--r--test/ctor-eval/partial.wast.out4
-rw-r--r--test/ctor-eval/results.wast.out12
-rw-r--r--test/example/module-splitting.txt4
-rw-r--r--test/lit/ctor-eval/ctor_after_serialization.wat20
-rw-r--r--test/lit/ctor-eval/extern.wast16
-rw-r--r--test/lit/ctor-eval/multivalue-local.wast4
-rw-r--r--test/lit/ctor-eval/table.wat4
-rw-r--r--test/lit/ctor-eval/v128.wast4
-rw-r--r--test/lit/passes/denan.wast12
-rw-r--r--test/lit/passes/inlining_splitting.wast24
-rw-r--r--test/lit/passes/jspi.wast4
-rw-r--r--test/lit/passes/memory-packing_all-features.wast62
-rw-r--r--test/lit/passes/monomorphize.wast34
-rw-r--r--test/lit/passes/poppify-globals.wast8
-rw-r--r--test/lit/wat-kitchen-sink.wast42
-rw-r--r--test/passes/stack-check_enable-mutable-globals.txt8
21 files changed, 189 insertions, 163 deletions
diff --git a/src/ir/names.h b/src/ir/names.h
index 0cc47d46e..e2a168940 100644
--- a/src/ir/names.h
+++ b/src/ir/names.h
@@ -44,12 +44,18 @@ inline void ensureNames(Function* func) {
// Given a root of a name, finds a valid name with perhaps a number appended
// to it, by calling a function to check if a name is valid.
-inline Name getValidName(Name root, std::function<bool(Name)> check) {
+//
+// An optional index can be given as a hint, and if so, the search for a valid
+// name will begin there. This can be used to avoid trying the same 0,1,2,..
+// etc. names each time (which could lead to quadratic behavior in certain
+// cases).
+inline Name
+getValidName(Name root, std::function<bool(Name)> check, Index hint = 0) {
if (check(root)) {
return root;
}
auto prefixed = std::string(root.str) + '_';
- Index num = 0;
+ Index num = hint;
while (1) {
auto name = prefixed + std::to_string(num);
if (check(name)) {
@@ -60,46 +66,66 @@ inline Name getValidName(Name root, std::function<bool(Name)> check) {
}
inline Name getValidExportName(Module& module, Name root) {
- return getValidName(root,
- [&](Name test) { return !module.getExportOrNull(test); });
+ return getValidName(
+ root,
+ [&](Name test) { return !module.getExportOrNull(test); },
+ module.exports.size());
}
inline Name getValidGlobalName(Module& module, Name root) {
- return getValidName(root,
- [&](Name test) { return !module.getGlobalOrNull(test); });
+ return getValidName(
+ root,
+ [&](Name test) { return !module.getGlobalOrNull(test); },
+ module.globals.size());
}
inline Name getValidFunctionName(Module& module, Name root) {
return getValidName(
- root, [&](Name test) { return !module.getFunctionOrNull(test); });
+ root,
+ [&](Name test) { return !module.getFunctionOrNull(test); },
+ module.functions.size());
}
inline Name getValidTableName(Module& module, Name root) {
- return getValidName(root,
- [&](Name test) { return !module.getTableOrNull(test); });
+ return getValidName(
+ root,
+ [&](Name test) { return !module.getTableOrNull(test); },
+ module.tables.size());
}
inline Name getValidTagName(Module& module, Name root) {
- return getValidName(root,
- [&](Name test) { return !module.getTagOrNull(test); });
+ return getValidName(
+ root,
+ [&](Name test) { return !module.getTagOrNull(test); },
+ module.tags.size());
}
inline Name getValidElementSegmentName(Module& module, Name root) {
return getValidName(
- root, [&](Name test) { return !module.getElementSegmentOrNull(test); });
+ root,
+ [&](Name test) { return !module.getElementSegmentOrNull(test); },
+ module.elementSegments.size());
}
inline Name getValidDataSegmentName(Module& module, Name root) {
return getValidName(
- root, [&](Name test) { return !module.getDataSegmentOrNull(test); });
+ root,
+ [&](Name test) { return !module.getDataSegmentOrNull(test); },
+ module.dataSegments.size());
}
inline Name getValidMemoryName(Module& module, Name root) {
- return getValidName(root,
- [&](Name test) { return !module.getMemoryOrNull(test); });
+ return getValidName(
+ root,
+ [&](Name test) { return !module.getMemoryOrNull(test); },
+ module.memories.size());
}
inline Name getValidLocalName(Function& func, Name root) {
- return getValidName(root,
- [&](Name test) { return !func.hasLocalIndex(test); });
+ return getValidName(
+ root,
+ [&](Name test) { return !func.hasLocalIndex(test); },
+ func.getNumLocals());
}
template<typename T>
inline Name getValidNameGivenExisting(Name root, const T& existingNames) {
- return getValidName(root,
- [&](Name test) { return !existingNames.count(test); });
+ return getValidName(
+ root,
+ [&](Name test) { return !existingNames.count(test); },
+ existingNames.size());
}
class MinifiedNameGenerator {
diff --git a/test/ctor-eval/gc-2.wast.out b/test/ctor-eval/gc-2.wast.out
index 6675d9929..5d91ca7d3 100644
--- a/test/ctor-eval/gc-2.wast.out
+++ b/test/ctor-eval/gc-2.wast.out
@@ -5,11 +5,11 @@
(i32.const 1337)
))
(global $global1 (ref any) (global.get $ctor-eval$global))
- (global $ctor-eval$global_0 (ref $struct) (struct.new $struct
+ (global $ctor-eval$global_4 (ref $struct) (struct.new $struct
(i32.const 9999)
))
- (global $global2 (mut (ref null $struct)) (global.get $ctor-eval$global_0))
- (global $global3 (ref $struct) (global.get $ctor-eval$global_0))
+ (global $global2 (mut (ref null $struct)) (global.get $ctor-eval$global_4))
+ (global $global3 (ref $struct) (global.get $ctor-eval$global_4))
(export "keepalive" (func $1))
(func $1 (type $none_=>_i32) (result i32)
(select
diff --git a/test/ctor-eval/gc.wast.out b/test/ctor-eval/gc.wast.out
index 4a30752e0..2995f84ba 100644
--- a/test/ctor-eval/gc.wast.out
+++ b/test/ctor-eval/gc.wast.out
@@ -7,14 +7,14 @@
(global $global1 (ref $struct) (struct.new $struct
(i32.const 1337)
))
- (global $ctor-eval$global_1 (ref $struct) (struct.new $struct
+ (global $ctor-eval$global_4 (ref $struct) (struct.new $struct
(i32.const 42)
))
- (global $global2 (mut (ref null $struct)) (global.get $ctor-eval$global_1))
- (global $ctor-eval$global_2 (ref $struct) (struct.new $struct
+ (global $global2 (mut (ref null $struct)) (global.get $ctor-eval$global_4))
+ (global $ctor-eval$global_5 (ref $struct) (struct.new $struct
(i32.const 99)
))
- (export "test1" (func $0_0))
+ (export "test1" (func $0_3))
(export "keepalive" (func $1))
(func $1 (type $none_=>_i32) (result i32)
(i32.add
@@ -26,10 +26,10 @@
)
)
)
- (func $0_0 (type $none_=>_none)
+ (func $0_3 (type $none_=>_none)
(local $0 (ref $struct))
(local.set $0
- (global.get $ctor-eval$global_2)
+ (global.get $ctor-eval$global_5)
)
(call $import
(ref.null none)
diff --git a/test/ctor-eval/partial-locals-tee.wast.out b/test/ctor-eval/partial-locals-tee.wast.out
index a690c704a..97c107164 100644
--- a/test/ctor-eval/partial-locals-tee.wast.out
+++ b/test/ctor-eval/partial-locals-tee.wast.out
@@ -4,8 +4,8 @@
(import "import" "import" (func $import (param i32 i32)))
(memory $0 256 256)
(data $0 (i32.const 10) "__s______________")
- (export "test1" (func $test1_0))
- (func $test1_0 (type $none_=>_none)
+ (export "test1" (func $test1_2))
+ (func $test1_2 (type $none_=>_none)
(call $import
(i32.const 1)
(i32.const 50)
diff --git a/test/ctor-eval/partial-locals.wast.out b/test/ctor-eval/partial-locals.wast.out
index 4222bceaa..530caddd9 100644
--- a/test/ctor-eval/partial-locals.wast.out
+++ b/test/ctor-eval/partial-locals.wast.out
@@ -4,8 +4,8 @@
(global $sp (mut i32) (i32.const 104))
(memory $0 256 256)
(data $0 (i32.const 10) "__s______________")
- (export "test1" (func $test1_0))
- (func $test1_0 (type $none_=>_none)
+ (export "test1" (func $test1_2))
+ (func $test1_2 (type $none_=>_none)
(local $0 i32)
(local.set $0
(i32.const 100)
diff --git a/test/ctor-eval/partial.wast.out b/test/ctor-eval/partial.wast.out
index f35fdb499..b191128a2 100644
--- a/test/ctor-eval/partial.wast.out
+++ b/test/ctor-eval/partial.wast.out
@@ -3,7 +3,7 @@
(import "import" "import" (func $import))
(memory $0 256 256)
(data $0 (i32.const 10) "__s______________")
- (export "test1" (func $test1_0))
+ (export "test1" (func $test1_2))
(export "keepalive" (func $test1))
(func $test1 (type $none_=>_none)
(i32.store8
@@ -16,7 +16,7 @@
(i32.const 114)
)
)
- (func $test1_0 (type $none_=>_none)
+ (func $test1_2 (type $none_=>_none)
(call $import)
(i32.store8
(i32.const 13)
diff --git a/test/ctor-eval/results.wast.out b/test/ctor-eval/results.wast.out
index 0194cabb6..4259369b5 100644
--- a/test/ctor-eval/results.wast.out
+++ b/test/ctor-eval/results.wast.out
@@ -7,9 +7,9 @@
(global $global3 (mut i32) (i32.const 13))
(global $global4 (mut i32) (i32.const 14))
(global $global5 (mut i32) (i32.const 15))
- (export "test1" (func $test1_0))
- (export "test3" (func $test3_0))
- (export "test5" (func $test5_0))
+ (export "test1" (func $test1_7))
+ (export "test3" (func $test3_8))
+ (export "test5" (func $test5_9))
(export "keepalive" (func $5))
(func $test1 (type $none_=>_none)
(global.set $global1
@@ -66,13 +66,13 @@
)
)
)
- (func $test1_0 (type $none_=>_none)
+ (func $test1_7 (type $none_=>_none)
(nop)
)
- (func $test3_0 (type $none_=>_i32) (result i32)
+ (func $test3_8 (type $none_=>_i32) (result i32)
(i32.const 42)
)
- (func $test5_0 (type $none_=>_i32) (result i32)
+ (func $test5_9 (type $none_=>_i32) (result i32)
(call $import)
(i32.const 100)
)
diff --git a/test/example/module-splitting.txt b/test/example/module-splitting.txt
index 9466f026e..09d6879ef 100644
--- a/test/example/module-splitting.txt
+++ b/test/example/module-splitting.txt
@@ -753,7 +753,7 @@ After:
(table $0 1 funcref)
(elem $0 (i32.const 0) $placeholder_0)
(export "%foo" (func $bar))
- (export "%foo_0" (func $foo))
+ (export "%foo_1" (func $foo))
(export "%table" (table $0))
(func $foo (type $none_=>_none)
(nop)
@@ -768,7 +768,7 @@ Secondary:
(module
(type $none_=>_none (func))
(import "primary" "%table" (table $0 1 funcref))
- (import "primary" "%foo_0" (func $foo))
+ (import "primary" "%foo_1" (func $foo))
(elem $0 (i32.const 0) $bar)
(func $bar (type $none_=>_none)
(call $foo)
diff --git a/test/lit/ctor-eval/ctor_after_serialization.wat b/test/lit/ctor-eval/ctor_after_serialization.wat
index 7a4871398..46a599002 100644
--- a/test/lit/ctor-eval/ctor_after_serialization.wat
+++ b/test/lit/ctor-eval/ctor_after_serialization.wat
@@ -16,9 +16,9 @@
;; CHECK: (global $ctor-eval$global (ref $A) (struct.new_default $A))
- ;; CHECK: (export "new" (func $new_0))
+ ;; CHECK: (export "new" (func $new_2))
(export "new" (func $new))
- ;; CHECK: (export "nop" (func $nop_0))
+ ;; CHECK: (export "nop" (func $nop_3))
(export "nop" (func $nop))
(func $new (result (ref any))
@@ -30,11 +30,11 @@
)
)
-;; CHECK: (func $new_0 (type $none_=>_ref|any|) (result (ref any))
+;; CHECK: (func $new_2 (type $none_=>_ref|any|) (result (ref any))
;; CHECK-NEXT: (global.get $ctor-eval$global)
;; CHECK-NEXT: )
-;; CHECK: (func $nop_0 (type $none_=>_none)
+;; CHECK: (func $nop_3 (type $none_=>_none)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
(module
@@ -53,11 +53,11 @@
(struct.new_default $A)
)
- ;; CHECK: (global $ctor-eval$global_0 (ref $A) (struct.new_default $A))
+ ;; CHECK: (global $ctor-eval$global_1 (ref $A) (struct.new_default $A))
- ;; CHECK: (export "new" (func $new_0))
+ ;; CHECK: (export "new" (func $new_2))
(export "new" (func $new))
- ;; CHECK: (export "nop" (func $nop_0))
+ ;; CHECK: (export "nop" (func $nop_3))
(export "nop" (func $nop))
(func $new (result (ref any))
@@ -69,10 +69,10 @@
(global.get $ctor-eval$global)
)
)
-;; CHECK: (func $new_0 (type $none_=>_ref|any|) (result (ref any))
-;; CHECK-NEXT: (global.get $ctor-eval$global_0)
+;; CHECK: (func $new_2 (type $none_=>_ref|any|) (result (ref any))
+;; CHECK-NEXT: (global.get $ctor-eval$global_1)
;; CHECK-NEXT: )
-;; CHECK: (func $nop_0 (type $none_=>_anyref) (result anyref)
+;; CHECK: (func $nop_3 (type $none_=>_anyref) (result anyref)
;; CHECK-NEXT: (global.get $ctor-eval$global)
;; CHECK-NEXT: )
diff --git a/test/lit/ctor-eval/extern.wast b/test/lit/ctor-eval/extern.wast
index 462e64290..874b2c00e 100644
--- a/test/lit/ctor-eval/extern.wast
+++ b/test/lit/ctor-eval/extern.wast
@@ -18,7 +18,7 @@
;; CHECK-NEXT: (i32.const 3)
;; CHECK-NEXT: ))
- ;; CHECK: (global $ctor-eval$global_0 (ref $struct) (struct.new $struct
+ ;; CHECK: (global $ctor-eval$global_1 (ref $struct) (struct.new $struct
;; CHECK-NEXT: (extern.externalize
;; CHECK-NEXT: (i31.new
;; CHECK-NEXT: (i32.const 1)
@@ -26,11 +26,11 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: ))
- ;; CHECK: (export "test1" (func $test1_0))
+ ;; CHECK: (export "test1" (func $test1_3))
(export "test1" (func $test1))
- ;; CHECK: (export "test2" (func $test2_0))
+ ;; CHECK: (export "test2" (func $test2_4))
(export "test2" (func $test2))
- ;; CHECK: (export "test3" (func $test3_0))
+ ;; CHECK: (export "test3" (func $test3_5))
(export "test3" (func $test3))
(func $test1 (result externref)
@@ -70,7 +70,7 @@
)
)
-;; CHECK: (func $test1_0 (type $none_=>_externref) (result externref)
+;; CHECK: (func $test1_3 (type $none_=>_externref) (result externref)
;; CHECK-NEXT: (extern.externalize
;; CHECK-NEXT: (i31.new
;; CHECK-NEXT: (i32.const 42)
@@ -78,12 +78,12 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
-;; CHECK: (func $test2_0 (type $none_=>_externref) (result externref)
+;; CHECK: (func $test2_4 (type $none_=>_externref) (result externref)
;; CHECK-NEXT: (extern.externalize
;; CHECK-NEXT: (global.get $ctor-eval$global)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
-;; CHECK: (func $test3_0 (type $none_=>_anyref) (result anyref)
-;; CHECK-NEXT: (global.get $ctor-eval$global_0)
+;; CHECK: (func $test3_5 (type $none_=>_anyref) (result anyref)
+;; CHECK-NEXT: (global.get $ctor-eval$global_1)
;; CHECK-NEXT: )
diff --git a/test/lit/ctor-eval/multivalue-local.wast b/test/lit/ctor-eval/multivalue-local.wast
index 56dccd624..ff3daa339 100644
--- a/test/lit/ctor-eval/multivalue-local.wast
+++ b/test/lit/ctor-eval/multivalue-local.wast
@@ -41,9 +41,9 @@
)
)
)
-;; CHECK: (export "multivalue-local" (func $multivalue-local_0))
+;; CHECK: (export "multivalue-local" (func $multivalue-local_2))
-;; CHECK: (func $multivalue-local_0 (type $none_=>_i32) (result i32)
+;; CHECK: (func $multivalue-local_2 (type $none_=>_i32) (result i32)
;; CHECK-NEXT: (local $0 i32)
;; CHECK-NEXT: (local $1 (i32 i32))
;; CHECK-NEXT: (local.set $0
diff --git a/test/lit/ctor-eval/table.wat b/test/lit/ctor-eval/table.wat
index 76e9a44af..73534f59b 100644
--- a/test/lit/ctor-eval/table.wat
+++ b/test/lit/ctor-eval/table.wat
@@ -14,7 +14,7 @@
;; CHECK: (elem declare func $trap)
- ;; CHECK: (export "run" (func $run_0))
+ ;; CHECK: (export "run" (func $run_3))
(export "run" (func $run))
(func $run (type $none_=>_none)
@@ -49,7 +49,7 @@
(unreachable)
)
)
-;; CHECK: (func $run_0 (type $none_=>_none)
+;; CHECK: (func $run_3 (type $none_=>_none)
;; CHECK-NEXT: (table.set $0
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: (ref.func $trap)
diff --git a/test/lit/ctor-eval/v128.wast b/test/lit/ctor-eval/v128.wast
index b3b8c98b3..af194bc87 100644
--- a/test/lit/ctor-eval/v128.wast
+++ b/test/lit/ctor-eval/v128.wast
@@ -11,7 +11,7 @@
;; CHECK: (data $0 (i32.const 23) "\e0\ff\c0N\8e\00\00\fe\01\00\12\81\85\fd\ff\90")
- ;; CHECK: (export "v128" (func $v128_0))
+ ;; CHECK: (export "v128" (func $v128_2))
(export "v128" (func $v128))
;; CHECK: (export "keepalive" (func $keepalive))
(export "keepalive" (func $keepalive))
@@ -38,6 +38,6 @@
)
)
)
-;; CHECK: (func $v128_0 (type $none_=>_v128) (result v128)
+;; CHECK: (func $v128_2 (type $none_=>_v128) (result v128)
;; CHECK-NEXT: (v128.const i32x4 0x4ec0ffe0 0xfe00008e 0x81120001 0x90fffd85)
;; CHECK-NEXT: )
diff --git a/test/lit/passes/denan.wast b/test/lit/passes/denan.wast
index f92570f43..e55888132 100644
--- a/test/lit/passes/denan.wast
+++ b/test/lit/passes/denan.wast
@@ -218,11 +218,11 @@
(func $deNan64)
;; CHECK: (func $foo32 (param $x f32) (result f32)
;; CHECK-NEXT: (local.set $x
- ;; CHECK-NEXT: (call $deNan32_0
+ ;; CHECK-NEXT: (call $deNan32_4
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (call $deNan32_0
+ ;; CHECK-NEXT: (call $deNan32_4
;; CHECK-NEXT: (call $foo32
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
@@ -233,11 +233,11 @@
)
;; CHECK: (func $foo64 (param $x f64) (result f64)
;; CHECK-NEXT: (local.set $x
- ;; CHECK-NEXT: (call $deNan64_0
+ ;; CHECK-NEXT: (call $deNan64_4
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (call $deNan64_0
+ ;; CHECK-NEXT: (call $deNan64_4
;; CHECK-NEXT: (call $foo64
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: )
@@ -249,7 +249,7 @@
)
-;; CHECK: (func $deNan32_0 (param $0 f32) (result f32)
+;; CHECK: (func $deNan32_4 (param $0 f32) (result f32)
;; CHECK-NEXT: (if (result f32)
;; CHECK-NEXT: (f32.eq
;; CHECK-NEXT: (local.get $0)
@@ -260,7 +260,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
-;; CHECK: (func $deNan64_0 (param $0 f64) (result f64)
+;; CHECK: (func $deNan64_4 (param $0 f64) (result f64)
;; CHECK-NEXT: (if (result f64)
;; CHECK-NEXT: (f64.eq
;; CHECK-NEXT: (local.get $0)
diff --git a/test/lit/passes/inlining_splitting.wast b/test/lit/passes/inlining_splitting.wast
index 9764aa235..74039533f 100644
--- a/test/lit/passes/inlining_splitting.wast
+++ b/test/lit/passes/inlining_splitting.wast
@@ -768,7 +768,7 @@
;; CHECK-NEXT: (i32.eqz
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (call $byn-split-outlined-A$colliding-name_0
+ ;; CHECK-NEXT: (call $byn-split-outlined-A$colliding-name_65
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -783,7 +783,7 @@
;; CHECK-NEXT: (i32.eqz
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (call $byn-split-outlined-A$colliding-name_0
+ ;; CHECK-NEXT: (call $byn-split-outlined-A$colliding-name_65
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -1202,7 +1202,7 @@
;; CHECK-NEXT: (ref.is_null
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (call $byn-split-outlined-B$multi-if_0
+ ;; CHECK-NEXT: (call $byn-split-outlined-B$multi-if_74
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -1233,7 +1233,7 @@
;; CHECK-NEXT: (ref.is_null
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (call $byn-split-outlined-B$multi-if_0
+ ;; CHECK-NEXT: (call $byn-split-outlined-B$multi-if_74
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -1385,7 +1385,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
-;; CHECK: (func $byn-split-outlined-A$colliding-name_0 (type $i32_=>_none) (param $x i32)
+;; CHECK: (func $byn-split-outlined-A$colliding-name_65 (type $i32_=>_none) (param $x i32)
;; CHECK-NEXT: (loop $l
;; CHECK-NEXT: (call $import)
;; CHECK-NEXT: (br $l)
@@ -1402,7 +1402,7 @@
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
-;; CHECK: (func $byn-split-outlined-B$multi-if_0 (type $anyref_=>_none) (param $x anyref)
+;; CHECK: (func $byn-split-outlined-B$multi-if_74 (type $anyref_=>_none) (param $x anyref)
;; CHECK-NEXT: (loop $x
;; CHECK-NEXT: (call $import)
;; CHECK-NEXT: (br_if $x
@@ -1621,7 +1621,7 @@
;; CHECK-NEXT: (i32.eqz
;; CHECK-NEXT: (global.get $global$0)
;; CHECK-NEXT: )
-;; CHECK-NEXT: (call $byn-split-outlined-A$0_0)
+;; CHECK-NEXT: (call $byn-split-outlined-A$0_21)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -1637,7 +1637,7 @@
;; CHECK-NEXT: (i32.eqz
;; CHECK-NEXT: (global.get $global$0)
;; CHECK-NEXT: )
-;; CHECK-NEXT: (call $byn-split-outlined-A$0_0)
+;; CHECK-NEXT: (call $byn-split-outlined-A$0_21)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -1646,7 +1646,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
-;; CHECK: (func $byn-split-outlined-A$0_0 (type $none_=>_none)
+;; CHECK: (func $byn-split-outlined-A$0_21 (type $none_=>_none)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (block $__inlined_func$1
;; CHECK-NEXT: (block
@@ -1656,7 +1656,7 @@
;; CHECK-NEXT: (i32.eqz
;; CHECK-NEXT: (global.get $global$0)
;; CHECK-NEXT: )
-;; CHECK-NEXT: (call $byn-split-outlined-A$0_1)
+;; CHECK-NEXT: (call $byn-split-outlined-A$0_22)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -1672,7 +1672,7 @@
;; CHECK-NEXT: (i32.eqz
;; CHECK-NEXT: (global.get $global$0)
;; CHECK-NEXT: )
-;; CHECK-NEXT: (call $byn-split-outlined-A$0_1)
+;; CHECK-NEXT: (call $byn-split-outlined-A$0_22)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -1681,7 +1681,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
-;; CHECK: (func $byn-split-outlined-A$0_1 (type $none_=>_none)
+;; CHECK: (func $byn-split-outlined-A$0_22 (type $none_=>_none)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (block $__inlined_func$1
;; CHECK-NEXT: (block
diff --git a/test/lit/passes/jspi.wast b/test/lit/passes/jspi.wast
index c6da24134..bac7ca0c3 100644
--- a/test/lit/passes/jspi.wast
+++ b/test/lit/passes/jspi.wast
@@ -97,9 +97,9 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
-;; CHECK: (func $export$update_state_param_collision (type $externref_f64_=>_i32) (param $susp_0 externref) (param $susp f64) (result i32)
+;; CHECK: (func $export$update_state_param_collision (type $externref_f64_=>_i32) (param $susp_1 externref) (param $susp f64) (result i32)
;; CHECK-NEXT: (global.set $suspender
-;; CHECK-NEXT: (local.get $susp_0)
+;; CHECK-NEXT: (local.get $susp_1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (call $update_state_param_collision
;; CHECK-NEXT: (local.get $susp)
diff --git a/test/lit/passes/memory-packing_all-features.wast b/test/lit/passes/memory-packing_all-features.wast
index 36ae10668..29592f107 100644
--- a/test/lit/passes/memory-packing_all-features.wast
+++ b/test/lit/passes/memory-packing_all-features.wast
@@ -137,10 +137,10 @@
;; CHECK: (global $__mem_segment_drop_state (mut i32) (i32.const 0))
- ;; CHECK: (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
-
;; CHECK: (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
+ ;; CHECK: (global $__mem_segment_drop_state_2 (mut i32) (i32.const 0))
+
;; CHECK: (memory $0 2048 2048)
(memory $0 2048 2048)
@@ -510,7 +510,7 @@
;; CHECK: (func $even-more-zeroes (type $none_=>_none)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (if
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_0)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_1)
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (memory.fill
@@ -550,7 +550,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_0
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_1
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $11)
@@ -572,7 +572,7 @@
;; CHECK: (func $only-zeroes (type $none_=>_none)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (if
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_1)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_2)
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (memory.fill
@@ -581,7 +581,7 @@
;; CHECK-NEXT: (i32.const 30)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_1
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_2
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -671,10 +671,6 @@
;; CHECK: (global $__mem_segment_drop_state (mut i32) (i32.const 0))
- ;; CHECK: (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
-
- ;; CHECK: (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
-
;; CHECK: (global $__mem_segment_drop_state_2 (mut i32) (i32.const 0))
;; CHECK: (global $__mem_segment_drop_state_3 (mut i32) (i32.const 0))
@@ -685,6 +681,10 @@
;; CHECK: (global $__mem_segment_drop_state_6 (mut i32) (i32.const 0))
+ ;; CHECK: (global $__mem_segment_drop_state_7 (mut i32) (i32.const 0))
+
+ ;; CHECK: (global $__mem_segment_drop_state_8 (mut i32) (i32.const 0))
+
;; CHECK: (memory $0 2048 2048)
(memory $0 2048 2048)
(import "env" "param" (global $param i32))
@@ -880,7 +880,7 @@
;; CHECK: (func $partial-skip-start (type $none_=>_none)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (if
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_0)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_2)
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (memory.fill
@@ -920,7 +920,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_0
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_2
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $3)
@@ -992,7 +992,7 @@
;; CHECK: (func $partial-skip-end (type $none_=>_none)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (if
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_1)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_3)
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (memory.fill
@@ -1032,7 +1032,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_1
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_3
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $5)
@@ -1054,7 +1054,7 @@
;; CHECK: (func $full-skip-end (type $none_=>_none)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (if
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_2)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_4)
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (memory.fill
@@ -1089,7 +1089,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_2
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_4
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $6)
@@ -1111,7 +1111,7 @@
;; CHECK: (func $slice-zeroes (type $none_=>_none)
;; CHECK-NEXT: (block
;; CHECK-NEXT: (if
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_3)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_5)
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (memory.fill
@@ -1121,7 +1121,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_3
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_5
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $7)
@@ -1173,12 +1173,12 @@
;; CHECK-NEXT: (i32.const 16)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_4)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_6)
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_4
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_6
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $9)
@@ -1207,7 +1207,7 @@
;; CHECK-NEXT: (i32.const 16)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_5)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_7)
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
@@ -1310,12 +1310,12 @@
;; CHECK-NEXT: (i32.const 16)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_6)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_8)
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_6
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_8
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $14)
@@ -1338,12 +1338,12 @@
;; CHECK: (global $__mem_segment_drop_state (mut i32) (i32.const 0))
- ;; CHECK: (global $__mem_segment_drop_state_0 (mut i32) (i32.const 0))
-
;; CHECK: (global $__mem_segment_drop_state_1 (mut i32) (i32.const 0))
;; CHECK: (global $__mem_segment_drop_state_2 (mut i32) (i32.const 0))
+ ;; CHECK: (global $__mem_segment_drop_state_3 (mut i32) (i32.const 0))
+
;; CHECK: (memory $0 2048 2048)
(memory $0 2048 2048)
(data "hi\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00even\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00hi") ;; 0
@@ -1412,12 +1412,12 @@
;; CHECK-NEXT: (i32.const 16)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_0)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_0
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_1
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $1)
@@ -1446,12 +1446,12 @@
;; CHECK-NEXT: (i32.const 16)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_1)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_2)
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_1
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_2
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $2)
@@ -1479,12 +1479,12 @@
;; CHECK-NEXT: (i32.const 16)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_2)
+ ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_3)
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (block
- ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_2
+ ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_3
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (data.drop $3)
diff --git a/test/lit/passes/monomorphize.wast b/test/lit/passes/monomorphize.wast
index 43c647a0a..d171291e2 100644
--- a/test/lit/passes/monomorphize.wast
+++ b/test/lit/passes/monomorphize.wast
@@ -35,10 +35,10 @@
;; ALWAYS-NEXT: (call $refinable
;; ALWAYS-NEXT: (struct.new_default $A)
;; ALWAYS-NEXT: )
- ;; ALWAYS-NEXT: (call $refinable_0
+ ;; ALWAYS-NEXT: (call $refinable_4
;; ALWAYS-NEXT: (struct.new_default $B)
;; ALWAYS-NEXT: )
- ;; ALWAYS-NEXT: (call $refinable_0
+ ;; ALWAYS-NEXT: (call $refinable_4
;; ALWAYS-NEXT: (struct.new_default $B)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
@@ -115,7 +115,7 @@
)
-;; ALWAYS: (func $refinable_0 (type $ref|$B|_=>_none) (param $ref (ref $B))
+;; ALWAYS: (func $refinable_4 (type $ref|$B|_=>_none) (param $ref (ref $B))
;; ALWAYS-NEXT: (drop
;; ALWAYS-NEXT: (local.get $ref)
;; ALWAYS-NEXT: )
@@ -142,7 +142,7 @@
;; ALWAYS: (type $ref|$B|_=>_none (func (param (ref $B))))
;; ALWAYS: (func $calls (type $none_=>_none)
- ;; ALWAYS-NEXT: (call $refinable_0
+ ;; ALWAYS-NEXT: (call $refinable_2
;; ALWAYS-NEXT: (struct.new_default $B)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
@@ -186,7 +186,7 @@
)
-;; ALWAYS: (func $refinable_0 (type $ref|$B|_=>_none) (param $ref (ref $B))
+;; ALWAYS: (func $refinable_2 (type $ref|$B|_=>_none) (param $ref (ref $B))
;; ALWAYS-NEXT: (local $unref (ref $A))
;; ALWAYS-NEXT: (local $2 (ref $A))
;; ALWAYS-NEXT: (local.set $2
@@ -231,7 +231,7 @@
;; ALWAYS-NEXT: (call $refinable1
;; ALWAYS-NEXT: (struct.new_default $A)
;; ALWAYS-NEXT: )
- ;; ALWAYS-NEXT: (call $refinable1_0
+ ;; ALWAYS-NEXT: (call $refinable1_4
;; ALWAYS-NEXT: (struct.new_default $B)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
@@ -253,10 +253,10 @@
)
;; ALWAYS: (func $calls2 (type $none_=>_none)
- ;; ALWAYS-NEXT: (call $refinable1_1
+ ;; ALWAYS-NEXT: (call $refinable1_5
;; ALWAYS-NEXT: (struct.new_default $C)
;; ALWAYS-NEXT: )
- ;; ALWAYS-NEXT: (call $refinable2_0
+ ;; ALWAYS-NEXT: (call $refinable2_6
;; ALWAYS-NEXT: (struct.new_default $B)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
@@ -306,19 +306,19 @@
)
)
-;; ALWAYS: (func $refinable1_0 (type $ref|$B|_=>_none) (param $ref (ref $B))
+;; ALWAYS: (func $refinable1_4 (type $ref|$B|_=>_none) (param $ref (ref $B))
;; ALWAYS-NEXT: (drop
;; ALWAYS-NEXT: (local.get $ref)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
-;; ALWAYS: (func $refinable1_1 (type $ref|$C|_=>_none) (param $ref (ref $C))
+;; ALWAYS: (func $refinable1_5 (type $ref|$C|_=>_none) (param $ref (ref $C))
;; ALWAYS-NEXT: (drop
;; ALWAYS-NEXT: (local.get $ref)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
-;; ALWAYS: (func $refinable2_0 (type $ref|$B|_=>_none) (param $ref (ref $B))
+;; ALWAYS: (func $refinable2_6 (type $ref|$B|_=>_none) (param $ref (ref $B))
;; ALWAYS-NEXT: (drop
;; ALWAYS-NEXT: (local.get $ref)
;; ALWAYS-NEXT: )
@@ -364,10 +364,10 @@
;; ALWAYS-NEXT: (call $refinable
;; ALWAYS-NEXT: (struct.new_default $A)
;; ALWAYS-NEXT: )
- ;; ALWAYS-NEXT: (call $refinable_0
+ ;; ALWAYS-NEXT: (call $refinable_3
;; ALWAYS-NEXT: (struct.new_default $B)
;; ALWAYS-NEXT: )
- ;; ALWAYS-NEXT: (call $refinable_0
+ ;; ALWAYS-NEXT: (call $refinable_3
;; ALWAYS-NEXT: (struct.new_default $B)
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
@@ -378,10 +378,10 @@
;; CAREFUL-NEXT: (call $refinable
;; CAREFUL-NEXT: (struct.new_default $A)
;; CAREFUL-NEXT: )
- ;; CAREFUL-NEXT: (call $refinable_0
+ ;; CAREFUL-NEXT: (call $refinable_3
;; CAREFUL-NEXT: (struct.new_default $B)
;; CAREFUL-NEXT: )
- ;; CAREFUL-NEXT: (call $refinable_0
+ ;; CAREFUL-NEXT: (call $refinable_3
;; CAREFUL-NEXT: (struct.new_default $B)
;; CAREFUL-NEXT: )
;; CAREFUL-NEXT: )
@@ -503,7 +503,7 @@
)
)
-;; ALWAYS: (func $refinable_0 (type $ref|$B|_=>_none) (param $ref (ref $B))
+;; ALWAYS: (func $refinable_3 (type $ref|$B|_=>_none) (param $ref (ref $B))
;; ALWAYS-NEXT: (local $x (ref $A))
;; ALWAYS-NEXT: (call $import
;; ALWAYS-NEXT: (ref.cast $B
@@ -534,7 +534,7 @@
;; ALWAYS-NEXT: )
;; ALWAYS-NEXT: )
-;; CAREFUL: (func $refinable_0 (type $ref|$B|_=>_none) (param $0 (ref $B))
+;; CAREFUL: (func $refinable_3 (type $ref|$B|_=>_none) (param $0 (ref $B))
;; CAREFUL-NEXT: (local $1 (ref $B))
;; CAREFUL-NEXT: (call $import
;; CAREFUL-NEXT: (local.get $0)
diff --git a/test/lit/passes/poppify-globals.wast b/test/lit/passes/poppify-globals.wast
index 205fac513..af3606387 100644
--- a/test/lit/passes/poppify-globals.wast
+++ b/test/lit/passes/poppify-globals.wast
@@ -21,19 +21,19 @@
;; CHECK: (global $tuple$2 (mut f32) (f32.const 2))
- ;; CHECK: (global $tuple$1_0 (mut i64) (i64.const 1))
+ ;; CHECK: (global $tuple$1_3 (mut i64) (i64.const 1))
;; CHECK: (global $tuple$0 (mut i32) (global.get $foo))
;; CHECK: (global $other-tuple$2 f32 (global.get $tuple$2))
- ;; CHECK: (global $other-tuple$1 i64 (global.get $tuple$1_0))
+ ;; CHECK: (global $other-tuple$1 i64 (global.get $tuple$1_4))
;; CHECK: (global $other-tuple$0 i32 (global.get $tuple$0))
;; CHECK: (func $global-get-tuple (type $none_=>_i32_i64_f32) (result i32 i64 f32)
;; CHECK-NEXT: (global.get $tuple$0)
- ;; CHECK-NEXT: (global.get $tuple$1_0)
+ ;; CHECK-NEXT: (global.get $tuple$1_4)
;; CHECK-NEXT: (global.get $tuple$2)
;; CHECK-NEXT: )
(func $global-get-tuple (result i32 i64 f32)
@@ -47,7 +47,7 @@
;; CHECK-NEXT: (global.set $tuple$2
;; CHECK-NEXT: (pop f32)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (global.set $tuple$1_0
+ ;; CHECK-NEXT: (global.set $tuple$1_4
;; CHECK-NEXT: (pop i64)
;; CHECK-NEXT: )
;; CHECK-NEXT: (global.set $tuple$0
diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast
index 37f5fc58d..65d465774 100644
--- a/test/lit/wat-kitchen-sink.wast
+++ b/test/lit/wat-kitchen-sink.wast
@@ -396,16 +396,16 @@
;; CHECK: (func $add-stacky-4 (type $none_=>_i32) (result i32)
;; CHECK-NEXT: (local $scratch i32)
- ;; CHECK-NEXT: (local $scratch_0 i32)
;; CHECK-NEXT: (local $scratch_1 i32)
- ;; CHECK-NEXT: (local.set $scratch_1
+ ;; CHECK-NEXT: (local $scratch_2 i32)
+ ;; CHECK-NEXT: (local.set $scratch_2
;; CHECK-NEXT: (i32.add
;; CHECK-NEXT: (block (result i32)
- ;; CHECK-NEXT: (local.set $scratch_0
+ ;; CHECK-NEXT: (local.set $scratch_1
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (nop)
- ;; CHECK-NEXT: (local.get $scratch_0)
+ ;; CHECK-NEXT: (local.get $scratch_1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (block (result i32)
;; CHECK-NEXT: (local.set $scratch
@@ -417,7 +417,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (nop)
- ;; CHECK-NEXT: (local.get $scratch_1)
+ ;; CHECK-NEXT: (local.get $scratch_2)
;; CHECK-NEXT: )
(func $add-stacky-4 (result i32)
i32.const 1
@@ -610,22 +610,22 @@
;; CHECK: (func $big-stack (type $void)
;; CHECK-NEXT: (local $scratch f64)
- ;; CHECK-NEXT: (local $scratch_0 i64)
- ;; CHECK-NEXT: (local $scratch_1 f32)
- ;; CHECK-NEXT: (local $scratch_2 i32)
+ ;; CHECK-NEXT: (local $scratch_1 i64)
+ ;; CHECK-NEXT: (local $scratch_2 f32)
+ ;; CHECK-NEXT: (local $scratch_3 i32)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result i32)
- ;; CHECK-NEXT: (local.set $scratch_2
+ ;; CHECK-NEXT: (local.set $scratch_3
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result f32)
- ;; CHECK-NEXT: (local.set $scratch_1
+ ;; CHECK-NEXT: (local.set $scratch_2
;; CHECK-NEXT: (f32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result i64)
- ;; CHECK-NEXT: (local.set $scratch_0
+ ;; CHECK-NEXT: (local.set $scratch_1
;; CHECK-NEXT: (i64.const 2)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
@@ -639,13 +639,13 @@
;; CHECK-NEXT: (local.get $scratch)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.get $scratch_0)
+ ;; CHECK-NEXT: (local.get $scratch_1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.get $scratch_1)
+ ;; CHECK-NEXT: (local.get $scratch_2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.get $scratch_2)
+ ;; CHECK-NEXT: (local.get $scratch_3)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -755,10 +755,10 @@
;; CHECK: (func $block-mix (type $void)
;; CHECK-NEXT: (local $scratch i32)
- ;; CHECK-NEXT: (local $scratch_0 (i32 i32))
- ;; CHECK-NEXT: (local $scratch_1 i32)
+ ;; CHECK-NEXT: (local $scratch_1 (i32 i32))
+ ;; CHECK-NEXT: (local $scratch_2 i32)
;; CHECK-NEXT: (block $0
- ;; CHECK-NEXT: (local.set $scratch_0
+ ;; CHECK-NEXT: (local.set $scratch_1
;; CHECK-NEXT: (block $1 (result i32 i32)
;; CHECK-NEXT: (tuple.make
;; CHECK-NEXT: (block $2 (result i32)
@@ -778,17 +778,17 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result i32)
- ;; CHECK-NEXT: (local.set $scratch_1
+ ;; CHECK-NEXT: (local.set $scratch_2
;; CHECK-NEXT: (tuple.extract 0
- ;; CHECK-NEXT: (local.get $scratch_0)
+ ;; CHECK-NEXT: (local.get $scratch_1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (tuple.extract 1
- ;; CHECK-NEXT: (local.get $scratch_0)
+ ;; CHECK-NEXT: (local.get $scratch_1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (local.get $scratch_1)
+ ;; CHECK-NEXT: (local.get $scratch_2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
diff --git a/test/passes/stack-check_enable-mutable-globals.txt b/test/passes/stack-check_enable-mutable-globals.txt
index 73c867921..b22546809 100644
--- a/test/passes/stack-check_enable-mutable-globals.txt
+++ b/test/passes/stack-check_enable-mutable-globals.txt
@@ -45,18 +45,18 @@
(import "env" "__stack_pointer" (global $sp (mut i32)))
(global $__stack_base (mut i32) (i32.const 0))
(global $__stack_limit (mut i32) (i32.const 0))
- (global $__stack_base_0 (mut i32) (i32.const 0))
- (global $__stack_limit_0 (mut i32) (i32.const 0))
+ (global $__stack_base_3 (mut i32) (i32.const 0))
+ (global $__stack_limit_3 (mut i32) (i32.const 0))
(export "use_stack" (func $0))
(export "__set_stack_limits" (func $__set_stack_limits))
(func $0 (result i32)
(unreachable)
)
(func $__set_stack_limits (param $0 i32) (param $1 i32)
- (global.set $__stack_base_0
+ (global.set $__stack_base_3
(local.get $0)
)
- (global.set $__stack_limit_0
+ (global.set $__stack_limit_3
(local.get $1)
)
)