1 ; RUN: not opt -passes=verify < %s 2>&1 | FileCheck %s
4 ; CHECK: Intrinsic has incorrect argument type!
5 define <16 x float> @gather2(<16 x ptr> %ptrs, ptr %mask, <16 x float> %passthru) {
6 %res = call <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr> %ptrs, i32 4, ptr %mask, <16 x float> %passthru)
9 declare <16 x float> @llvm.masked.gather.v16f32.v16p0(<16 x ptr>, i32, ptr, <16 x float>)
11 ; Mask length != return length
12 ; CHECK: Intrinsic has incorrect argument type!
13 define <8 x float> @gather3(<8 x ptr> %ptrs, <16 x i1> %mask, <8 x float> %passthru) {
14 %res = call <8 x float> @llvm.masked.gather.v8f32.v8p0(<8 x ptr> %ptrs, i32 4, <16 x i1> %mask, <8 x float> %passthru)
17 declare <8 x float> @llvm.masked.gather.v8f32.v8p0(<8 x ptr>, i32, <16 x i1>, <8 x float>)
19 ; Return type is not a vector
20 ; CHECK: Intrinsic has incorrect return type!
21 define ptr @gather4(<8 x ptr> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
22 %res = call ptr @llvm.masked.gather.p0.v8p0(<8 x ptr> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
25 declare ptr @llvm.masked.gather.p0.v8p0(<8 x ptr>, i32, <8 x i1>, <8 x float>)
27 ; Value type is not a vector
28 ; CHECK: Intrinsic has incorrect argument type!
29 define <8 x float> @gather5(ptr %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
30 %res = call <8 x float> @llvm.masked.gather.v8f32.p0(ptr %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
33 declare <8 x float> @llvm.masked.gather.v8f32.p0(ptr, i32, <8 x i1>, <8 x float>)
35 ; Value type is not a vector of pointers
36 ; CHECK: Intrinsic has incorrect argument type!
37 define <8 x float> @gather6(<8 x float> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
38 %res = call <8 x float> @llvm.masked.gather.v8f32.v8f32(<8 x float> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
41 declare <8 x float> @llvm.masked.gather.v8f32.v8f32(<8 x float>, i32, <8 x i1>, <8 x float>)
43 ; Value length!= vector of pointers length
44 ; CHECK: Intrinsic has incorrect argument type!
45 ; CHECK-NEXT: ptr @llvm.masked.gather.v8f32.v16p0
46 define <8 x float> @gather8(<16 x ptr> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
47 %res = call <8 x float> @llvm.masked.gather.v8f32.v16p0(<16 x ptr> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
50 declare <8 x float> @llvm.masked.gather.v8f32.v16p0(<16 x ptr>, i32, <8 x i1>, <8 x float>)
52 ; Passthru type doesn't match return type
53 ; CHECK: Intrinsic has incorrect argument type!
54 ; CHECK-NEXT: ptr @llvm.masked.gather.v16i32.v16p0
55 define <16 x i32> @gather9(<16 x ptr> %ptrs, <16 x i1> %mask, <8 x i32> %passthru) {
56 %res = call <16 x i32> @llvm.masked.gather.v16i32.v16p0(<16 x ptr> %ptrs, i32 4, <16 x i1> %mask, <8 x i32> %passthru)
59 declare <16 x i32> @llvm.masked.gather.v16i32.v16p0(<16 x ptr>, i32, <16 x i1>, <8 x i32>)
61 ; Mask is not a vector
62 ; CHECK: Intrinsic has incorrect argument type!
63 ; CHECK-NEXT: ptr @llvm.masked.scatter.v16f32.v16p0
64 define void @scatter2(<16 x float> %value, <16 x ptr> %ptrs, ptr %mask) {
65 call void @llvm.masked.scatter.v16f32.v16p0(<16 x float> %value, <16 x ptr> %ptrs, i32 4, ptr %mask)
68 declare void @llvm.masked.scatter.v16f32.v16p0(<16 x float>, <16 x ptr>, i32, ptr)
70 ; Mask length != value length
71 ; CHECK: Intrinsic has incorrect argument type!
72 ; CHECK-NEXT: ptr @llvm.masked.scatter.v8f32.v8p0
73 define void @scatter3(<8 x float> %value, <8 x ptr> %ptrs, <16 x i1> %mask) {
74 call void @llvm.masked.scatter.v8f32.v8p0(<8 x float> %value, <8 x ptr> %ptrs, i32 4, <16 x i1> %mask)
77 declare void @llvm.masked.scatter.v8f32.v8p0(<8 x float>, <8 x ptr>, i32, <16 x i1>)
79 ; Value type is not a vector
80 ; CHECK: Intrinsic has incorrect argument type!
81 ; CHECK-NEXT: ptr @llvm.masked.scatter.p0.v8p0
82 define void @scatter4(ptr %value, <8 x ptr> %ptrs, <8 x i1> %mask) {
83 call void @llvm.masked.scatter.p0.v8p0(ptr %value, <8 x ptr> %ptrs, i32 4, <8 x i1> %mask)
86 declare void @llvm.masked.scatter.p0.v8p0(ptr, <8 x ptr>, i32, <8 x i1>)
88 ; ptrs is not a vector
89 ; CHECK: Intrinsic has incorrect argument type!
90 ; CHECK-NEXT: ptr @llvm.masked.scatter.v8f32.p0
91 define void @scatter5(<8 x float> %value, ptr %ptrs, <8 x i1> %mask) {
92 call void @llvm.masked.scatter.v8f32.p0(<8 x float> %value, ptr %ptrs, i32 4, <8 x i1> %mask)
95 declare void @llvm.masked.scatter.v8f32.p0(<8 x float>, ptr, i32, <8 x i1>)
97 ; Value type is not a vector of pointers
98 ; CHECK: Intrinsic has incorrect argument type!
99 ; CHECK-NEXT: ptr @llvm.masked.scatter.v8f32.v8f32
100 define void @scatter6(<8 x float> %value, <8 x float> %ptrs, <8 x i1> %mask) {
101 call void @llvm.masked.scatter.v8f32.v8f32(<8 x float> %value, <8 x float> %ptrs, i32 4, <8 x i1> %mask)
104 declare void @llvm.masked.scatter.v8f32.v8f32(<8 x float>, <8 x float>, i32, <8 x i1>)
106 ; Value length!= vector of pointers length
107 ; CHECK: Intrinsic has incorrect argument type!
108 ; CHECK-NEXT: ptr @llvm.masked.scatter.v8f32.v16p0
109 define void @scatter8(<8 x float> %value, <16 x ptr> %ptrs, <8 x i1> %mask) {
110 call void @llvm.masked.scatter.v8f32.v16p0(<8 x float> %value, <16 x ptr> %ptrs, i32 4, <8 x i1> %mask)
113 declare void @llvm.masked.scatter.v8f32.v16p0(<8 x float>, <16 x ptr>, i32, <8 x i1>)