summaryrefslogtreecommitdiff
path: root/test/lit/passes
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-12-12 17:20:32 -0800
committerGitHub <noreply@github.com>2023-12-12 17:20:32 -0800
commit28bea549061d88a8a7f7d05f3acf3bca175f0102 (patch)
tree2329f4374061006771672c7d37001783eaaf06a5 /test/lit/passes
parentb59b2fc639a134260458bc076c407e7fbfb946d6 (diff)
downloadbinaryen-28bea549061d88a8a7f7d05f3acf3bca175f0102.tar.gz
binaryen-28bea549061d88a8a7f7d05f3acf3bca175f0102.tar.bz2
binaryen-28bea549061d88a8a7f7d05f3acf3bca175f0102.zip
Add an arity immediate to tuple.extract (#6172)
Once support for tuple.extract lands in the new WAT parser, this arity immediate will let the parser determine how many values it should pop off the stack to serve as the tuple operand to `tuple.extract`. This will usually coincide with the arity of a tuple-producing instruction on top of the stack, but in the spirit of treating the input as a proper stack machine, it will not have to and the parser will still work correctly.
Diffstat (limited to 'test/lit/passes')
-rw-r--r--test/lit/passes/asyncify_enable-multivalue.wast4
-rw-r--r--test/lit/passes/coalesce-locals-gc-nn.wast16
-rw-r--r--test/lit/passes/coalesce-locals-gc.wast16
-rw-r--r--test/lit/passes/dae-gc-refine-return.wast4
-rw-r--r--test/lit/passes/gufa-refs.wast6
-rw-r--r--test/lit/passes/optimize-instructions-multivalue.wast22
-rw-r--r--test/lit/passes/optimize-stack-ir.wast4
-rw-r--r--test/lit/passes/outlining.wast8
-rw-r--r--test/lit/passes/poppify.wast6
-rw-r--r--test/lit/passes/precompute-gc.wast2
-rw-r--r--test/lit/passes/roundtrip.wast4
-rw-r--r--test/lit/passes/simplify-locals-gc-nn.wast6
-rw-r--r--test/lit/passes/stack-ir-non-nullable.wast16
-rw-r--r--test/lit/passes/tuple-optimization.wast84
14 files changed, 99 insertions, 99 deletions
diff --git a/test/lit/passes/asyncify_enable-multivalue.wast b/test/lit/passes/asyncify_enable-multivalue.wast
index bfc154f81..04b0a4707 100644
--- a/test/lit/passes/asyncify_enable-multivalue.wast
+++ b/test/lit/passes/asyncify_enable-multivalue.wast
@@ -1867,13 +1867,13 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.store
;; CHECK-NEXT: (local.get $6)
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (i64.store offset=4 align=4
;; CHECK-NEXT: (local.get $6)
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
diff --git a/test/lit/passes/coalesce-locals-gc-nn.wast b/test/lit/passes/coalesce-locals-gc-nn.wast
index 1611a106e..026b3e1df 100644
--- a/test/lit/passes/coalesce-locals-gc-nn.wast
+++ b/test/lit/passes/coalesce-locals-gc-nn.wast
@@ -18,22 +18,22 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (call $nn-locals
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (call $nn-locals
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (call $nn-locals
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (call $nn-locals
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -60,22 +60,22 @@
)
)
(call $nn-locals
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $x)
)
)
(call $nn-locals
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $y)
)
)
(call $nn-locals
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $x)
)
)
(call $nn-locals
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $y)
)
)
diff --git a/test/lit/passes/coalesce-locals-gc.wast b/test/lit/passes/coalesce-locals-gc.wast
index 09270fb6c..8af0d2187 100644
--- a/test/lit/passes/coalesce-locals-gc.wast
+++ b/test/lit/passes/coalesce-locals-gc.wast
@@ -313,21 +313,21 @@
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: (tuple.make 2
;; CHECK-NEXT: (ref.as_non_null
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (tuple.make 2
;; CHECK-NEXT: (ref.as_non_null
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -335,11 +335,11 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (tuple.make 2
;; CHECK-NEXT: (ref.as_non_null
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -347,11 +347,11 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (tuple.make 2
;; CHECK-NEXT: (ref.as_non_null
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
diff --git a/test/lit/passes/dae-gc-refine-return.wast b/test/lit/passes/dae-gc-refine-return.wast
index 857f79a06..806683a62 100644
--- a/test/lit/passes/dae-gc-refine-return.wast
+++ b/test/lit/passes/dae-gc-refine-return.wast
@@ -239,7 +239,7 @@
;; CHECK-NEXT: (local $temp anyref)
;; CHECK-NEXT: (local $i31 i31ref)
;; CHECK-NEXT: (local.set $temp
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (call $refine-return-tuple)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -253,7 +253,7 @@
(local $i31 (ref null i31))
(local.set $temp
- (tuple.extract 0
+ (tuple.extract 2 0
(call $refine-return-tuple)
)
)
diff --git a/test/lit/passes/gufa-refs.wast b/test/lit/passes/gufa-refs.wast
index 2687de049..a99df47e0 100644
--- a/test/lit/passes/gufa-refs.wast
+++ b/test/lit/passes/gufa-refs.wast
@@ -2164,7 +2164,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (catch $tag
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (pop anyref anyref)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -2182,7 +2182,7 @@
(do)
(catch $tag
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(pop (ref null any) (ref null any))
)
)
@@ -2193,7 +2193,7 @@
(do)
(catch $tag
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(pop (ref null any) (ref null any))
)
)
diff --git a/test/lit/passes/optimize-instructions-multivalue.wast b/test/lit/passes/optimize-instructions-multivalue.wast
index b7a871ce2..10b64e354 100644
--- a/test/lit/passes/optimize-instructions-multivalue.wast
+++ b/test/lit/passes/optimize-instructions-multivalue.wast
@@ -5,7 +5,7 @@
;; CHECK: (func $if-identical-arms-tuple (param $x i32) (result i32)
;; CHECK-NEXT: (local $tuple (i32 i32))
;; CHECK-NEXT: (local $tuple2 (i32 i32))
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (if (type $2) (result i32 i32)
;; CHECK-NEXT: (local.get $x)
;; CHECK-NEXT: (local.get $tuple)
@@ -19,10 +19,10 @@
(if (result i32)
(local.get $x)
;; The tuple.extract can be hoisted out.
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple)
)
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple2)
)
)
@@ -31,10 +31,10 @@
;; CHECK-NEXT: (local $tuple (i32 i32))
;; CHECK-NEXT: (local $tuple2 (i32 i32))
;; CHECK-NEXT: (select
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $tuple)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $tuple2)
;; CHECK-NEXT: )
;; CHECK-NEXT: (local.get $x)
@@ -46,10 +46,10 @@
(select
;; The tuple.extract cannot be hoisted out, as the spec disallows a
;; select with multiple values in its arms.
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple)
)
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple2)
)
(local.get $x)
@@ -67,7 +67,7 @@
;; CHECK-NEXT: )
(func $extract-make (param $x i32) (param $y i32) (result i32)
;; An extraction from a make can be simplified to just get the right lane.
- (tuple.extract 0
+ (tuple.extract 2 0
(tuple.make 2
(local.get $x)
(local.get $y)
@@ -86,7 +86,7 @@
;; CHECK-NEXT: )
(func $extract-make-2 (param $x i32) (param $y i32) (result i32)
;; As above, but the second lane.
- (tuple.extract 1
+ (tuple.extract 2 1
(tuple.make 2
(local.get $x)
(local.get $y)
@@ -95,7 +95,7 @@
)
;; CHECK: (func $extract-make-unreachable (param $x i32) (param $y i32) (result i32)
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 1 0
;; CHECK-NEXT: (tuple.make 2
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: (local.get $y)
@@ -103,7 +103,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $extract-make-unreachable (param $x i32) (param $y i32) (result i32)
- (tuple.extract 0
+ (tuple.extract 2 0
(tuple.make 2
(unreachable) ;; because of this we should do nothing
(local.get $y)
diff --git a/test/lit/passes/optimize-stack-ir.wast b/test/lit/passes/optimize-stack-ir.wast
index 5efccdb3a..adb787879 100644
--- a/test/lit/passes/optimize-stack-ir.wast
+++ b/test/lit/passes/optimize-stack-ir.wast
@@ -1407,7 +1407,7 @@
;; CHECK-NEXT: tuple.make 2
;; CHECK-NEXT: local.set $pair
;; CHECK-NEXT: local.get $pair
- ;; CHECK-NEXT: tuple.extract 0
+ ;; CHECK-NEXT: tuple.extract 2 0
;; CHECK-NEXT: local.set $f32
;; CHECK-NEXT: )
(func $tuple-local2stack
@@ -1422,7 +1422,7 @@
)
)
(local.set $f32
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $pair)
)
)
diff --git a/test/lit/passes/outlining.wast b/test/lit/passes/outlining.wast
index f74b887b1..46a3de0bd 100644
--- a/test/lit/passes/outlining.wast
+++ b/test/lit/passes/outlining.wast
@@ -649,11 +649,11 @@
;; CHECK-NEXT: (local.set $scratch
;; CHECK-NEXT: (call $outline$)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $scratch)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $scratch)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -664,11 +664,11 @@
;; CHECK-NEXT: (local.set $scratch_1
;; CHECK-NEXT: (call $outline$)
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $scratch_1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $scratch_1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
diff --git a/test/lit/passes/poppify.wast b/test/lit/passes/poppify.wast
index 5ca28f494..38bc920aa 100644
--- a/test/lit/passes/poppify.wast
+++ b/test/lit/passes/poppify.wast
@@ -300,7 +300,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
(func $extract-first (result i32)
- (tuple.extract 0
+ (tuple.extract 3 0
(tuple.make 3
(i32.const 0)
(i64.const 1)
@@ -326,7 +326,7 @@
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
(func $extract-middle (result i64)
- (tuple.extract 1
+ (tuple.extract 3 1
(tuple.make 3
(i32.const 0)
(i64.const 1)
@@ -352,7 +352,7 @@
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
(func $extract-last (result f32)
- (tuple.extract 2
+ (tuple.extract 3 2
(tuple.make 3
(i32.const 0)
(i64.const 1)
diff --git a/test/lit/passes/precompute-gc.wast b/test/lit/passes/precompute-gc.wast
index 3e026daa3..1c99d6e98 100644
--- a/test/lit/passes/precompute-gc.wast
+++ b/test/lit/passes/precompute-gc.wast
@@ -794,7 +794,7 @@
)
(drop
(struct.get $B 0
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $temp)
)
)
diff --git a/test/lit/passes/roundtrip.wast b/test/lit/passes/roundtrip.wast
index 729581161..086a57f64 100644
--- a/test/lit/passes/roundtrip.wast
+++ b/test/lit/passes/roundtrip.wast
@@ -18,12 +18,12 @@
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (block (result funcref)
;; CHECK-NEXT: (local.set $1
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $0)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
diff --git a/test/lit/passes/simplify-locals-gc-nn.wast b/test/lit/passes/simplify-locals-gc-nn.wast
index 4b3eb0c6e..df5148d12 100644
--- a/test/lit/passes/simplify-locals-gc-nn.wast
+++ b/test/lit/passes/simplify-locals-gc-nn.wast
@@ -67,15 +67,15 @@
;; CHECK-NEXT: (catch_all
;; CHECK-NEXT: (tuple.drop 3
;; CHECK-NEXT: (tuple.make 3
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 3 0
;; CHECK-NEXT: (local.get $nn)
;; CHECK-NEXT: )
;; CHECK-NEXT: (ref.as_non_null
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 3 1
;; CHECK-NEXT: (local.get $nn)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; CHECK-NEXT: (tuple.extract 2
+ ;; CHECK-NEXT: (tuple.extract 3 2
;; CHECK-NEXT: (local.get $nn)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
diff --git a/test/lit/passes/stack-ir-non-nullable.wast b/test/lit/passes/stack-ir-non-nullable.wast
index f397aa22e..e2bd63271 100644
--- a/test/lit/passes/stack-ir-non-nullable.wast
+++ b/test/lit/passes/stack-ir-non-nullable.wast
@@ -346,7 +346,7 @@
;; CHECK-NEXT: tuple.make 2
;; CHECK-NEXT: local.set $temp
;; CHECK-NEXT: local.get $temp
- ;; CHECK-NEXT: tuple.extract 1
+ ;; CHECK-NEXT: tuple.extract 2 1
;; CHECK-NEXT: i32.const 1
;; CHECK-NEXT: ref.i31
;; CHECK-NEXT: ref.eq
@@ -364,7 +364,7 @@
;; CHECK-NEXT: local.set $temp
;; CHECK-NEXT: end
;; CHECK-NEXT: local.get $temp
- ;; CHECK-NEXT: tuple.extract 1
+ ;; CHECK-NEXT: tuple.extract 2 1
;; CHECK-NEXT: )
(func $if-nondefaultable (param $param (ref eq)) (result (ref eq))
(local $temp (i32 (ref eq)))
@@ -379,7 +379,7 @@
)
(if
(ref.eq
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $temp)
)
(i31.new
@@ -403,7 +403,7 @@
)
)
)
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $temp)
)
)
@@ -415,7 +415,7 @@
;; CHECK-NEXT: tuple.make 2
;; CHECK-NEXT: local.set $temp
;; CHECK-NEXT: local.get $temp
- ;; CHECK-NEXT: tuple.extract 1
+ ;; CHECK-NEXT: tuple.extract 2 1
;; CHECK-NEXT: i32.const 1
;; CHECK-NEXT: ref.i31
;; CHECK-NEXT: ref.eq
@@ -433,7 +433,7 @@
;; CHECK-NEXT: local.set $temp
;; CHECK-NEXT: end
;; CHECK-NEXT: local.get $temp
- ;; CHECK-NEXT: tuple.extract 1
+ ;; CHECK-NEXT: tuple.extract 2 1
;; CHECK-NEXT: )
(func $if-defaultable (param $param (ref null eq)) (result (ref null eq))
(local $temp (i32 (ref null eq)))
@@ -447,7 +447,7 @@
)
(if
(ref.eq
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $temp)
)
(i31.new
@@ -471,7 +471,7 @@
)
)
)
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $temp)
)
)
diff --git a/test/lit/passes/tuple-optimization.wast b/test/lit/passes/tuple-optimization.wast
index 4174bea24..c5bd9f531 100644
--- a/test/lit/passes/tuple-optimization.wast
+++ b/test/lit/passes/tuple-optimization.wast
@@ -41,12 +41,12 @@
;; The default value of the tuple lanes is used here in the new locals we
;; add.
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple)
)
)
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $tuple)
)
)
@@ -55,12 +55,12 @@
;; CHECK: (func $just-get-bad (type $1) (result i32 i32)
;; CHECK-NEXT: (local $tuple (i32 i32))
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $tuple)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 2 1
;; CHECK-NEXT: (local.get $tuple)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -69,12 +69,12 @@
(func $just-get-bad (result i32 i32)
(local $tuple (i32 i32))
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple)
)
)
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $tuple)
)
)
@@ -114,18 +114,18 @@
)
)
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple)
)
)
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $tuple)
)
)
;; Add another get for more coverage
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple)
)
)
@@ -180,23 +180,23 @@
)
;; Read the first tuple.
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple)
)
)
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $tuple)
)
)
;; Read the second tuple.
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple2)
)
)
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $tuple2)
)
)
@@ -223,7 +223,7 @@
(func $just-tee
(local $tuple (i32 i32))
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.tee $tuple
(tuple.make 2
(i32.const 1)
@@ -481,7 +481,7 @@
;; CHECK: (func $make-extract-no-local (type $0)
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (tuple.make 2
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: (i32.const 2)
@@ -493,7 +493,7 @@
;; Tuple operations without locals. We do nothing here; other passes can
;; help on this kind of thing.
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(tuple.make 2
(i32.const 1)
(i32.const 2)
@@ -515,7 +515,7 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (tuple.make 2
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: (i32.const 2)
@@ -534,7 +534,7 @@
;; The code below is as in the previous testcase, but now before us there
;; is an unrelated local that can be optimized. We should remain as before.
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(tuple.make 2
(i32.const 1)
(i32.const 2)
@@ -580,12 +580,12 @@
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 1 0
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 1 1
;; CHECK-NEXT: (local.tee $tuple
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
@@ -613,12 +613,12 @@
(unreachable)
)
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(unreachable)
)
)
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(local.tee $tuple
(unreachable)
)
@@ -682,7 +682,7 @@
(local $tuple2 (i32 i32))
(local $tuple3 (i32 i32))
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.tee $tuple
(local.tee $tuple2
(local.tee $tuple3
@@ -773,17 +773,17 @@
)
;; Read from each.
(drop
- (tuple.extract 0
+ (tuple.extract 3 0
(local.get $tuple)
)
)
(drop
- (tuple.extract 1
+ (tuple.extract 3 1
(local.get $tuple2)
)
)
(drop
- (tuple.extract 2
+ (tuple.extract 3 2
(local.get $tuple3)
)
)
@@ -807,17 +807,17 @@
;; CHECK-NEXT: (local.get $tuple2)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 3 0
;; CHECK-NEXT: (local.get $tuple)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 1
+ ;; CHECK-NEXT: (tuple.extract 3 1
;; CHECK-NEXT: (local.get $tuple2)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 2
+ ;; CHECK-NEXT: (tuple.extract 3 2
;; CHECK-NEXT: (local.get $tuple3)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -844,17 +844,17 @@
)
;; Read from each.
(drop
- (tuple.extract 0
+ (tuple.extract 3 0
(local.get $tuple)
)
)
(drop
- (tuple.extract 1
+ (tuple.extract 3 1
(local.get $tuple2)
)
)
(drop
- (tuple.extract 2
+ (tuple.extract 3 2
(local.get $tuple3)
)
)
@@ -867,7 +867,7 @@
;; CHECK-NEXT: (call $set-call)
;; CHECK-NEXT: )
;; CHECK-NEXT: (drop
- ;; CHECK-NEXT: (tuple.extract 0
+ ;; CHECK-NEXT: (tuple.extract 2 0
;; CHECK-NEXT: (local.get $tuple)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
@@ -883,7 +883,7 @@
(call $set-call)
)
(drop
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple)
)
)
@@ -938,10 +938,10 @@
)
(local.set $tuple3
(tuple.make 3
- (tuple.extract 0
+ (tuple.extract 2 0
(local.get $tuple2)
)
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $tuple2)
)
(i32.const 3)
@@ -949,12 +949,12 @@
)
;; Read from each.
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $tuple2)
)
)
(drop
- (tuple.extract 2
+ (tuple.extract 3 2
(local.get $tuple3)
)
)
@@ -1006,22 +1006,22 @@
)
(local.set $tuple2
(tuple.make 2
- (tuple.extract 0
+ (tuple.extract 3 0
(local.get $tuple3)
)
- (tuple.extract 1
+ (tuple.extract 3 1
(local.get $tuple3)
)
)
)
;; Read from each.
(drop
- (tuple.extract 1
+ (tuple.extract 2 1
(local.get $tuple2)
)
)
(drop
- (tuple.extract 2
+ (tuple.extract 3 2
(local.get $tuple3)
)
)