summaryrefslogtreecommitdiff
path: root/test/lit/passes/optimize-instructions-gc.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/lit/passes/optimize-instructions-gc.wast')
-rw-r--r--test/lit/passes/optimize-instructions-gc.wast1067
1 files changed, 1 insertions, 1066 deletions
diff --git a/test/lit/passes/optimize-instructions-gc.wast b/test/lit/passes/optimize-instructions-gc.wast
index 0f35cc238..e6c251ad2 100644
--- a/test/lit/passes/optimize-instructions-gc.wast
+++ b/test/lit/passes/optimize-instructions-gc.wast
@@ -1,12 +1,10 @@
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited.
+
;; RUN: wasm-opt %s --remove-unused-names --optimize-instructions --enable-reference-types --enable-gc -S -o - \
;; RUN: | filecheck %s
-;; RUN: wasm-opt %s --remove-unused-names --optimize-instructions --enable-reference-types --enable-gc --nominal -S -o - \
-;; RUN: | filecheck %s --check-prefix NOMNL
(module
;; CHECK: (type $struct (struct (field $i8 (mut i8)) (field $i16 (mut i16)) (field $i32 (mut i32)) (field $i64 (mut i64))))
- ;; NOMNL: (type $struct (struct (field $i8 (mut i8)) (field $i16 (mut i16)) (field $i32 (mut i32)) (field $i64 (mut i64))))
(type $struct (struct
(field $i8 (mut i8))
(field $i16 (mut i16))
@@ -15,15 +13,11 @@
))
;; CHECK: (type $A (struct (field i32)))
- ;; NOMNL: (type $A (struct (field i32)))
(type $A (struct (field i32)))
;; CHECK: (type $B (struct_subtype (field i32) (field i32) (field f32) $A))
;; CHECK: (type $array (array (mut i8)))
- ;; NOMNL: (type $B (struct_subtype (field i32) (field i32) (field f32) $A))
-
- ;; NOMNL: (type $array (array (mut i8)))
(type $array (array (mut i8)))
(type $B (struct_subtype (field i32) (field i32) (field f32) $A))
@@ -31,9 +25,6 @@
;; CHECK: (type $void (func))
;; CHECK: (type $B-child (struct_subtype (field i32) (field i32) (field f32) (field i64) $B))
- ;; NOMNL: (type $void (func))
-
- ;; NOMNL: (type $B-child (struct_subtype (field i32) (field i32) (field f32) (field i64) $B))
(type $B-child (struct_subtype (field i32) (field i32) (field f32) (field i64) $B))
(type $empty (struct))
@@ -41,9 +32,6 @@
;; CHECK: (type $void2 (func_subtype $void))
;; CHECK: (type $C (struct_subtype (field i32) (field i32) (field f64) $A))
- ;; NOMNL: (type $void2 (func_subtype $void))
-
- ;; NOMNL: (type $C (struct_subtype (field i32) (field i32) (field f64) $A))
(type $C (struct_subtype (field i32) (field i32) (field f64) $A))
(type $void (func))
@@ -51,7 +39,6 @@
(type $void2 (func_subtype $void))
;; CHECK: (import "env" "get-i32" (func $get-i32 (result i32)))
- ;; NOMNL: (import "env" "get-i32" (func $get-i32 (result i32)))
(import "env" "get-i32" (func $get-i32 (result i32)))
;; These functions test if an `if` with subtyped arms is correctly folded
@@ -59,9 +46,6 @@
;; CHECK: (func $if-arms-subtype-fold (type $none_=>_anyref) (result anyref)
;; CHECK-NEXT: (ref.null none)
;; CHECK-NEXT: )
- ;; NOMNL: (func $if-arms-subtype-fold (type $none_=>_anyref) (result anyref)
- ;; NOMNL-NEXT: (ref.null none)
- ;; NOMNL-NEXT: )
(func $if-arms-subtype-fold (result anyref)
(if (result anyref)
(i32.const 0)
@@ -77,13 +61,6 @@
;; CHECK-NEXT: (local.get $i31ref)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $if-arms-subtype-nofold (type $i31ref_=>_anyref) (param $i31ref i31ref) (result anyref)
- ;; NOMNL-NEXT: (if (result anyref)
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: (ref.null none)
- ;; NOMNL-NEXT: (local.get $i31ref)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $if-arms-subtype-nofold (param $i31ref i31ref) (result anyref)
(if (result anyref)
(i32.const 0)
@@ -107,20 +84,6 @@
;; CHECK-NEXT: (call $get-i32)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $store-trunc (type $ref?|$struct|_=>_none) (param $x (ref null $struct))
- ;; NOMNL-NEXT: (struct.set $struct $i8
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (i32.const 35)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (struct.set $struct $i16
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (i32.const 9029)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (struct.set $struct $i8
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (call $get-i32)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $store-trunc (param $x (ref null $struct))
(struct.set $struct $i8
(local.get $x)
@@ -147,13 +110,6 @@
;; CHECK-NEXT: (i32.const 35)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $store-trunc2 (type $ref?|$array|_=>_none) (param $x (ref null $array))
- ;; NOMNL-NEXT: (array.set $array
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: (i32.const 35)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $store-trunc2 (param $x (ref null $array))
(array.set $array
(local.get $x)
@@ -190,32 +146,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $unneeded_is (type $ref|$struct|_ref|func|_ref|i31|_=>_none) (param $struct (ref $struct)) (param $func (ref func)) (param $i31 (ref i31))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $func)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $i31)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $unneeded_is
(param $struct (ref $struct))
(param $func (ref func))
@@ -254,27 +184,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $unneeded_is_null (type $ref?|$struct|_funcref_i31ref_=>_none) (param $struct (ref null $struct)) (param $func funcref) (param $i31 i31ref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.eqz
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $func)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.eqz
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $i31)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $unneeded_is_null
(param $struct (ref null $struct))
(param $func (ref null func))
@@ -306,17 +215,6 @@
;; CHECK-NEXT: (local.get $i31)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $unneeded_as (type $ref|$struct|_ref|func|_ref|i31|_=>_none) (param $struct (ref $struct)) (param $func (ref func)) (param $i31 (ref i31))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $func)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $i31)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $unneeded_as
(param $struct (ref $struct))
(param $func (ref func))
@@ -351,23 +249,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $unneeded_as_null (type $ref?|$struct|_funcref_i31ref_=>_none) (param $struct (ref null $struct)) (param $func funcref) (param $i31 i31ref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $func)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $i31)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $unneeded_as_null
(param $struct (ref null $struct))
(param $func (ref null func))
@@ -398,21 +279,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $unneeded_unreachability (type $void)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.is_func
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block ;; (replaces something unreachable we can't emit)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $unneeded_unreachability
;; unreachable instructions can simply be ignored
(drop
@@ -458,41 +324,6 @@
;; CHECK-NEXT: (local.get $f)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $redundant-non-null-casts (type $ref?|$struct|_ref?|$array|_ref?|$void|_=>_none) (param $x (ref null $struct)) (param $y (ref null $array)) (param $f (ref null $void))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (struct.set $struct $i8
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (struct.get_u $struct $i8
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (array.set $array
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: (i32.const 2)
- ;; NOMNL-NEXT: (i32.const 3)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (array.get_u $array
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: (i32.const 4)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (array.len
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (call_ref $void
- ;; NOMNL-NEXT: (local.get $f)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $redundant-non-null-casts (param $x (ref null $struct)) (param $y (ref null $array)) (param $f (ref null $void))
(drop
(ref.as_non_null
@@ -548,9 +379,6 @@
;; CHECK: (func $get-eqref (type $none_=>_eqref) (result eqref)
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
- ;; NOMNL: (func $get-eqref (type $none_=>_eqref) (result eqref)
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
(func $get-eqref (result eqref)
(unreachable)
)
@@ -577,28 +405,6 @@
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-eq (type $eqref_eqref_=>_none) (param $x eqref) (param $y eqref)
- ;; NOMNL-NEXT: (local $lx eqref)
- ;; NOMNL-NEXT: (local $ly eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.eq
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (local.set $lx
- ;; NOMNL-NEXT: (call $get-eqref)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-eq (param $x eqref) (param $y eqref)
(local $lx eqref)
(local $ly eqref)
@@ -649,12 +455,8 @@
;; CHECK: (func $nothing (type $void)
;; CHECK-NEXT: (nop)
;; CHECK-NEXT: )
- ;; NOMNL: (func $nothing (type $void)
- ;; NOMNL-NEXT: (nop)
- ;; NOMNL-NEXT: )
(func $nothing)
-
;; CHECK: (func $ref-eq-corner-cases (type $eqref_=>_none) (param $x eqref)
;; CHECK-NEXT: (drop
;; CHECK-NEXT: (ref.eq
@@ -688,39 +490,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-eq-corner-cases (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.eq
- ;; NOMNL-NEXT: (block (result eqref)
- ;; NOMNL-NEXT: (call $nothing)
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (block (result eqref)
- ;; NOMNL-NEXT: (call $nothing)
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.eq
- ;; NOMNL-NEXT: (struct.new_default $struct)
- ;; NOMNL-NEXT: (struct.new_default $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $x
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-eq-corner-cases (param $x eqref)
;; side effects prevent optimization
(drop
@@ -785,16 +554,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-eq-ref-cast (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.eq
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (ref.cast null $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-eq-ref-cast (param $x eqref)
;; it is almost valid to look through a cast, except that it might trap so
;; there is a side effect
@@ -832,30 +591,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $flip-cast-of-as-non-null (type $anyref_=>_none) (param $x anyref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (struct.get_u $struct $i8
- ;; NOMNL-NEXT: (ref.cast $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_i31
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $flip-cast-of-as-non-null (param $x anyref)
(drop
(ref.cast $struct
@@ -894,15 +629,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $flip-tee-of-as-non-null (type $anyref_=>_none) (param $x anyref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.tee $x
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $flip-tee-of-as-non-null (param $x anyref)
(drop
(local.tee $x
@@ -923,15 +649,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $flip-tee-of-as-non-null-non-nullable (type $ref|any|_anyref_=>_none) (param $x (ref any)) (param $y anyref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $x
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $flip-tee-of-as-non-null-non-nullable (param $x (ref any)) (param $y (ref null any))
(drop
(local.tee $x
@@ -955,17 +672,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ternary-identical-arms (type $i32_ref?|$struct|_ref?|$struct|_=>_none) (param $x i32) (param $y (ref null $struct)) (param $z (ref null $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (if (result (ref null $struct))
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: (local.get $z)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ternary-identical-arms (param $x i32) (param $y (ref null $struct)) (param $z (ref null $struct))
(drop
(if (result i32)
@@ -988,19 +694,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $select-identical-arms-but-side-effect (type $ref?|$struct|_ref?|$struct|_i32_=>_none) (param $x (ref null $struct)) (param $y (ref null $struct)) (param $z i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (select
- ;; NOMNL-NEXT: (struct.get_u $struct $i8
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (struct.get_u $struct $i8
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (local.get $z)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $select-identical-arms-but-side-effect (param $x (ref null $struct)) (param $y (ref null $struct)) (param $z i32)
(drop
(select
@@ -1026,17 +719,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ternary-identical-arms-no-side-effect (type $ref|$struct|_ref|$struct|_i32_=>_none) (param $x (ref $struct)) (param $y (ref $struct)) (param $z i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (struct.get_u $struct $i8
- ;; NOMNL-NEXT: (select (result (ref $struct))
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: (local.get $z)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ternary-identical-arms-no-side-effect (param $x (ref $struct)) (param $y (ref $struct)) (param $z i32)
(drop
(select
@@ -1062,17 +744,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $if-identical-arms-with-side-effect (type $ref?|$struct|_ref?|$struct|_i32_=>_none) (param $x (ref null $struct)) (param $y (ref null $struct)) (param $z i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (struct.get_u $struct $i8
- ;; NOMNL-NEXT: (if (result (ref null $struct))
- ;; NOMNL-NEXT: (local.get $z)
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $if-identical-arms-with-side-effect (param $x (ref null $struct)) (param $y (ref null $struct)) (param $z i32)
(drop
(if (result i32)
@@ -1096,13 +767,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-squared (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-squared (param $x eqref)
;; Identical ref.casts can be folded together.
(drop
@@ -1130,23 +794,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-squared-fallthrough (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (local $1 (ref null $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref null $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $x
- ;; NOMNL-NEXT: (local.tee $1
- ;; NOMNL-NEXT: (ref.cast null $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (local.get $1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-squared-fallthrough (param $x eqref)
;; A fallthrough in the middle does not prevent this optimization.
(drop
@@ -1166,13 +813,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-cubed (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-cubed (param $x eqref)
;; Three and more also work.
(drop
@@ -1192,13 +832,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-squared-different (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null none
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-squared-different (param $x eqref)
;; Different casts cannot be folded. We can emit a cast to null here, which
;; is the only possible thing that can pass through.
@@ -1226,21 +859,6 @@
;; CHECK-NEXT: (i32.const 1)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-eq-null (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-eq-null (param $x eqref)
;; Equality to null can be done with ref.is_null.
(drop
@@ -1279,18 +897,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-eq-possible (type $eqref_eqref_=>_none) (param $x eqref) (param $y eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.eq
- ;; NOMNL-NEXT: (ref.cast null $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (ref.cast null $array
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-eq-possible (param $x eqref) (param $y eqref)
;; These casts are to types that are incompatible. However, it is possible
;; they are both null, so we cannot optimize here.
@@ -1353,53 +959,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-eq-impossible (type $eqref_eqref_=>_none) (param $x eqref) (param $y eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $array
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $array
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $array
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-eq-impossible (param $x eqref) (param $y eqref)
;; As above but cast one of them to non-null, which proves they cannot be
;; equal, and the result must be 0.
@@ -1467,28 +1026,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-eq-possible-b (type $eqref_eqref_=>_none) (param $x eqref) (param $y eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.eq
- ;; NOMNL-NEXT: (ref.cast $A
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (ref.cast $B
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.eq
- ;; NOMNL-NEXT: (ref.cast $B
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (ref.cast $A
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-eq-possible-b (param $x eqref) (param $y eqref)
;; As above but the casts are to things that are compatible, since B is a
;; subtype of A, so we cannot optimize.
@@ -1526,17 +1063,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $hoist-LUB-danger (type $i32_ref|$B|_ref|$C|_=>_i32) (param $x i32) (param $b (ref $B)) (param $c (ref $C)) (result i32)
- ;; NOMNL-NEXT: (if (result i32)
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (struct.get $B 1
- ;; NOMNL-NEXT: (local.get $b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (struct.get $C 1
- ;; NOMNL-NEXT: (local.get $c)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $hoist-LUB-danger (param $x i32) (param $b (ref $B)) (param $c (ref $C)) (result i32)
;; In nominal typing, if we hoist the struct.get out of the if, then the if
;; will have a new type, $A, but $A does not have field "1" which would be an
@@ -1567,16 +1093,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $incompatible-cast-of-non-null (type $ref|$struct|_=>_none) (param $struct (ref $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $array))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $incompatible-cast-of-non-null (param $struct (ref $struct))
(drop
(ref.cast $array
@@ -1600,21 +1116,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $incompatible-cast-of-null (type $ref?|$struct|_=>_none) (param $x (ref null $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $incompatible-cast-of-null (param $x (ref null $struct))
(drop
(ref.cast $array
@@ -1642,13 +1143,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $incompatible-cast-of-unknown (type $ref?|$struct|_=>_none) (param $struct (ref null $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null none
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $incompatible-cast-of-unknown (param $struct (ref null $struct))
(drop
(ref.cast null $array
@@ -1682,31 +1176,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $incompatible-test (type $ref?|$struct|_=>_none) (param $struct (ref null $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $struct)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $incompatible-test (param $struct (ref null $struct))
(drop
;; This test will definitely fail, so we can turn it into 0.
@@ -1774,48 +1243,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $subtype-compatible (type $ref?|$A|_ref?|$B|_=>_none) (param $A (ref null $A)) (param $B (ref null $B))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.test $B
- ;; NOMNL-NEXT: (local.get $A)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.eqz
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $B)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $B)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $B)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $B)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $subtype-compatible (param $A (ref null $A)) (param $B (ref null $B))
(drop
;; B is a subtype of A, so this can work.
@@ -1865,18 +1292,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref.test-unreachable (type $ref?|$A|_=>_none) (param $A (ref null $A))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.test $A
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.test null $A
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref.test-unreachable (param $A (ref null $A))
(drop
;; We should ignore unreachable ref.tests and not try to compare their
@@ -1942,56 +1357,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-null (type $void)
- ;; NOMNL-NEXT: (local $a (ref null $A))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.null none)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result nullref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $a
- ;; NOMNL-NEXT: (ref.null none)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (ref.null none)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $a
- ;; NOMNL-NEXT: (ref.null none)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result nullref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result nullref)
- ;; NOMNL-NEXT: (ref.cast null none
- ;; NOMNL-NEXT: (local.get $a)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (ref.null none)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result nullref)
- ;; NOMNL-NEXT: (ref.cast null none
- ;; NOMNL-NEXT: (local.get $a)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-null
(local $a (ref null $A))
;; Casting nulls results in a null.
@@ -2056,24 +1421,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-general (type $ref?|$A|_ref?|$B|_=>_none) (param $a (ref null $A)) (param $b (ref null $B))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $a)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B
- ;; NOMNL-NEXT: (local.get $a)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $a
- ;; NOMNL-NEXT: (local.get $a)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-general (param $a (ref null $A)) (param $b (ref null $B))
;; In the general case, a static cast of something simply succeeds if the
;; type is a subtype.
@@ -2120,23 +1467,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-squared (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $A
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-squared (param $x eqref)
;; Identical ref.casts can be folded together.
(drop
@@ -2195,38 +1525,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-many (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B-child
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B-child
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B-child
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B-child
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B-child
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B-child
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-many (param $x eqref)
;; We should optimize a long sequence of static casts when we can. All six
;; orderings of these casts should collapse into the strictest one.
@@ -2293,13 +1591,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-very-many (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B-child
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-very-many (param $x eqref)
;; We should optimize an arbitrarily-long long sequence of static casts.
(drop
@@ -2343,18 +1634,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-fallthrough-remaining (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref null $B))
- ;; NOMNL-NEXT: (call $ref-cast-static-fallthrough-remaining
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (ref.cast null $B
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-fallthrough-remaining (param $x eqref)
(drop
(ref.cast null $A
@@ -2392,20 +1671,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-fallthrough-remaining-child (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null $B
- ;; NOMNL-NEXT: (block (result eqref)
- ;; NOMNL-NEXT: (call $ref-cast-static-fallthrough-remaining-child
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (ref.cast null $A
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-fallthrough-remaining-child (param $x eqref)
(drop
;; As above, but with $A and $B flipped. Now the inner cast is not needed.
@@ -2441,23 +1706,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-fallthrough-remaining-impossible (type $ref|eq|_=>_none) (param $x (ref eq))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $array))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref eq))
- ;; NOMNL-NEXT: (call $ref-cast-static-fallthrough-remaining-impossible
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (ref.cast $struct
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-fallthrough-remaining-impossible (param $x (ref eq))
(drop
;; As above, but with an impossible cast of an array to a struct. The
@@ -2496,26 +1744,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-fallthrough-remaining-nonnull (type $ref|eq|_=>_none) (param $x (ref eq))
- ;; NOMNL-NEXT: (local $1 (ref $B))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $B))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $B))
- ;; NOMNL-NEXT: (call $ref-cast-static-fallthrough-remaining
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (local.tee $1
- ;; NOMNL-NEXT: (ref.cast $B
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (local.get $1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-fallthrough-remaining-nonnull (param $x (ref eq))
;; The input is non-nullable here, and the middle block is of a simpler type
;; than either the parent or the child. This checks that we do not
@@ -2572,43 +1800,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-static-squared-impossible (type $eqref_=>_none) (param $x eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null none
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $array
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $array
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $array
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-static-squared-impossible (param $x eqref)
;; Impossible casts will trap unless the input is null. Only the first one
;; here, which lets a null get through, will not trap.
@@ -2659,23 +1850,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-test-static-same-type (type $ref?|$A|_ref|$A|_=>_none) (param $nullable (ref null $A)) (param $non-nullable (ref $A))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.eqz
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $nullable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $non-nullable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-test-static-same-type (param $nullable (ref null $A)) (param $non-nullable (ref $A))
;; A nullable value cannot be optimized here even though it is the same
;; type. But we can at least use !ref.is_null rather than ref.test.
@@ -2709,23 +1883,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-test-static-subtype (type $ref?|$B|_ref|$B|_=>_none) (param $nullable (ref null $B)) (param $non-nullable (ref $B))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.eqz
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $nullable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $non-nullable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 1)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-test-static-subtype (param $nullable (ref null $B)) (param $non-nullable (ref $B))
;; As above, but the input is a subtype, so the same things happen.
(drop
@@ -2752,18 +1909,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-test-static-supertype (type $ref?|$A|_ref|$A|_=>_none) (param $nullable (ref null $A)) (param $non-nullable (ref $A))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.test $B
- ;; NOMNL-NEXT: (local.get $nullable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.test $B
- ;; NOMNL-NEXT: (local.get $non-nullable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-test-static-supertype (param $nullable (ref null $A)) (param $non-nullable (ref $A))
;; As above, but the input is a supertype. We can't know at compile time
;; what to do here.
@@ -2797,24 +1942,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-test-static-impossible (type $ref?|$array|_ref|$array|_=>_none) (param $nullable (ref null $array)) (param $non-nullable (ref $array))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $nullable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $non-nullable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-test-static-impossible (param $nullable (ref null $array)) (param $non-nullable (ref $array))
;; Testing an impossible cast will definitely fail.
(drop
@@ -2847,24 +1974,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-boolean (type $eqref_eqref_=>_none) (param $x eqref) (param $y eqref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.eq
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: (local.get $y)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.test $A
- ;; NOMNL-NEXT: (local.get $x)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-boolean (param $x eqref) (param $y eqref)
;; ref.eq returns a boolean, so &1 on it is not needed.
(drop
@@ -2898,9 +2007,6 @@
;; CHECK: (func $impossible (type $none_=>_ref|none|) (result (ref none))
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
- ;; NOMNL: (func $impossible (type $none_=>_ref|none|) (result (ref none))
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
(func $impossible (result (ref none))
(unreachable)
)
@@ -2921,22 +2027,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
- ;; NOMNL: (func $bottom-type-accessors (type $ref|none|_nullref_=>_none) (param $bot (ref none)) (param $null nullref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: (block
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (call $impossible)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
(func $bottom-type-accessors (param $bot (ref none)) (param $null nullref)
(drop
(struct.get $A 0
@@ -2979,22 +2069,6 @@
;; CHECK-NEXT: (local.get $null-b)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-heap-type (type $ref?|$B|_ref|$B|_=>_none) (param $null-b (ref null $B)) (param $b (ref $B))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.as_non_null
- ;; NOMNL-NEXT: (local.get $null-b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $null-b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-heap-type (param $null-b (ref null $B)) (param $b (ref $B))
;; We are casting a heap type to a supertype, which always succeeds. However
;; we need to check for nullability.
@@ -3057,37 +2131,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $ref-cast-heap-type-incompatible (type $ref?|$B|_ref|$B|_=>_none) (param $null-b (ref null $B)) (param $b (ref $B))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $null-b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (block (result (ref $struct))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.get $b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast null none
- ;; NOMNL-NEXT: (local.get $null-b)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $ref-cast-heap-type-incompatible (param $null-b (ref null $B)) (param $b (ref $B))
;; As above, but replacing $A with $struct. Now we have two incompatible
;; types, $B and $struct, so the only possible way the cast succeeds is if
@@ -3119,9 +2162,6 @@
;; CHECK: (func $as_of_unreachable (type $none_=>_ref|$A|) (result (ref $A))
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
- ;; NOMNL: (func $as_of_unreachable (type $none_=>_ref|$A|) (result (ref $A))
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
(func $as_of_unreachable (result (ref $A))
;; The cast will definitely fail, so we can turn it into an unreachable. The
;; ref.as must then ignore the unreachable input and not error on trying to
@@ -3142,15 +2182,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $cast-internalized-extern (type $externref_=>_none) (param $externref externref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $A
- ;; NOMNL-NEXT: (extern.internalize
- ;; NOMNL-NEXT: (local.get $externref)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $cast-internalized-extern (param $externref externref)
;; We cannot optimize this cast, and in particular we should not treat the
;; externref as falling through to the cast and incorrectly inferring that
@@ -3178,20 +2209,6 @@
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $struct.set.null.fallthrough (type $void)
- ;; NOMNL-NEXT: (local $temp (ref null $struct))
- ;; NOMNL-NEXT: (block ;; (replaces something unreachable we can't emit)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $temp
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.const 100)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $struct.set.null.fallthrough
(local $temp (ref null $struct))
;; The value falling through the tee shows the struct.set will trap. We can
@@ -3224,23 +2241,6 @@
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $set.array.null (type $void)
- ;; NOMNL-NEXT: (local $temp (ref none))
- ;; NOMNL-NEXT: (block ;; (replaces something unreachable we can't emit)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $temp
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.const 2)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (i32.const 3)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $set.array.null
(local $temp (ref none))
@@ -3267,13 +2267,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $refinalize.select.arm (type $void)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $void2
- ;; NOMNL-NEXT: (ref.func $refinalize.select.arm)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $refinalize.select.arm (type $void)
;; Pick one of the two select sides using the condition. This changes the
;; type (the arms are more refined than the declared type), so we must
@@ -3296,13 +2289,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $refinalize.select.arm.flip (type $void)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $void2
- ;; NOMNL-NEXT: (ref.func $refinalize.select.arm)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $refinalize.select.arm.flip
;; Flipped of the above.
(drop
@@ -3323,13 +2309,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $refinalize.select.arm.unknown (type $i32_=>_none) (param $x i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.cast $void2
- ;; NOMNL-NEXT: (ref.func $refinalize.select.arm)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $refinalize.select.arm.unknown (param $x i32)
;; As above but use an unknown value at compile time for the condition.
(drop
@@ -3354,17 +2333,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
- ;; NOMNL: (func $non-null-bottom-ref (type $none_=>_ref|func|) (result (ref func))
- ;; NOMNL-NEXT: (local $0 funcref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (local.tee $0
- ;; NOMNL-NEXT: (loop (result (ref nofunc))
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
(func $non-null-bottom-ref (result (ref func))
(local $0 (ref null func))
;; The reference is uninhabitable, a non-null bottom type. The cast is not
@@ -3388,12 +2356,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
- ;; NOMNL: (func $non-null-bottom-cast (type $none_=>_ref|nofunc|) (result (ref nofunc))
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.func $non-null-bottom-cast)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
(func $non-null-bottom-cast (result (ref nofunc))
;; As above, but now the cast is uninhabitable.
(ref.cast nofunc
@@ -3413,18 +2375,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: )
;; CHECK-NEXT: )
- ;; NOMNL: (func $non-null-bottom-ref-test (type $none_=>_i32) (result i32)
- ;; NOMNL-NEXT: (local $0 funcref)
- ;; NOMNL-NEXT: (i32.eqz
- ;; NOMNL-NEXT: (ref.is_null
- ;; NOMNL-NEXT: (local.tee $0
- ;; NOMNL-NEXT: (loop (result (ref nofunc))
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
(func $non-null-bottom-ref-test (result i32)
(local $0 (ref null func))
;; As above, but ref.test instead of cast. This is ok - we can turn the test
@@ -3448,15 +2398,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (unreachable)
;; CHECK-NEXT: )
- ;; NOMNL: (func $non-null-bottom-ref-test-notee (type $none_=>_i32) (result i32)
- ;; NOMNL-NEXT: (local $0 funcref)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (loop
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (unreachable)
- ;; NOMNL-NEXT: )
(func $non-null-bottom-ref-test-notee (result i32)
(local $0 (ref null func))
;; As above, but without an intermediate local.tee. Now ref.test will see
@@ -3474,12 +2415,6 @@
;; CHECK-NEXT: )
;; CHECK-NEXT: (i32.const 0)
;; CHECK-NEXT: )
- ;; NOMNL: (func $non-null-bottom-test (type $none_=>_i32) (result i32)
- ;; NOMNL-NEXT: (drop
- ;; NOMNL-NEXT: (ref.func $non-null-bottom-cast)
- ;; NOMNL-NEXT: )
- ;; NOMNL-NEXT: (i32.const 0)
- ;; NOMNL-NEXT: )
(func $non-null-bottom-test (result i32)
;; As above, but now the cast type is uninhabitable, and also use ref.test.
;; This cast cannot succeed, so return 0.