1 ; RUN: not opt -verify < %s 2>&1 | FileCheck %s
4 ; CHECK: Intrinsic has incorrect argument type!
5 define <16 x float> @gather2(<16 x float*> %ptrs, <16 x i1>* %mask, <16 x float> %passthru) {
6 %res = call <16 x float> @llvm.masked.gather.v16f32.v16p0f32(<16 x float*> %ptrs, i32 4, <16 x i1>* %mask, <16 x float> %passthru)
9 declare <16 x float> @llvm.masked.gather.v16f32.v16p0f32(<16 x float*>, i32, <16 x i1>*, <16 x float>)
11 ; Mask length != return length
12 ; CHECK: Intrinsic has incorrect argument type!
13 define <8 x float> @gather3(<8 x float*> %ptrs, <16 x i1> %mask, <8 x float> %passthru) {
14 %res = call <8 x float> @llvm.masked.gather.v8f32.v8p0f32(<8 x float*> %ptrs, i32 4, <16 x i1> %mask, <8 x float> %passthru)
17 declare <8 x float> @llvm.masked.gather.v8f32.v8p0f32(<8 x float*>, i32, <16 x i1>, <8 x float>)
19 ; Return type is not a vector
20 ; CHECK: Intrinsic has incorrect return type!
21 define <8 x float>* @gather4(<8 x float*> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
22 %res = call <8 x float>* @llvm.masked.gather.p0v8f32.v8p0f32(<8 x float*> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
25 declare <8 x float>* @llvm.masked.gather.p0v8f32.v8p0f32(<8 x float*>, 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(<8 x float*>* %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
30 %res = call <8 x float> @llvm.masked.gather.v8f32.p0v8p0f32(<8 x float*>* %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
33 declare <8 x float> @llvm.masked.gather.v8f32.p0v8p0f32(<8 x float*>*, 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 element type != vector of pointers element
44 ; CHECK: Intrinsic has incorrect argument type!
45 define <8 x float> @gather7(<8 x double*> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
46 %res = call <8 x float> @llvm.masked.gather.v8f32.v8p0f64(<8 x double*> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
49 declare <8 x float> @llvm.masked.gather.v8f32.v8p0f64(<8 x double*>, i32, <8 x i1>, <8 x float>)
51 ; Value length!= vector of pointers length
52 ; CHECK: Intrinsic has incorrect argument type!
53 define <8 x float> @gather8(<16 x float*> %ptrs, <8 x i1> %mask, <8 x float> %passthru) {
54 %res = call <8 x float> @llvm.masked.gather.v8f32.v16p0f32(<16 x float*> %ptrs, i32 4, <8 x i1> %mask, <8 x float> %passthru)
57 declare <8 x float> @llvm.masked.gather.v8f32.v16p0f32(<16 x float*>, i32, <8 x i1>, <8 x float>)
59 ; Passthru type doesn't match return type
60 ; CHECK: Intrinsic has incorrect argument type!
61 define <16 x i32> @gather9(<16 x i32*> %ptrs, <16 x i1> %mask, <8 x i32> %passthru) {
62 %res = call <16 x i32> @llvm.masked.gather.v16i32.v16p0i32(<16 x i32*> %ptrs, i32 4, <16 x i1> %mask, <8 x i32> %passthru)
65 declare <16 x i32> @llvm.masked.gather.v16i32.v16p0i32(<16 x i32*>, i32, <16 x i1>, <8 x i32>)
67 ; Mask is not a vector
68 ; CHECK: Intrinsic has incorrect argument type!
69 define void @scatter2(<16 x float> %value, <16 x float*> %ptrs, <16 x i1>* %mask) {
70 call void @llvm.masked.scatter.v16f32.v16p0f32(<16 x float> %value, <16 x float*> %ptrs, i32 4, <16 x i1>* %mask)
73 declare void @llvm.masked.scatter.v16f32.v16p0f32(<16 x float>, <16 x float*>, i32, <16 x i1>*)
75 ; Mask length != value length
76 ; CHECK: Intrinsic has incorrect argument type!
77 define void @scatter3(<8 x float> %value, <8 x float*> %ptrs, <16 x i1> %mask) {
78 call void @llvm.masked.scatter.v8f32.v8p0f32(<8 x float> %value, <8 x float*> %ptrs, i32 4, <16 x i1> %mask)
81 declare void @llvm.masked.scatter.v8f32.v8p0f32(<8 x float>, <8 x float*>, i32, <16 x i1>)
83 ; Value type is not a vector
84 ; CHECK: Intrinsic has incorrect argument type!
85 define void @scatter4(<8 x float>* %value, <8 x float*> %ptrs, <8 x i1> %mask) {
86 call void @llvm.masked.scatter.p0v8f32.v8p0f32(<8 x float>* %value, <8 x float*> %ptrs, i32 4, <8 x i1> %mask)
89 declare void @llvm.masked.scatter.p0v8f32.v8p0f32(<8 x float>*, <8 x float*>, i32, <8 x i1>)
91 ; ptrs is not a vector
92 ; CHECK: Intrinsic has incorrect argument type!
93 define void @scatter5(<8 x float> %value, <8 x float*>* %ptrs, <8 x i1> %mask) {
94 call void @llvm.masked.scatter.v8f32.p0v8p0f32(<8 x float> %value, <8 x float*>* %ptrs, i32 4, <8 x i1> %mask)
97 declare void @llvm.masked.scatter.v8f32.p0v8p0f32(<8 x float>, <8 x float*>*, i32, <8 x i1>)
99 ; Value type is not a vector of pointers
100 ; CHECK: Intrinsic has incorrect argument type!
101 define void @scatter6(<8 x float> %value, <8 x float> %ptrs, <8 x i1> %mask) {
102 call void @llvm.masked.scatter.v8f32.v8f32(<8 x float> %value, <8 x float> %ptrs, i32 4, <8 x i1> %mask)
105 declare void @llvm.masked.scatter.v8f32.v8f32(<8 x float>, <8 x float>, i32, <8 x i1>)
107 ; Value element type != vector of pointers element
108 ; CHECK: Intrinsic has incorrect argument type!
109 define void @scatter7(<8 x float> %value, <8 x double*> %ptrs, <8 x i1> %mask) {
110 call void @llvm.masked.scatter.v8f32.v8p0f64(<8 x float> %value, <8 x double*> %ptrs, i32 4, <8 x i1> %mask)
113 declare void @llvm.masked.scatter.v8f32.v8p0f64(<8 x float>, <8 x double*>, i32, <8 x i1>)
115 ; Value length!= vector of pointers length
116 ; CHECK: Intrinsic has incorrect argument type!
117 define void @scatter8(<8 x float> %value, <16 x float*> %ptrs, <8 x i1> %mask) {
118 call void @llvm.masked.scatter.v8f32.v16p0f32(<8 x float> %value, <16 x float*> %ptrs, i32 4, <8 x i1> %mask)
121 declare void @llvm.masked.scatter.v8f32.v16p0f32(<8 x float>, <16 x float*>, i32, <8 x i1>)