1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S -passes=instcombine < %s | FileCheck %s
4 @c = global i32 0, align 4
5 @b = global i32 0, align 4
7 define void @masked_scatter1() {
8 ; CHECK-LABEL: define void @masked_scatter1() {
9 ; CHECK-NEXT: call void @llvm.masked.scatter.nxv4i32.nxv4p0(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x ptr> shufflevector (<vscale x 4 x ptr> insertelement (<vscale x 4 x ptr> poison, ptr @c, i64 0), <vscale x 4 x ptr> poison, <vscale x 4 x i32> zeroinitializer), i32 4, <vscale x 4 x i1> shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 ptrtoint (ptr @b to i1), i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer))
10 ; CHECK-NEXT: ret void
12 call void @llvm.masked.scatter.nxv4i32.nxv4p0(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x ptr> splat (ptr @c), i32 4, <vscale x 4 x i1> splat (i1 ptrtoint (ptr @b to i1)))
16 define void @masked_scatter2() {
17 ; CHECK-LABEL: define void @masked_scatter2() {
18 ; CHECK-NEXT: store i32 0, ptr @c, align 4
19 ; CHECK-NEXT: ret void
21 call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> zeroinitializer, <2 x ptr> splat (ptr @c), i32 4, <2 x i1> splat (i1 true))
25 define void @masked_scatter3() {
26 ; CHECK-LABEL: define void @masked_scatter3() {
27 ; CHECK-NEXT: store i32 0, ptr @c, align 4
28 ; CHECK-NEXT: ret void
30 call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> zeroinitializer, <2 x ptr> splat (ptr @c), i32 4, <2 x i1> undef)
34 define void @masked_scatter4() {
35 ; CHECK-LABEL: define void @masked_scatter4() {
36 ; CHECK-NEXT: ret void
38 call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> zeroinitializer, <2 x ptr> splat (ptr @c), i32 4, <2 x i1> splat (i1 false))
42 define void @masked_scatter5() {
43 ; CHECK-LABEL: define void @masked_scatter5() {
44 ; CHECK-NEXT: store i32 0, ptr @c, align 4
45 ; CHECK-NEXT: ret void
47 call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> zeroinitializer, <2 x ptr> splat (ptr @c), i32 4, <2 x i1> <i1 true, i1 false>)
51 define void @masked_scatter6() {
52 ; CHECK-LABEL: define void @masked_scatter6() {
53 ; CHECK-NEXT: store i32 0, ptr @c, align 4
54 ; CHECK-NEXT: ret void
56 call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> zeroinitializer, <2 x ptr> splat (ptr @c), i32 4, <2 x i1> <i1 undef, i1 false>)
60 define void @masked_scatter7() {
61 ; CHECK-LABEL: define void @masked_scatter7() {
62 ; CHECK-NEXT: call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> zeroinitializer, <2 x ptr> <ptr @c, ptr @c>, i32 4, <2 x i1> <i1 ptrtoint (ptr @b to i1), i1 ptrtoint (ptr @b to i1)>)
63 ; CHECK-NEXT: ret void
65 call void @llvm.masked.scatter.v2i32.v2p0(<2 x i32> zeroinitializer, <2 x ptr> splat (ptr @c), i32 4, <2 x i1> splat (i1 ptrtoint (ptr @b to i1)))