summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2023-01-10 11:14:48 -0800
committerGitHub <noreply@github.com>2023-01-10 19:14:48 +0000
commit574ee5338f0fb28eb45ddcd4c2ee54cb67a0ea21 (patch)
tree3e09fa713657c3189fdec944c7bfa03eeea8bee3 /test
parent82e3eff9742c92e13aef25035b40488f5339618d (diff)
downloadbinaryen-574ee5338f0fb28eb45ddcd4c2ee54cb67a0ea21.tar.gz
binaryen-574ee5338f0fb28eb45ddcd4c2ee54cb67a0ea21.tar.bz2
binaryen-574ee5338f0fb28eb45ddcd4c2ee54cb67a0ea21.zip
[Wasm GC] Optimize ref.as_non_null of a nullable cast (#5415)
Diffstat (limited to 'test')
-rw-r--r--test/lit/passes/optimize-instructions-gc-tnh.wast8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/lit/passes/optimize-instructions-gc-tnh.wast b/test/lit/passes/optimize-instructions-gc-tnh.wast
index 67f15de6c..948e03296 100644
--- a/test/lit/passes/optimize-instructions-gc-tnh.wast
+++ b/test/lit/passes/optimize-instructions-gc-tnh.wast
@@ -15,10 +15,8 @@
;; TNH-NEXT: )
;; NO_TNH: (func $ref.eq (type $eqref_eqref_=>_i32) (param $a eqref) (param $b eqref) (result i32)
;; NO_TNH-NEXT: (ref.eq
- ;; NO_TNH-NEXT: (ref.as_non_null
- ;; NO_TNH-NEXT: (ref.cast null $struct
- ;; NO_TNH-NEXT: (local.get $a)
- ;; NO_TNH-NEXT: )
+ ;; NO_TNH-NEXT: (ref.cast $struct
+ ;; NO_TNH-NEXT: (local.get $a)
;; NO_TNH-NEXT: )
;; NO_TNH-NEXT: (ref.as_data
;; NO_TNH-NEXT: (local.get $b)
@@ -29,6 +27,8 @@
;; When traps never happen we can remove all the casts here, since they do
;; not affect the comparison of the references.
(ref.eq
+ ;; When traps can happen we can still improve this by removing and
+ ;; combining redundant casts.
(ref.as_data
(ref.as_non_null
(ref.cast null $struct