1 ; RUN: opt -mtriple=aarch64-linux-gnu -mattr=+sve -passes=scalarize-masked-mem-intrin -S < %s | FileCheck %s
3 ; Testing that masked scatters operating on scalable vectors that are
4 ; packed in SVE registers are not scalarized.
6 ; CHECK-LABEL: @masked_scatter_nxv4i32(
7 ; CHECK: call void @llvm.masked.scatter.nxv4i32
8 define void @masked_scatter_nxv4i32(<vscale x 4 x i32> %data, <vscale x 4 x ptr> %ptrs, <vscale x 4 x i1> %masks) {
9 call void @llvm.masked.scatter.nxv4i32(<vscale x 4 x i32> %data, <vscale x 4 x ptr> %ptrs, i32 0, <vscale x 4 x i1> %masks)
13 ; Testing that masked scatters operating on scalable vectors of FP
14 ; data that is packed in SVE registers are not scalarized.
16 ; CHECK-LABEL: @masked_scatter_nxv2f64(
17 ; CHECK: call void @llvm.masked.scatter.nxv2f64
18 define void @masked_scatter_nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) {
19 call void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
23 ; Testing that masked scatters operating on scalable vectors of FP
24 ; data that is unpacked in SVE registers are not scalarized.
26 ; CHECK-LABEL: @masked_scatter_nxv2f16(
27 ; CHECK: call void @llvm.masked.scatter.nxv2f16
28 define void @masked_scatter_nxv2f16(<vscale x 2 x half> %data, <vscale x 2 x ptr> %ptrs, <vscale x 2 x i1> %masks) {
29 call void @llvm.masked.scatter.nxv2f16(<vscale x 2 x half> %data, <vscale x 2 x ptr> %ptrs, i32 0, <vscale x 2 x i1> %masks)
33 ; Testing that masked scatters operating on 64-bit fixed vectors are
34 ; scalarized because NEON doesn't have support for masked scatter
37 ; CHECK-LABEL: @masked_scatter_v2f32(
38 ; CHECK-NOT: @llvm.masked.scatter.v2f32(
39 define void @masked_scatter_v2f32(<2 x float> %data, <2 x ptr> %ptrs, <2 x i1> %masks) {
40 call void @llvm.masked.scatter.v2f32(<2 x float> %data, <2 x ptr> %ptrs, i32 0, <2 x i1> %masks)
44 ; Testing that masked scatters operating on 128-bit fixed vectors are
45 ; scalarized because NEON doesn't have support for masked scatter
46 ; instructions and because we are not targeting fixed width SVE.
48 ; CHECK-LABEL: @masked_scatter_v4i32(
49 ; CHECK-NOT: @llvm.masked.scatter.v4i32(
50 define void @masked_scatter_v4i32(<4 x i32> %data, <4 x ptr> %ptrs, <4 x i1> %masks) {
51 call void @llvm.masked.scatter.v4i32(<4 x i32> %data, <4 x ptr> %ptrs, i32 0, <4 x i1> %masks)
55 declare void @llvm.masked.scatter.nxv4i32(<vscale x 4 x i32> %data, <vscale x 4 x ptr> %ptrs, i32 %align, <vscale x 4 x i1> %masks)
56 declare void @llvm.masked.scatter.nxv2f64(<vscale x 2 x double> %data, <vscale x 2 x ptr> %ptrs, i32 %align, <vscale x 2 x i1> %masks)
57 declare void @llvm.masked.scatter.nxv2f16(<vscale x 2 x half> %data, <vscale x 2 x ptr> %ptrs, i32 %align, <vscale x 2 x i1> %masks)
58 declare void @llvm.masked.scatter.v2f32(<2 x float> %data, <2 x ptr> %ptrs, i32 %align, <2 x i1> %masks)
59 declare void @llvm.masked.scatter.v4i32(<4 x i32> %data, <4 x ptr> %ptrs, i32 %align, <4 x i1> %masks)