From 04d451f3aadaf4d364e001fa9a849ef57a100a9e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 5 Apr 2023 12:53:50 -0700 Subject: RemoveUnusedModuleElements: Add SIMD support for memory operations (#5632) Fixes #5629 --- ...remove-unused-module-elements_all-features.wast | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'test') diff --git a/test/lit/passes/remove-unused-module-elements_all-features.wast b/test/lit/passes/remove-unused-module-elements_all-features.wast index d5c394e30..c8b4a57df 100644 --- a/test/lit/passes/remove-unused-module-elements_all-features.wast +++ b/test/lit/passes/remove-unused-module-elements_all-features.wast @@ -722,3 +722,42 @@ ) ) ) +;; SIMD operations can keep memories alive +(module + ;; CHECK: (type $none_=>_none (func)) + + ;; CHECK: (memory $A 1 1) + (memory $A 1 1) + ;; CHECK: (memory $B 1 1) + (memory $B 1 1) + (memory $C-unused 1 1) + + (func "func" + (drop + (v128.load64_splat $A + (i32.const 0) + ) + ) + (drop + (v128.load16_lane $B 0 + (i32.const 0) + (v128.const i32x4 0 0 0 0) + ) + ) + ) +) +;; CHECK: (export "func" (func $0)) + +;; CHECK: (func $0 (type $none_=>_none) +;; CHECK-NEXT: (drop +;; CHECK-NEXT: (v128.load64_splat $A +;; CHECK-NEXT: (i32.const 0) +;; CHECK-NEXT: ) +;; CHECK-NEXT: ) +;; CHECK-NEXT: (drop +;; CHECK-NEXT: (v128.load16_lane $B 0 +;; CHECK-NEXT: (i32.const 0) +;; CHECK-NEXT: (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000) +;; CHECK-NEXT: ) +;; CHECK-NEXT: ) +;; CHECK-NEXT: ) -- cgit v1.2.3