1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64--linux-gnu -mattr=+sve < %s | FileCheck %s
4 define void @dead_masked_store(<vscale x 4 x i32> %val, ptr %a, <vscale x 4 x i1> %mask) {
5 ; CHECK-LABEL: dead_masked_store:
7 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
9 call void @llvm.masked.store.nxv4i32(<vscale x 4 x i32> %val, ptr %a, i32 4, <vscale x 4 x i1> %mask)
10 call void @llvm.masked.store.nxv4i32(<vscale x 4 x i32> %val, ptr %a, i32 4, <vscale x 4 x i1> %mask)
14 define void @dead_masked_store_alltrue_same(<vscale x 4 x i32> %val, ptr %a, <vscale x 4 x i1> %mask) {
15 ; CHECK-LABEL: dead_masked_store_alltrue_same:
17 ; CHECK-NEXT: ptrue p0.s
18 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
20 %alltrue.ins = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
21 %alltrue = shufflevector <vscale x 4 x i1> %alltrue.ins, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
22 call void @llvm.masked.store.nxv4i32(<vscale x 4 x i32> %val, ptr %a, i32 4, <vscale x 4 x i1> %mask)
23 call void @llvm.masked.store.nxv4i32(<vscale x 4 x i32> %val, ptr %a, i32 4, <vscale x 4 x i1> %alltrue)
27 define void @dead_masked_store_alltrue_bigger(<vscale x 4 x i16> %val, <vscale x 4 x i32> %val1, ptr %a, <vscale x 4 x i1> %mask) {
28 ; CHECK-LABEL: dead_masked_store_alltrue_bigger:
30 ; CHECK-NEXT: ptrue p0.s
31 ; CHECK-NEXT: st1w { z1.s }, p0, [x0]
33 %alltrue.ins = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
34 %alltrue = shufflevector <vscale x 4 x i1> %alltrue.ins, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
35 call void @llvm.masked.store.nxv4i16(<vscale x 4 x i16> %val, ptr %a, i32 4, <vscale x 4 x i1> %mask)
36 call void @llvm.masked.store.nxv4i32(<vscale x 4 x i32> %val1, ptr %a, i32 4, <vscale x 4 x i1> %alltrue)
40 define void @dead_masked_store_alltrue_smaller(<vscale x 4 x i32> %val, <vscale x 4 x i16> %val1, ptr %a, <vscale x 4 x i1> %mask) {
41 ; CHECK-LABEL: dead_masked_store_alltrue_smaller:
43 ; CHECK-NEXT: ptrue p1.s
44 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
45 ; CHECK-NEXT: st1h { z1.s }, p1, [x0]
47 %alltrue.ins = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
48 %alltrue = shufflevector <vscale x 4 x i1> %alltrue.ins, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
49 call void @llvm.masked.store.nxv4i32(<vscale x 4 x i32> %val, ptr %a, i32 4, <vscale x 4 x i1> %mask)
50 call void @llvm.masked.store.nxv4i16(<vscale x 4 x i16> %val1, ptr %a, i32 4, <vscale x 4 x i1> %alltrue)
54 define void @dead_masked_store_same_mask_smaller_type(<vscale x 4 x i32> %val, <vscale x 4 x i16> %val1, ptr %a, <vscale x 4 x i1> %mask) {
55 ; CHECK-LABEL: dead_masked_store_same_mask_smaller_type:
57 ; CHECK-NEXT: st1w { z0.s }, p0, [x0]
58 ; CHECK-NEXT: st1h { z1.s }, p0, [x0]
60 call void @llvm.masked.store.nxv4i32(<vscale x 4 x i32> %val, ptr %a, i32 4, <vscale x 4 x i1> %mask)
61 call void @llvm.masked.store.nxv4i16(<vscale x 4 x i16> %val1, ptr %a, i32 4, <vscale x 4 x i1> %mask)
65 define void @dead_masked_store_same_mask_bigger_type(<vscale x 4 x i16> %val, <vscale x 4 x i32> %val1, ptr %a, <vscale x 4 x i1> %mask) {
66 ; CHECK-LABEL: dead_masked_store_same_mask_bigger_type:
68 ; CHECK-NEXT: st1h { z0.s }, p0, [x0]
69 ; CHECK-NEXT: st1w { z1.s }, p0, [x0]
71 call void @llvm.masked.store.nxv4i16(<vscale x 4 x i16> %val, ptr %a, i32 4, <vscale x 4 x i1> %mask)
72 call void @llvm.masked.store.nxv4i32(<vscale x 4 x i32> %val1, ptr %a, i32 4, <vscale x 4 x i1> %mask)
76 declare void @llvm.masked.store.nxv4i16(<vscale x 4 x i16>, ptr, i32, <vscale x 4 x i1>)
77 declare void @llvm.masked.store.nxv4i32(<vscale x 4 x i32>, ptr, i32, <vscale x 4 x i1>)