1; RUN: not opt -verify < %s 2>&1 | FileCheck %s 2 3; Mask is not a vector 4; CHECK: Intrinsic has incorrect argument type! 5define <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) 7 ret <16 x float> %res 8} 9declare <16 x float> @llvm.masked.gather.v16f32.v16p0f32(<16 x float*>, i32, <16 x i1>*, <16 x float>) 10 11; Mask length != return length 12; CHECK: Intrinsic has incorrect argument type! 13define <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) 15 ret <8 x float> %res 16} 17declare <8 x float> @llvm.masked.gather.v8f32.v8p0f32(<8 x float*>, i32, <16 x i1>, <8 x float>) 18 19; Return type is not a vector 20; CHECK: Intrinsic has incorrect return type! 21define <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) 23 ret <8 x float>* %res 24} 25declare <8 x float>* @llvm.masked.gather.p0v8f32.v8p0f32(<8 x float*>, i32, <8 x i1>, <8 x float>) 26 27; Value type is not a vector 28; CHECK: Intrinsic has incorrect argument type! 29define <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) 31 ret <8 x float> %res 32} 33declare <8 x float> @llvm.masked.gather.v8f32.p0v8p0f32(<8 x float*>*, i32, <8 x i1>, <8 x float>) 34 35; Value type is not a vector of pointers 36; CHECK: Intrinsic has incorrect argument type! 37define <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) 39 ret <8 x float> %res 40} 41declare <8 x float> @llvm.masked.gather.v8f32.v8f32(<8 x float>, i32, <8 x i1>, <8 x float>) 42 43; Value element type != vector of pointers element 44; CHECK: Intrinsic has incorrect argument type! 45define <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) 47 ret <8 x float> %res 48} 49declare <8 x float> @llvm.masked.gather.v8f32.v8p0f64(<8 x double*>, i32, <8 x i1>, <8 x float>) 50 51; Value length!= vector of pointers length 52; CHECK: Intrinsic has incorrect argument type! 53define <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) 55 ret <8 x float> %res 56} 57declare <8 x float> @llvm.masked.gather.v8f32.v16p0f32(<16 x float*>, i32, <8 x i1>, <8 x float>) 58 59; Passthru type doesn't match return type 60; CHECK: Intrinsic has incorrect argument type! 61define <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) 63 ret <16 x i32> %res 64} 65declare <16 x i32> @llvm.masked.gather.v16i32.v16p0i32(<16 x i32*>, i32, <16 x i1>, <8 x i32>) 66 67; Mask is not a vector 68; CHECK: Intrinsic has incorrect argument type! 69define 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) 71 ret void 72} 73declare void @llvm.masked.scatter.v16f32.v16p0f32(<16 x float>, <16 x float*>, i32, <16 x i1>*) 74 75; Mask length != value length 76; CHECK: Intrinsic has incorrect argument type! 77define 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) 79 ret void 80} 81declare void @llvm.masked.scatter.v8f32.v8p0f32(<8 x float>, <8 x float*>, i32, <16 x i1>) 82 83; Value type is not a vector 84; CHECK: Intrinsic has incorrect argument type! 85define 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) 87 ret void 88} 89declare void @llvm.masked.scatter.p0v8f32.v8p0f32(<8 x float>*, <8 x float*>, i32, <8 x i1>) 90 91; ptrs is not a vector 92; CHECK: Intrinsic has incorrect argument type! 93define 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) 95 ret void 96} 97declare void @llvm.masked.scatter.v8f32.p0v8p0f32(<8 x float>, <8 x float*>*, i32, <8 x i1>) 98 99; Value type is not a vector of pointers 100; CHECK: Intrinsic has incorrect argument type! 101define 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) 103 ret void 104} 105declare void @llvm.masked.scatter.v8f32.v8f32(<8 x float>, <8 x float>, i32, <8 x i1>) 106 107; Value element type != vector of pointers element 108; CHECK: Intrinsic has incorrect argument type! 109define 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) 111 ret void 112} 113declare void @llvm.masked.scatter.v8f32.v8p0f64(<8 x float>, <8 x double*>, i32, <8 x i1>) 114 115; Value length!= vector of pointers length 116; CHECK: Intrinsic has incorrect argument type! 117define 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) 119 ret void 120} 121declare void @llvm.masked.scatter.v8f32.v16p0f32(<8 x float>, <16 x float*>, i32, <8 x i1>) 122 123