1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=instsimplify -S -o - %s | FileCheck %s
4 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
6 define <16 x i1> @v16i1_0() {
7 ; CHECK-LABEL: @v16i1_0(
9 ; CHECK-NEXT: ret <16 x i1> zeroinitializer
12 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 0, i32 0)
16 define <16 x i1> @v16i1_1() {
17 ; CHECK-LABEL: @v16i1_1(
19 ; CHECK-NEXT: ret <16 x i1> <i1 true, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false>
22 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 0, i32 1)
26 define <16 x i1> @v16i1_8() {
27 ; CHECK-LABEL: @v16i1_8(
29 ; CHECK-NEXT: ret <16 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false>
32 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 0, i32 8)
36 define <16 x i1> @v16i1_15() {
37 ; CHECK-LABEL: @v16i1_15(
39 ; CHECK-NEXT: ret <16 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 false>
42 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 0, i32 15)
46 define <16 x i1> @v16i1_16() {
47 ; CHECK-LABEL: @v16i1_16(
49 ; CHECK-NEXT: ret <16 x i1> splat (i1 true)
52 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 0, i32 16)
56 define <16 x i1> @v16i1_100() {
57 ; CHECK-LABEL: @v16i1_100(
59 ; CHECK-NEXT: ret <16 x i1> splat (i1 true)
62 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 0, i32 100)
66 define <16 x i1> @v16i1_m1() {
67 ; CHECK-LABEL: @v16i1_m1(
69 ; CHECK-NEXT: ret <16 x i1> splat (i1 true)
72 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 0, i32 -1)
76 define <16 x i1> @v16i1_10_11() {
77 ; CHECK-LABEL: @v16i1_10_11(
79 ; CHECK-NEXT: ret <16 x i1> <i1 true, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false>
82 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 10, i32 11)
86 define <16 x i1> @v16i1_12_11() {
87 ; CHECK-LABEL: @v16i1_12_11(
89 ; CHECK-NEXT: ret <16 x i1> zeroinitializer
92 %int = call <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32 12, i32 11)
98 define <8 x i1> @v8i1_0() {
99 ; CHECK-LABEL: @v8i1_0(
101 ; CHECK-NEXT: ret <8 x i1> zeroinitializer
104 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 0, i32 0)
108 define <8 x i1> @v8i1_1() {
109 ; CHECK-LABEL: @v8i1_1(
111 ; CHECK-NEXT: ret <8 x i1> <i1 true, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false>
114 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 0, i32 1)
118 define <8 x i1> @v8i1_4() {
119 ; CHECK-LABEL: @v8i1_4(
121 ; CHECK-NEXT: ret <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 false, i1 false, i1 false, i1 false>
124 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 0, i32 4)
128 define <8 x i1> @v8i1_7() {
129 ; CHECK-LABEL: @v8i1_7(
131 ; CHECK-NEXT: ret <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 false>
134 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 0, i32 7)
138 define <8 x i1> @v8i1_8() {
139 ; CHECK-LABEL: @v8i1_8(
141 ; CHECK-NEXT: ret <8 x i1> splat (i1 true)
144 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 0, i32 8)
148 define <8 x i1> @v8i1_100() {
149 ; CHECK-LABEL: @v8i1_100(
151 ; CHECK-NEXT: ret <8 x i1> splat (i1 true)
154 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 0, i32 100)
158 define <8 x i1> @v8i1_m1() {
159 ; CHECK-LABEL: @v8i1_m1(
161 ; CHECK-NEXT: ret <8 x i1> splat (i1 true)
164 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 0, i32 -1)
168 define <8 x i1> @v8i1_10_11() {
169 ; CHECK-LABEL: @v8i1_10_11(
171 ; CHECK-NEXT: ret <8 x i1> <i1 true, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 false>
174 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 10, i32 11)
178 define <8 x i1> @v8i1_12_11() {
179 ; CHECK-LABEL: @v8i1_12_11(
181 ; CHECK-NEXT: ret <8 x i1> zeroinitializer
184 %int = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32 12, i32 11)
190 define <4 x i1> @v4i1_0() {
191 ; CHECK-LABEL: @v4i1_0(
193 ; CHECK-NEXT: ret <4 x i1> zeroinitializer
196 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 0, i32 0)
200 define <4 x i1> @v4i1_1() {
201 ; CHECK-LABEL: @v4i1_1(
203 ; CHECK-NEXT: ret <4 x i1> <i1 true, i1 false, i1 false, i1 false>
206 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 0, i32 1)
210 define <4 x i1> @v4i1_3() {
211 ; CHECK-LABEL: @v4i1_3(
213 ; CHECK-NEXT: ret <4 x i1> <i1 true, i1 true, i1 true, i1 false>
216 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 0, i32 3)
220 define <4 x i1> @v4i1_4() {
221 ; CHECK-LABEL: @v4i1_4(
223 ; CHECK-NEXT: ret <4 x i1> splat (i1 true)
226 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 0, i32 4)
230 define <4 x i1> @v4i1_100() {
231 ; CHECK-LABEL: @v4i1_100(
233 ; CHECK-NEXT: ret <4 x i1> splat (i1 true)
236 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 0, i32 100)
240 define <4 x i1> @v4i1_m1() {
241 ; CHECK-LABEL: @v4i1_m1(
243 ; CHECK-NEXT: ret <4 x i1> splat (i1 true)
246 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 0, i32 -1)
250 define <4 x i1> @v4i1_10_11() {
251 ; CHECK-LABEL: @v4i1_10_11(
253 ; CHECK-NEXT: ret <4 x i1> <i1 true, i1 false, i1 false, i1 false>
256 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 10, i32 11)
260 define <4 x i1> @v4i1_12_11() {
261 ; CHECK-LABEL: @v4i1_12_11(
263 ; CHECK-NEXT: ret <4 x i1> zeroinitializer
266 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 12, i32 11)
272 define <4 x i1> @v4i1_nc1(i32 %x) {
273 ; CHECK-LABEL: @v4i1_nc1(
275 ; CHECK-NEXT: [[INT:%.*]] = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 [[X:%.*]], i32 11)
276 ; CHECK-NEXT: ret <4 x i1> [[INT]]
279 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %x, i32 11)
283 define <4 x i1> @v4i1_nc2(i32 %x) {
284 ; CHECK-LABEL: @v4i1_nc2(
286 ; CHECK-NEXT: [[INT:%.*]] = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 11, i32 [[X:%.*]])
287 ; CHECK-NEXT: ret <4 x i1> [[INT]]
290 %int = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 11, i32 %x)
295 define <4 x float> @poisonc(<4 x float> %a, i32 %n) {
296 ; CHECK-LABEL: @poisonc(
298 ; CHECK-NEXT: [[VAR27:%.*]] = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 poison, i32 1024)
299 ; CHECK-NEXT: [[VAR33:%.*]] = select <4 x i1> [[VAR27]], <4 x float> [[A:%.*]], <4 x float> zeroinitializer
300 ; CHECK-NEXT: ret <4 x float> [[VAR33]]
304 %last = zext i1 %new0 to i32
305 %var27 = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 %last, i32 1024)
306 %var33 = select <4 x i1> %var27, <4 x float> %a, <4 x float> zeroinitializer
307 ret <4 x float> %var33
310 declare <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32, i32)
311 declare <8 x i1> @llvm.get.active.lane.mask.v8i1.i32(i32, i32)
312 declare <16 x i1> @llvm.get.active.lane.mask.v16i1.i32(i32, i32)