Elad Cohen | ef5798a | 2017-05-03 12:28:54 +0000 | [diff] [blame^] | 1 | ; RUN: not opt -verify < %s 2>&1 | FileCheck %s |
| 2 | |
| 3 | ; Mask is not a vector |
| 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) |
| 7 | ret <16 x float> %res |
| 8 | } |
| 9 | declare <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! |
| 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) |
| 15 | ret <8 x float> %res |
| 16 | } |
| 17 | declare <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! |
| 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) |
| 23 | ret <8 x float>* %res |
| 24 | } |
| 25 | declare <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! |
| 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) |
| 31 | ret <8 x float> %res |
| 32 | } |
| 33 | declare <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! |
| 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) |
| 39 | ret <8 x float> %res |
| 40 | } |
| 41 | declare <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! |
| 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) |
| 47 | ret <8 x float> %res |
| 48 | } |
| 49 | declare <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! |
| 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) |
| 55 | ret <8 x float> %res |
| 56 | } |
| 57 | declare <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! |
| 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) |
| 63 | ret <16 x i32> %res |
| 64 | } |
| 65 | declare <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! |
| 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) |
| 71 | ret void |
| 72 | } |
| 73 | declare 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! |
| 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) |
| 79 | ret void |
| 80 | } |
| 81 | declare 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! |
| 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) |
| 87 | ret void |
| 88 | } |
| 89 | declare 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! |
| 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) |
| 95 | ret void |
| 96 | } |
| 97 | declare 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! |
| 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) |
| 103 | ret void |
| 104 | } |
| 105 | declare 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! |
| 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) |
| 111 | ret void |
| 112 | } |
| 113 | declare 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! |
| 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) |
| 119 | ret void |
| 120 | } |
| 121 | declare void @llvm.masked.scatter.v8f32.v16p0f32(<8 x float>, <16 x float*>, i32, <8 x i1>) |
| 122 | |