3 ; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize -force-vector-interleave=1 -force-vector-width=4 -prefer-inloop-reductions -enable-interleaved-mem-accesses=true -enable-masked-interleaved-mem-accesses -force-widen-divrem-via-safe-divisor=0 -disable-output %s 2>&1 | FileCheck %s
5 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
7 ; Tests for printing VPlans.
9 define void @print_call_and_memory(i64 %n, ptr noalias %y, ptr noalias %x) nounwind uwtable {
10 ; CHECK-LABEL: Checking a loop in 'print_call_and_memory'
11 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
12 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
13 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
14 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
16 ; CHECK-NEXT: vector.ph:
17 ; CHECK-NEXT: Successor(s): vector loop
19 ; CHECK-NEXT: <x1> vector loop: {
20 ; CHECK-NEXT: vector.body:
21 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
22 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
23 ; CHECK-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%y>, vp<[[STEPS]]>
24 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%arrayidx>
25 ; CHECK-NEXT: WIDEN ir<%lv> = load vp<[[VEC_PTR]]>
26 ; CHECK-NEXT: WIDEN-INTRINSIC ir<%call> = call llvm.sqrt(ir<%lv>)
27 ; CHECK-NEXT: CLONE ir<%arrayidx2> = getelementptr inbounds ir<%x>, vp<[[STEPS]]>
28 ; CHECK-NEXT: vp<[[VEC_PTR2:%.+]]> = vector-pointer ir<%arrayidx2>
29 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR2]]>, ir<%call>
30 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
31 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
32 ; CHECK-NEXT: No successors
34 ; CHECK-NEXT: Successor(s): middle.block
36 ; CHECK-NEXT: middle.block:
37 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
38 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
39 ; CHECK-NEXT: Successor(s): ir-bb<for.end.loopexit>, scalar.ph
41 ; CHECK-NEXT: ir-bb<for.end.loopexit>
42 ; CHECK-NEXT: No successors
44 ; CHECK-NEXT: scalar.ph
45 ; CHECK-NEXT: Successor(s): ir-bb<for.body>
47 ; CHECK-NEXT: ir-bb<for.body>:
48 ; CHECK-NEXT: IR %iv = phi i64 [ %iv.next, %for.body ], [ 0, %for.body.preheader ]
49 ; CHECK: IR %exitcond = icmp eq i64 %iv.next, %n
50 ; CHECK-NEXT: No successors
54 %cmp6 = icmp sgt i64 %n, 0
55 br i1 %cmp6, label %for.body, label %for.end
57 for.body: ; preds = %entry, %for.body
58 %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ]
59 %arrayidx = getelementptr inbounds float, ptr %y, i64 %iv
60 %lv = load float, ptr %arrayidx, align 4
61 %call = tail call float @llvm.sqrt.f32(float %lv) nounwind readnone
62 %arrayidx2 = getelementptr inbounds float, ptr %x, i64 %iv
63 store float %call, ptr %arrayidx2, align 4
64 %iv.next = add i64 %iv, 1
65 %exitcond = icmp eq i64 %iv.next, %n
66 br i1 %exitcond, label %for.end, label %for.body
68 for.end: ; preds = %for.body, %entry
72 define void @print_widen_gep_and_select(i64 %n, ptr noalias %y, ptr noalias %x, ptr %z) nounwind uwtable {
73 ; CHECK-LABEL: Checking a loop in 'print_widen_gep_and_select'
74 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
75 ; CHECK-NEXT: Live-in vp<[[VF:%.]]> = VF
76 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
77 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
78 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
80 ; CHECK-NEXT: vector.ph:
81 ; CHECK-NEXT: Successor(s): vector loop
83 ; CHECK-NEXT: <x1> vector loop: {
84 ; CHECK-NEXT: vector.body:
85 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
86 ; CHECK-NEXT: WIDEN-INDUCTION %iv = phi %iv.next, 0, ir<1>, vp<[[VF]]
87 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
88 ; CHECK-NEXT: WIDEN-GEP Inv[Var] ir<%arrayidx> = getelementptr inbounds ir<%y>, ir<%iv>
89 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%arrayidx>
90 ; CHECK-NEXT: WIDEN ir<%lv> = load vp<[[VEC_PTR]]>
91 ; CHECK-NEXT: WIDEN ir<%cmp> = icmp eq ir<%arrayidx>, ir<%z>
92 ; CHECK-NEXT: WIDEN-SELECT ir<%sel> = select ir<%cmp>, ir<1.000000e+01>, ir<2.000000e+01>
93 ; CHECK-NEXT: WIDEN ir<%add> = fadd ir<%lv>, ir<%sel>
94 ; CHECK-NEXT: CLONE ir<%arrayidx2> = getelementptr inbounds ir<%x>, vp<[[STEPS]]>
95 ; CHECK-NEXT: vp<[[VEC_PTR2:%.+]]> = vector-pointer ir<%arrayidx2>
96 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR2]]>, ir<%add>
97 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
98 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
99 ; CHECK-NEXT: No successors
101 ; CHECK-NEXT: Successor(s): middle.block
103 ; CHECK-NEXT: middle.block:
104 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
105 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
106 ; CHECK-NEXT: Successor(s): ir-bb<for.end.loopexit>, scalar.ph
108 ; CHECK-NEXT: ir-bb<for.end.loopexit>
109 ; CHECK-NEXT: No successors
111 ; CHECK-NEXT: scalar.ph
112 ; CHECK-NEXT: Successor(s): ir-bb<for.body>
114 ; CHECK-NEXT: ir-bb<for.body>:
115 ; CHECK-NEXT: IR %iv = phi i64 [ %iv.next, %for.body ], [ 0, %for.body.preheader ]
116 ; CHECK: IR %exitcond = icmp eq i64 %iv.next, %n
117 ; CHECK-NEXT: No successors
121 %cmp6 = icmp sgt i64 %n, 0
122 br i1 %cmp6, label %for.body, label %for.end
124 for.body: ; preds = %entry, %for.body
125 %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ]
126 %arrayidx = getelementptr inbounds float, ptr %y, i64 %iv
127 %lv = load float, ptr %arrayidx, align 4
128 %cmp = icmp eq ptr %arrayidx, %z
129 %sel = select i1 %cmp, float 10.0, float 20.0
130 %add = fadd float %lv, %sel
131 %arrayidx2 = getelementptr inbounds float, ptr %x, i64 %iv
132 store float %add, ptr %arrayidx2, align 4
133 %iv.next = add i64 %iv, 1
134 %exitcond = icmp eq i64 %iv.next, %n
135 br i1 %exitcond, label %for.end, label %for.body
137 for.end: ; preds = %for.body, %entry
141 define float @print_reduction(i64 %n, ptr noalias %y) {
142 ; CHECK-LABEL: Checking a loop in 'print_reduction'
143 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
144 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
145 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
146 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
148 ; CHECK-NEXT: vector.ph:
149 ; CHECK-NEXT: Successor(s): vector loop
151 ; CHECK-NEXT: <x1> vector loop: {
152 ; CHECK-NEXT: vector.body:
153 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
154 ; CHECK-NEXT: WIDEN-REDUCTION-PHI ir<%red> = phi ir<0.000000e+00>, ir<%red.next>
155 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
156 ; CHECK-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%y>, vp<[[STEPS]]>
157 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%arrayidx>
158 ; CHECK-NEXT: WIDEN ir<%lv> = load vp<[[VEC_PTR]]>
159 ; CHECK-NEXT: REDUCE ir<%red.next> = ir<%red> + fast reduce.fadd (ir<%lv>)
160 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
161 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
162 ; CHECK-NEXT: No successors
164 ; CHECK-NEXT: Successor(s): middle.block
166 ; CHECK-NEXT: middle.block:
167 ; CHECK-NEXT: EMIT vp<[[RED_RES:%.+]]> = compute-reduction-result ir<%red>, ir<%red.next>
168 ; CHECK-NEXT: EMIT vp<[[RED_EX:%.+]]> = extract-from-end vp<[[RED_RES]]>, ir<1>
169 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
170 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
171 ; CHECK-NEXT: Successor(s): ir-bb<for.end>, scalar.ph
173 ; CHECK-NEXT: ir-bb<for.end>
174 ; CHECK-NEXT: IR %red.next.lcssa = phi float [ %red.next, %for.body ] (extra operand: vp<[[RED_EX]]> from middle.block)
175 ; CHECK-NEXT: No successors
177 ; CHECK-NEXT: scalar.ph
178 ; CHECK-NEXT: EMIT vp<[[RED_RESUME:%.+]]> = resume-phi vp<[[RED_RES]]>, ir<0.000000e+00>
179 ; CHECK-NEXT: Successor(s): ir-bb<for.body>
181 ; CHECK-NEXT: ir-bb<for.body>:
182 ; CHECK-NEXT: IR %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ]
183 ; CHECK: IR %exitcond = icmp eq i64 %iv.next, %n
184 ; CHECK-NEXT: No successors
190 for.body: ; preds = %entry, %for.body
191 %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ]
192 %red = phi float [ %red.next, %for.body ], [ 0.0, %entry ]
193 %arrayidx = getelementptr inbounds float, ptr %y, i64 %iv
194 %lv = load float, ptr %arrayidx, align 4
195 %red.next = fadd fast float %lv, %red
196 %iv.next = add i64 %iv, 1
197 %exitcond = icmp eq i64 %iv.next, %n
198 br i1 %exitcond, label %for.end, label %for.body
200 for.end: ; preds = %for.body, %entry
204 define void @print_reduction_with_invariant_store(i64 %n, ptr noalias %y, ptr noalias %dst) {
205 ; CHECK-LABEL: Checking a loop in 'print_reduction_with_invariant_store'
206 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
207 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
208 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
209 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
211 ; CHECK-NEXT: vector.ph:
212 ; CHECK-NEXT: Successor(s): vector loop
214 ; CHECK-NEXT: <x1> vector loop: {
215 ; CHECK-NEXT: vector.body:
216 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
217 ; CHECK-NEXT: WIDEN-REDUCTION-PHI ir<%red> = phi ir<0.000000e+00>, ir<%red.next>
218 ; CHECK-NEXT: vp<[[IV:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
219 ; CHECK-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%y>, vp<[[IV]]>
220 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%arrayidx>
221 ; CHECK-NEXT: WIDEN ir<%lv> = load vp<[[VEC_PTR]]>
222 ; CHECK-NEXT: REDUCE ir<%red.next> = ir<%red> + fast reduce.fadd (ir<%lv>) (with final reduction value stored in invariant address sank outside of loop)
223 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
224 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
225 ; CHECK-NEXT: No successors
227 ; CHECK-NEXT: Successor(s): middle.block
229 ; CHECK-NEXT: middle.block:
230 ; CHECK-NEXT: EMIT vp<[[RED_RES:.+]]> = compute-reduction-result ir<%red>, ir<%red.next>
231 ; CHECK-NEXT: CLONE store vp<[[RED_RES]]>, ir<%dst>
232 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
233 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
234 ; CHECK-NEXT: Successor(s): ir-bb<for.end>, scalar.ph
236 ; CHECK-NEXT: ir-bb<for.end>
237 ; CHECK-NEXT: No successors
239 ; CHECK-NEXT: scalar.ph
240 ; CHECK-NEXT: EMIT vp<[[RED_RESUME:%.+]]> = resume-phi vp<[[RED_RES]]>, ir<0.000000e+00>
241 ; CHECK-NEXT: Successor(s): ir-bb<for.body>
243 ; CHECK-NEXT: ir-bb<for.body>:
244 ; CHECK-NEXT: IR %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ]
245 ; CHECK-NEXT: IR %red = phi float [ %red.next, %for.body ], [ 0.000000e+00, %entry ]
246 ; CHECK: IR %exitcond = icmp eq i64 %iv.next, %n
247 ; CHECK-NEXT: No successors
253 for.body: ; preds = %entry, %for.body
254 %iv = phi i64 [ %iv.next, %for.body ], [ 0, %entry ]
255 %red = phi float [ %red.next, %for.body ], [ 0.0, %entry ]
256 %arrayidx = getelementptr inbounds float, ptr %y, i64 %iv
257 %lv = load float, ptr %arrayidx, align 4
258 %red.next = fadd fast float %lv, %red
259 store float %red.next, ptr %dst, align 4
260 %iv.next = add i64 %iv, 1
261 %exitcond = icmp eq i64 %iv.next, %n
262 br i1 %exitcond, label %for.end, label %for.body
264 for.end: ; preds = %for.body, %entry
268 define void @print_replicate_predicated_phi(i64 %n, ptr %x) {
269 ; CHECK-LABEL: Checking a loop in 'print_replicate_predicated_phi'
270 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
271 ; CHECK-NEXT: Live-in vp<[[VF:%.]]> = VF
272 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
273 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
274 ; CHECK-NEXT: vp<[[TC:%.+]]> = original trip-count
276 ; CHECK-NEXT: ir-bb<entry>:
277 ; CHECK-NEXT: EMIT vp<[[TC]]> = EXPAND SCEV (1 smax %n)
278 ; CHECK-NEXT: No successors
280 ; CHECK-NEXT: vector.ph:
281 ; CHECK-NEXT: Successor(s): vector loop
283 ; CHECK-NEXT: <x1> vector loop: {
284 ; CHECK-NEXT: vector.body:
285 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
286 ; CHECK-NEXT: WIDEN-INDUCTION %i = phi 0, %i.next, ir<1>, vp<[[VF]]>
287 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
288 ; CHECK-NEXT: WIDEN ir<%cmp> = icmp ult ir<%i>, ir<5>
289 ; CHECK-NEXT: Successor(s): pred.udiv
291 ; CHECK-NEXT: <xVFxUF> pred.udiv: {
292 ; CHECK-NEXT: pred.udiv.entry:
293 ; CHECK-NEXT: BRANCH-ON-MASK ir<%cmp>
294 ; CHECK-NEXT: Successor(s): pred.udiv.if, pred.udiv.continue
296 ; CHECK-NEXT: pred.udiv.if:
297 ; CHECK-NEXT: REPLICATE ir<%tmp4> = udiv ir<%n>, vp<[[STEPS]]> (S->V)
298 ; CHECK-NEXT: Successor(s): pred.udiv.continue
300 ; CHECK-NEXT: pred.udiv.continue:
301 ; CHECK-NEXT: PHI-PREDICATED-INSTRUCTION vp<[[PRED:%.+]]> = ir<%tmp4>
302 ; CHECK-NEXT: No successors
304 ; CHECK-NEXT: Successor(s): if.then.0
306 ; CHECK-NEXT: if.then.0:
307 ; CHECK-NEXT: BLEND ir<%d> = ir<0> vp<[[PRED]]>/ir<%cmp>
308 ; CHECK-NEXT: CLONE ir<%idx> = getelementptr ir<%x>, vp<[[STEPS]]>
309 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%idx>
310 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR]]>, ir<%d>
311 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
312 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
313 ; CHECK-NEXT: No successors
315 ; CHECK-NEXT: Successor(s): middle.block
317 ; CHECK-NEXT: middle.block:
318 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq vp<[[TC]]>, vp<[[VTC]]>
319 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
320 ; CHECK-NEXT: Successor(s): ir-bb<for.end>, scalar.ph
322 ; CHECK-NEXT: ir-bb<for.end>
323 ; CHECK-NEXT: No successors
325 ; CHECK-NEXT: scalar.ph
326 ; CHECK-NEXT: Successor(s): ir-bb<for.body>
328 ; CHECK-NEXT: ir-bb<for.body>:
329 ; CHECK-NEXT: IR %i = phi i64 [ 0, %entry ], [ %i.next, %for.inc ]
330 ; CHECK-NEXT: IR %cmp = icmp ult i64 %i, 5
331 ; CHECK-NEXT: No successors
337 for.body: ; preds = %for.inc, %entry
338 %i = phi i64 [ 0, %entry ], [ %i.next, %for.inc ]
339 %cmp = icmp ult i64 %i, 5
340 br i1 %cmp, label %if.then, label %for.inc
342 if.then: ; preds = %for.body
343 %tmp4 = udiv i64 %n, %i
346 for.inc: ; preds = %if.then, %for.body
347 %d = phi i64 [ 0, %for.body ], [ %tmp4, %if.then ]
348 %idx = getelementptr i64, ptr %x, i64 %i
349 store i64 %d, ptr %idx
350 %i.next = add nuw nsw i64 %i, 1
351 %cond = icmp slt i64 %i.next, %n
352 br i1 %cond, label %for.body, label %for.end
354 for.end: ; preds = %for.inc
358 @AB = common global [1024 x i32] zeroinitializer, align 4
359 @CD = common global [1024 x i32] zeroinitializer, align 4
361 define void @print_interleave_groups(i32 %C, i32 %D) {
362 ; CHECK-LABEL: Checking a loop in 'print_interleave_groups'
363 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
364 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
365 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
366 ; CHECK-NEXT: Live-in ir<256> = original trip-count
368 ; CHECK-NEXT: vector.ph:
369 ; CHECK-NEXT: Successor(s): vector loop
371 ; CHECK-NEXT: <x1> vector loop: {
372 ; CHECK-NEXT: vector.body:
373 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
374 ; CHECK-NEXT: vp<[[DERIVED_IV:%.+]]> = DERIVED-IV ir<0> + vp<[[CAN_IV]]> * ir<4>
375 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[DERIVED_IV]]>, ir<4>
376 ; CHECK-NEXT: CLONE ir<%gep.AB.0> = getelementptr inbounds ir<@AB>, ir<0>, vp<[[STEPS]]>
377 ; CHECK-NEXT: INTERLEAVE-GROUP with factor 4 at %AB.0, ir<%gep.AB.0>
378 ; CHECK-NEXT: ir<%AB.0> = load from index 0
379 ; CHECK-NEXT: ir<%AB.1> = load from index 1
380 ; CHECK-NEXT: ir<%AB.3> = load from index 3
381 ; CHECK-NEXT: WIDEN ir<%add> = add nsw ir<%AB.0>, ir<%AB.1>
382 ; CHECK-NEXT: CLONE ir<%gep.CD.0> = getelementptr inbounds ir<@CD>, ir<0>, vp<[[STEPS]]>
383 ; CHECK-NEXT: INTERLEAVE-GROUP with factor 4 at <badref>, ir<%gep.CD.0>
384 ; CHECK-NEXT: store ir<%add> to index 0
385 ; CHECK-NEXT: store ir<1> to index 1
386 ; CHECK-NEXT: store ir<2> to index 2
387 ; CHECK-NEXT: store ir<%AB.3> to index 3
388 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
389 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
390 ; CHECK-NEXT: No successors
392 ; CHECK-NEXT: Successor(s): middle.block
394 ; CHECK-NEXT: middle.block:
395 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<256>, vp<[[VTC]]>
396 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
397 ; CHECK-NEXT: Successor(s): ir-bb<for.end>, scalar.ph
399 ; CHECK-NEXT: ir-bb<for.end>
400 ; CHECK-NEXT: No successors
402 ; CHECK-NEXT: scalar.ph
403 ; CHECK-NEXT: Successor(s): ir-bb<for.body>
405 ; CHECK-NEXT: ir-bb<for.body>:
406 ; CHECK-NEXT: IR %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
407 ; CHECK: IR %cmp = icmp slt i64 %iv.next, 1024
408 ; CHECK-NEXT: No successors
415 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
416 %gep.AB.0= getelementptr inbounds [1024 x i32], ptr @AB, i64 0, i64 %iv
417 %AB.0 = load i32, ptr %gep.AB.0, align 4
418 %iv.plus.1 = add i64 %iv, 1
419 %gep.AB.1 = getelementptr inbounds [1024 x i32], ptr @AB, i64 0, i64 %iv.plus.1
420 %AB.1 = load i32, ptr %gep.AB.1, align 4
421 %iv.plus.2 = add i64 %iv, 2
422 %iv.plus.3 = add i64 %iv, 3
423 %gep.AB.3 = getelementptr inbounds [1024 x i32], ptr @AB, i64 0, i64 %iv.plus.3
424 %AB.3 = load i32, ptr %gep.AB.3, align 4
425 %add = add nsw i32 %AB.0, %AB.1
426 %gep.CD.0 = getelementptr inbounds [1024 x i32], ptr @CD, i64 0, i64 %iv
427 store i32 %add, ptr %gep.CD.0, align 4
428 %gep.CD.1 = getelementptr inbounds [1024 x i32], ptr @CD, i64 0, i64 %iv.plus.1
429 store i32 1, ptr %gep.CD.1, align 4
430 %gep.CD.2 = getelementptr inbounds [1024 x i32], ptr @CD, i64 0, i64 %iv.plus.2
431 store i32 2, ptr %gep.CD.2, align 4
432 %gep.CD.3 = getelementptr inbounds [1024 x i32], ptr @CD, i64 0, i64 %iv.plus.3
433 store i32 %AB.3, ptr %gep.CD.3, align 4
434 %iv.next = add nuw nsw i64 %iv, 4
435 %cmp = icmp slt i64 %iv.next, 1024
436 br i1 %cmp, label %for.body, label %for.end
442 define float @print_fmuladd_strict(ptr %a, ptr %b, i64 %n) {
443 ; CHECK-LABEL: Checking a loop in 'print_fmuladd_strict'
444 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
445 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
446 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
447 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
449 ; CHECK-NEXT: vector.ph:
450 ; CHECK-NEXT: Successor(s): vector loop
452 ; CHECK-NEXT: <x1> vector loop: {
453 ; CHECK-NEXT: vector.body:
454 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
455 ; CHECK-NEXT: WIDEN-REDUCTION-PHI ir<%sum.07> = phi ir<0.000000e+00>, ir<%muladd>
456 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
457 ; CHECK-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%a>, vp<[[STEPS]]>
458 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%arrayidx>
459 ; CHECK-NEXT: WIDEN ir<%l.a> = load vp<[[VEC_PTR]]>
460 ; CHECK-NEXT: CLONE ir<%arrayidx2> = getelementptr inbounds ir<%b>, vp<[[STEPS]]>
461 ; CHECK-NEXT: vp<[[VEC_PTR2:%.+]]> = vector-pointer ir<%arrayidx2>
462 ; CHECK-NEXT: WIDEN ir<%l.b> = load vp<[[VEC_PTR2]]>
463 ; CHECK-NEXT: EMIT vp<[[FMUL:%.+]]> = fmul nnan ninf nsz ir<%l.a>, ir<%l.b>
464 ; CHECK-NEXT: REDUCE ir<[[MULADD:%.+]]> = ir<%sum.07> + nnan ninf nsz reduce.fadd (vp<[[FMUL]]>)
465 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
466 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
467 ; CHECK-NEXT: No successors
469 ; CHECK-NEXT: Successor(s): middle.block
471 ; CHECK-NEXT: middle.block:
472 ; CHECK-NEXT: EMIT vp<[[RED_RES:%.+]]> = compute-reduction-result ir<%sum.07>, ir<[[MULADD]]>
473 ; CHECK-NEXT: EMIT vp<[[RED_EX:%.+]]> = extract-from-end vp<[[RED_RES]]>, ir<1>
474 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
475 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
476 ; CHECK-NEXT: Successor(s): ir-bb<for.end>, scalar.ph
478 ; CHECK-NEXT: ir-bb<for.end>
479 ; CHECK-NEXT: IR %muladd.lcssa = phi float [ %muladd, %for.body ] (extra operand: vp<[[RED_EX]]> from middle.block)
480 ; CHECK-NEXT: No successors
482 ; CHECK-NEXT: scalar.ph
483 ; CHECK-NEXT: EMIT vp<[[RED_RESUME:%.+]]> = resume-phi vp<[[RED_RES]]>, ir<0.000000e+00>
484 ; CHECK-NEXT: Successor(s): ir-bb<for.body>
486 ; CHECK-NEXT: ir-bb<for.body>:
487 ; CHECK-NEXT: IR %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
488 ; CHECK-NEXT: IR %sum.07 = phi float [ 0.000000e+00, %entry ], [ %muladd, %for.body ]
489 ; CHECK: IR %exitcond.not = icmp eq i64 %iv.next, %n
490 ; CHECK-NEXT: No successors
497 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
498 %sum.07 = phi float [ 0.000000e+00, %entry ], [ %muladd, %for.body ]
499 %arrayidx = getelementptr inbounds float, ptr %a, i64 %iv
500 %l.a = load float, ptr %arrayidx, align 4
501 %arrayidx2 = getelementptr inbounds float, ptr %b, i64 %iv
502 %l.b = load float, ptr %arrayidx2, align 4
503 %muladd = tail call nnan ninf nsz float @llvm.fmuladd.f32(float %l.a, float %l.b, float %sum.07)
504 %iv.next = add nuw nsw i64 %iv, 1
505 %exitcond.not = icmp eq i64 %iv.next, %n
506 br i1 %exitcond.not, label %for.end, label %for.body
512 define void @debug_loc_vpinstruction(ptr nocapture %asd, ptr nocapture %bsd) !dbg !5 {
513 ; CHECK-LABEL: Checking a loop in 'debug_loc_vpinstruction'
514 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
515 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
516 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
517 ; CHECK-NEXT: Live-in ir<128> = original trip-count
519 ; CHECK-NEXT: vector.ph:
520 ; CHECK-NEXT: Successor(s): vector loop
522 ; CHECK-NEXT: <x1> vector loop: {
523 ; CHECK-NEXT: vector.body:
524 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
525 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
526 ; CHECK-NEXT: CLONE ir<%isd> = getelementptr inbounds ir<%asd>, vp<[[STEPS]]>
527 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%isd>
528 ; CHECK-NEXT: WIDEN ir<%lsd> = load vp<[[VEC_PTR]]>
529 ; CHECK-NEXT: WIDEN ir<%psd> = add nuw nsw ir<%lsd>, ir<23>
530 ; CHECK-NEXT: WIDEN ir<%cmp1> = icmp slt ir<%lsd>, ir<100>
531 ; CHECK-NEXT: EMIT vp<[[NOT1:%.+]]> = not ir<%cmp1>, !dbg /tmp/s.c:5:3
532 ; CHECK-NEXT: WIDEN ir<%cmp2> = icmp sge ir<%lsd>, ir<200>
533 ; CHECK-NEXT: EMIT vp<[[SEL1:%.+]]> = logical-and vp<[[NOT1]]>, ir<%cmp2>, !dbg /tmp/s.c:5:21
534 ; CHECK-NEXT: EMIT vp<[[OR1:%.+]]> = or vp<[[SEL1]]>, ir<%cmp1>
535 ; CHECK-NEXT: Successor(s): pred.sdiv
537 ; CHECK-NEXT: <xVFxUF> pred.sdiv: {
538 ; CHECK-NEXT: pred.sdiv.entry:
539 ; CHECK-NEXT: BRANCH-ON-MASK vp<[[OR1]]>
540 ; CHECK-NEXT: Successor(s): pred.sdiv.if, pred.sdiv.continue
542 ; CHECK-NEXT: pred.sdiv.if:
543 ; CHECK-NEXT: REPLICATE ir<%sd1> = sdiv ir<%psd>, ir<%lsd> (S->V)
544 ; CHECK-NEXT: Successor(s): pred.sdiv.continue
546 ; CHECK-NEXT: pred.sdiv.continue:
547 ; CHECK-NEXT: PHI-PREDICATED-INSTRUCTION vp<[[PHI:%.+]]> = ir<%sd1>
548 ; CHECK-NEXT: No successors
550 ; CHECK-NEXT: Successor(s): if.then.0
552 ; CHECK-NEXT: if.then.0:
553 ; CHECK-NEXT: EMIT vp<[[NOT2:%.+]]> = not ir<%cmp2>
554 ; CHECK-NEXT: EMIT vp<[[SEL2:%.+]]> = logical-and vp<[[NOT1]]>, vp<[[NOT2]]>
555 ; CHECK-NEXT: BLEND ir<%ysd.0> = vp<[[PHI]]> ir<%psd>/vp<[[SEL2]]>
556 ; CHECK-NEXT: vp<[[VEC_PTR2:%.+]]> = vector-pointer ir<%isd>
557 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR2]]>, ir<%ysd.0>
558 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
559 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
560 ; CHECK-NEXT: No successors
562 ; CHECK-NEXT: Successor(s): middle.block
564 ; CHECK-NEXT: middle.block:
565 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<128>, vp<[[VTC]]>
566 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
567 ; CHECK-NEXT: Successor(s): ir-bb<exit>, scalar.ph
569 ; CHECK-NEXT: ir-bb<exit>
570 ; CHECK-NEXT: No successors
572 ; CHECK-NEXT: scalar.ph:
573 ; CHECK-NEXT: Successor(s): ir-bb<loop>
575 ; CHECK-NEXT: ir-bb<loop>:
576 ; CHECK-NEXT: IR %iv = phi i64 [ 0, %entry ], [ %iv.next, %if.end ]
577 ; CHECK: IR %cmp1 = icmp slt i32 %lsd, 100
578 ; CHECK-NEXT: No successors
585 %iv = phi i64 [ 0, %entry ], [ %iv.next, %if.end ]
586 %isd = getelementptr inbounds i32, ptr %asd, i64 %iv
587 %lsd = load i32, ptr %isd, align 4
588 %psd = add nuw nsw i32 %lsd, 23
589 %cmp1 = icmp slt i32 %lsd, 100
590 br i1 %cmp1, label %if.then, label %check, !dbg !7
593 %cmp2 = icmp sge i32 %lsd, 200
594 br i1 %cmp2, label %if.then, label %if.end, !dbg !8
597 %sd1 = sdiv i32 %psd, %lsd
601 %ysd.0 = phi i32 [ %sd1, %if.then ], [ %psd, %check ]
602 store i32 %ysd.0, ptr %isd, align 4
603 %iv.next = add nuw nsw i64 %iv, 1
604 %exitcond = icmp eq i64 %iv.next, 128
605 br i1 %exitcond, label %exit, label %loop
611 declare float @llvm.sqrt.f32(float) nounwind readnone
612 declare float @llvm.fmuladd.f32(float, float, float)
614 define void @print_expand_scev(i64 %y, ptr %ptr) {
615 ; CHECK-LABEL: Checking a loop in 'print_expand_scev'
616 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
617 ; CHECK-NEXT: Live-in vp<[[VF:%.*]]> = VF
618 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
619 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
620 ; CHECK-NEXT: vp<[[TC:%.+]]> = original trip-count
622 ; CHECK-NEXT: ir-bb<entry>:
623 ; CHECK-NEXT: IR %div = udiv i64 %y, 492802768830814060
624 ; CHECK-NEXT: IR %inc = add i64 %div, 1
625 ; CHECK-NEXT: EMIT vp<[[TC]]> = EXPAND SCEV (1 + ((15 + (%y /u 492802768830814060))<nuw><nsw> /u (1 + (%y /u 492802768830814060))<nuw><nsw>))<nuw><nsw>
626 ; CHECK-NEXT: EMIT vp<[[EXP_SCEV:%.+]]> = EXPAND SCEV (1 + (%y /u 492802768830814060))<nuw><nsw>
627 ; CHECK-NEXT: No successors
629 ; CHECK-NEXT: vector.ph:
630 ; CHECK-NEXT: Successor(s): vector loop
632 ; CHECK-NEXT: <x1> vector loop: {
633 ; CHECK-NEXT: vector.body:
634 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
635 ; CHECK-NEXT: WIDEN-INDUCTION\l" +
636 ; CHECK-NEXT: " %iv = phi %iv.next, 0\l" +
637 ; CHECK-NEXT: " ir<%v2>, vp<[[EXP_SCEV]]>, vp<[[VF]]>
638 ; CHECK-NEXT: vp<[[DERIVED_IV:%.+]]> = DERIVED-IV ir<0> + vp<[[CAN_IV]]> * vp<[[EXP_SCEV]]>
639 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[DERIVED_IV]]>, vp<[[EXP_SCEV]]>
640 ; CHECK-NEXT: WIDEN ir<%v3> = add nuw ir<%v2>, ir<1>
641 ; CHECK-NEXT: REPLICATE ir<%gep> = getelementptr inbounds ir<%ptr>, vp<[[STEPS]]>
642 ; CHECK-NEXT: REPLICATE store ir<%v3>, ir<%gep>
643 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
644 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
645 ; CHECK-NEXT: No successors
647 ; CHECK-NEXT: Successor(s): middle.block
649 ; CHECK-NEXT: middle.block:
650 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq vp<[[TC]]>, vp<[[VTC]]>
651 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
652 ; CHECK-NEXT: Successor(s): ir-bb<loop.exit>, scalar.ph
654 ; CHECK-NEXT: ir-bb<loop.exit>
655 ; CHECK-NEXT: No successors
657 ; CHECK-NEXT: scalar.ph
658 ; CHECK-NEXT: Successor(s): ir-bb<loop>
660 ; CHECK-NEXT: ir-bb<loop>:
661 ; CHECK-NEXT: IR %iv = phi i64 [ %iv.next, %loop ], [ 0, %entry ]
662 ; CHECK: IR %iv.next = add i64 %iv, %inc
663 ; CHECK-NEXT: No successors
667 %div = udiv i64 %y, 492802768830814060
668 %inc = add i64 %div, 1
671 loop: ; preds = %loop, %entry
672 %iv = phi i64 [ %iv.next, %loop ], [ 0, %entry ]
673 %v2 = trunc i64 %iv to i8
674 %v3 = add nuw i8 %v2, 1
675 %gep = getelementptr inbounds i8, ptr %ptr, i64 %iv
676 store i8 %v3, ptr %gep
678 %cmp15 = icmp slt i8 %v3, 10000
679 %iv.next = add i64 %iv, %inc
680 br i1 %cmp15, label %loop, label %loop.exit
686 define i32 @print_exit_value(ptr %ptr, i32 %off) {
687 ; CHECK-LABEL: Checking a loop in 'print_exit_value'
688 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
689 ; CHECK-NEXT: Live-in vp<[[VF:%.]]> = VF
690 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
691 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
692 ; CHECK-NEXT: Live-in ir<1000> = original trip-count
694 ; CHECK-NEXT: vector.ph:
695 ; CHECK-NEXT: Successor(s): vector loop
697 ; CHECK-NEXT: <x1> vector loop: {
698 ; CHECK-NEXT: vector.body:
699 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
700 ; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>, vp<[[VF]]>
701 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
702 ; CHECK-NEXT: CLONE ir<%gep> = getelementptr inbounds ir<%ptr>, vp<[[STEPS]]>
703 ; CHECK-NEXT: WIDEN ir<%add> = add ir<%iv>, ir<%off>
704 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%gep>
705 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR]]>, ir<0>
706 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
707 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
708 ; CHECK-NEXT: No successors
710 ; CHECK-NEXT: Successor(s): middle.block
712 ; CHECK-NEXT: middle.block:
713 ; CHECK-NEXT: EMIT vp<[[EXIT:%.+]]> = extract-from-end ir<%add>, ir<1>
714 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<1000>, vp<[[VTC]]>
715 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
716 ; CHECK-NEXT: Successor(s): ir-bb<exit>, scalar.ph
718 ; CHECK-NEXT: ir-bb<exit>
719 ; CHECK-NEXT: IR %lcssa = phi i32 [ %add, %loop ] (extra operand: vp<[[EXIT]]> from middle.block)
720 ; CHECK-NEXT: No successors
722 ; CHECK-NEXT: scalar.ph
723 ; CHECK-NEXT: Successor(s): ir-bb<loop>
725 ; CHECK-NEXT: ir-bb<loop>:
726 ; CHECK-NEXT: IR %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
727 ; CHECK: IR %ec = icmp eq i32 %iv.next, 1000
728 ; CHECK-NEXT: No successors
735 %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
736 %gep = getelementptr inbounds i8, ptr %ptr, i32 %iv
737 %add = add i32 %iv, %off
739 %iv.next = add nsw i32 %iv, 1
740 %ec = icmp eq i32 %iv.next, 1000
741 br i1 %ec, label %exit, label %loop
744 %lcssa = phi i32 [ %add, %loop ]
748 define void @print_fast_math_flags(i64 %n, ptr noalias %y, ptr noalias %x, ptr %z) {
749 ; CHECK-LABEL: Checking a loop in 'print_fast_math_flags'
750 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
751 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
752 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
753 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
755 ; CHECK-NEXT: vector.ph:
756 ; CHECK-NEXT: Successor(s): vector loop
758 ; CHECK-NEXT: <x1> vector loop: {
759 ; CHECK-NEXT: vector.body:
760 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
761 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
762 ; CHECK-NEXT: CLONE ir<%gep.y> = getelementptr inbounds ir<%y>, vp<[[STEPS]]>
763 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%gep.y>
764 ; CHECK-NEXT: WIDEN ir<%lv> = load vp<[[VEC_PTR]]>
765 ; CHECK-NEXT: WIDEN ir<%add> = fadd nnan ir<%lv>, ir<1.000000e+00>
766 ; CHECK-NEXT: WIDEN ir<%mul> = fmul reassoc nnan ninf nsz arcp contract afn ir<%add>, ir<2.000000e+00>
767 ; CHECK-NEXT: WIDEN ir<%div> = fdiv reassoc nsz contract ir<%mul>, ir<2.000000e+00>
768 ; CHECK-NEXT: CLONE ir<%gep.x> = getelementptr inbounds ir<%x>, vp<[[STEPS]]>
769 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%gep.x>
770 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR]]>, ir<%div>
771 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
772 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
773 ; CHECK-NEXT: No successors
775 ; CHECK-NEXT: Successor(s): middle.block
777 ; CHECK-NEXT: middle.block:
778 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
779 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
780 ; CHECK-NEXT: Successor(s): ir-bb<exit>, scalar.ph
782 ; CHECK-NEXT: ir-bb<exit>
783 ; CHECK-NEXT: No successors
785 ; CHECK-NEXT: scalar.ph
786 ; CHECK-NEXT: Successor(s): ir-bb<loop>
788 ; CHECK-NEXT: ir-bb<loop>:
789 ; CHECK-NEXT: IR %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
790 ; CHECK: IR %exitcond = icmp eq i64 %iv.next, %n
791 ; CHECK-NEXT: No successors
798 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
799 %gep.y = getelementptr inbounds float, ptr %y, i64 %iv
800 %lv = load float, ptr %gep.y, align 4
801 %add = fadd nnan float %lv, 1.0
802 %mul = fmul fast float %add, 2.0
803 %div = fdiv nsz reassoc contract float %mul, 2.0
804 %gep.x = getelementptr inbounds float, ptr %x, i64 %iv
805 store float %div, ptr %gep.x, align 4
806 %iv.next = add i64 %iv, 1
807 %exitcond = icmp eq i64 %iv.next, %n
808 br i1 %exitcond, label %exit, label %loop
814 define void @print_exact_flags(i64 %n, ptr noalias %x) {
815 ; CHECK-LABEL: Checking a loop in 'print_exact_flags'
816 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
817 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
818 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
819 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
821 ; CHECK-NEXT: vector.ph:
822 ; CHECK-NEXT: Successor(s): vector loop
824 ; CHECK-NEXT: <x1> vector loop: {
825 ; CHECK-NEXT: vector.body:
826 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
827 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
828 ; CHECK-NEXT: CLONE ir<%gep.x> = getelementptr inbounds ir<%x>, vp<[[STEPS]]>
829 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%gep.x>
830 ; CHECK-NEXT: WIDEN ir<%lv> = load vp<[[VEC_PTR]]>
831 ; CHECK-NEXT: WIDEN ir<%div.1> = udiv exact ir<%lv>, ir<20>
832 ; CHECK-NEXT: WIDEN ir<%div.2> = udiv ir<%lv>, ir<60>
833 ; CHECK-NEXT: WIDEN ir<%add> = add nuw nsw ir<%div.1>, ir<%div.2>
834 ; CHECK-NEXT: vp<[[VEC_PTR2:%.+]]> = vector-pointer ir<%gep.x>
835 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR2]]>, ir<%add>
836 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
837 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
838 ; CHECK-NEXT: No successors
840 ; CHECK-NEXT: Successor(s): middle.block
842 ; CHECK-NEXT: middle.block:
843 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
844 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
845 ; CHECK-NEXT: Successor(s): ir-bb<exit>, scalar.ph
847 ; CHECK-NEXT: ir-bb<exit>
848 ; CHECK-NEXT: No successors
850 ; CHECK-NEXT: scalar.ph
851 ; CHECK-NEXT: Successor(s): ir-bb<loop>
853 ; CHECK-NEXT: ir-bb<loop>:
854 ; CHECK-NEXT: IR %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
855 ; CHECK: IR %exitcond = icmp eq i64 %iv.next, %n
856 ; CHECK-NEXT: No successors
863 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
864 %gep.x = getelementptr inbounds i32, ptr %x, i64 %iv
865 %lv = load i32, ptr %gep.x, align 4
866 %div.1 = udiv exact i32 %lv, 20
867 %div.2 = udiv i32 %lv, 60
868 %add = add nsw nuw i32 %div.1, %div.2
869 store i32 %add, ptr %gep.x, align 4
870 %iv.next = add i64 %iv, 1
871 %exitcond = icmp eq i64 %iv.next, %n
872 br i1 %exitcond, label %exit, label %loop
878 define void @print_call_flags(ptr readonly %src, ptr noalias %dest, i64 %n) {
879 ; CHECK-LABEL: Checking a loop in 'print_call_flags'
880 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
881 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
882 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
883 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
885 ; CHECK-NEXT: vector.ph:
886 ; CHECK-NEXT: Successor(s): vector loop
888 ; CHECK-NEXT: <x1> vector loop: {
889 ; CHECK-NEXT: vector.body:
890 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
891 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
892 ; CHECK-NEXT: CLONE ir<%ld.addr> = getelementptr inbounds ir<%src>, vp<[[STEPS]]>
893 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%ld.addr>
894 ; CHECK-NEXT: WIDEN ir<%ld.value> = load vp<[[VEC_PTR]]>
895 ; CHECK-NEXT: WIDEN ir<%ifcond> = fcmp oeq ir<%ld.value>, ir<5.000000e+00>
896 ; CHECK-NEXT: Successor(s): pred.call
898 ; CHECK-NEXT: <xVFxUF> pred.call: {
899 ; CHECK-NEXT: pred.call.entry:
900 ; CHECK-NEXT: BRANCH-ON-MASK ir<%ifcond>
901 ; CHECK-NEXT: Successor(s): pred.call.if, pred.call.continue
903 ; CHECK-NEXT: pred.call.if:
904 ; CHECK-NEXT: REPLICATE ir<%foo.ret.1> = call nnan ninf nsz @foo(ir<%ld.value>) (S->V)
905 ; CHECK-NEXT: REPLICATE ir<%foo.ret.2> = call @foo(ir<%ld.value>) (S->V)
906 ; CHECK-NEXT: Successor(s): pred.call.continue
908 ; CHECK-NEXT: pred.call.continue:
909 ; CHECK-NEXT: PHI-PREDICATED-INSTRUCTION vp<[[PHI1:%.+]]> = ir<%foo.ret.1>
910 ; CHECK-NEXT: PHI-PREDICATED-INSTRUCTION vp<[[PHI2:%.+]]> = ir<%foo.ret.2>
911 ; CHECK-NEXT: No successors
913 ; CHECK-NEXT: Successor(s): if.then.1
915 ; CHECK-NEXT: if.then.1:
916 ; CHECK-NEXT: WIDEN ir<%fadd> = fadd vp<[[PHI1]]>, vp<[[PHI2]]>
917 ; CHECK-NEXT: BLEND ir<%st.value> = ir<%ld.value> ir<%fadd>/ir<%ifcond>
918 ; CHECK-NEXT: CLONE ir<%st.addr> = getelementptr inbounds ir<%dest>, vp<[[STEPS]]>
919 ; CHECK-NEXT: vp<[[VEC_PTR2:%.+]]> = vector-pointer ir<%st.addr>
920 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR2]]>, ir<%st.value>
921 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
922 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
923 ; CHECK-NEXT: No successors
925 ; CHECK-NEXT: Successor(s): middle.block
927 ; CHECK-NEXT: middle.block:
928 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
929 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
930 ; CHECK-NEXT: Successor(s): ir-bb<end>, scalar.ph
932 ; CHECK-NEXT: ir-bb<end>
933 ; CHECK-NEXT: No successors
935 ; CHECK-NEXT: scalar.ph
936 ; CHECK-NEXT: Successor(s): ir-bb<for.body>
938 ; CHECK-NEXT: ir-bb<for.body>:
939 ; CHECK-NEXT: IR %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.loop ]
940 ; CHECK: IR %ifcond = fcmp oeq float %ld.value, 5.0
941 ; CHECK-NEXT: No successors
948 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.loop ]
949 %ld.addr = getelementptr inbounds float, ptr %src, i64 %iv
950 %ld.value = load float , ptr %ld.addr, align 8
951 %ifcond = fcmp oeq float %ld.value, 5.0
952 br i1 %ifcond, label %if.then, label %for.loop
955 %foo.ret.1 = call nnan nsz ninf float @foo(float %ld.value) #0
956 %foo.ret.2 = call float @foo(float %ld.value) #0
957 %fadd = fadd float %foo.ret.1, %foo.ret.2
961 %st.value = phi float [ %ld.value, %for.body ], [ %fadd, %if.then ]
962 %st.addr = getelementptr inbounds float, ptr %dest, i64 %iv
963 store float %st.value, ptr %st.addr, align 8
964 %iv.next = add nsw nuw i64 %iv, 1
965 %loopcond = icmp eq i64 %iv.next, %n
966 br i1 %loopcond, label %end, label %for.body
972 ; FIXME: Preserve disjoint flag on OR recipe.
973 define void @print_disjoint_flags(i64 %n, ptr noalias %x) {
974 ; CHECK-LABEL: Checking a loop in 'print_disjoint_flags'
975 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
976 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
977 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
978 ; CHECK-NEXT: Live-in ir<%n> = original trip-count
980 ; CHECK-NEXT: vector.ph:
981 ; CHECK-NEXT: Successor(s): vector loop
983 ; CHECK-NEXT: <x1> vector loop: {
984 ; CHECK-NEXT: vector.body:
985 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
986 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
987 ; CHECK-NEXT: CLONE ir<%gep.x> = getelementptr inbounds ir<%x>, vp<[[STEPS]]>
988 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%gep.x>
989 ; CHECK-NEXT: WIDEN ir<%lv> = load vp<[[VEC_PTR]]>
990 ; CHECK-NEXT: WIDEN ir<%or.1> = or disjoint ir<%lv>, ir<1>
991 ; CHECK-NEXT: WIDEN ir<%or.2> = or ir<%lv>, ir<3>
992 ; CHECK-NEXT: WIDEN ir<%add> = add nuw nsw ir<%or.1>, ir<%or.2>
993 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%gep.x>
994 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR]]>, ir<%add>
995 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
996 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
997 ; CHECK-NEXT: No successors
999 ; CHECK-NEXT: Successor(s): middle.block
1001 ; CHECK-NEXT: middle.block:
1002 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<%n>, vp<[[VTC]]>
1003 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
1004 ; CHECK-NEXT: Successor(s): ir-bb<exit>, scalar.ph
1006 ; CHECK-NEXT: ir-bb<exit>
1007 ; CHECK-NEXT: No successors
1009 ; CHECK-NEXT: scalar.ph
1010 ; CHECK-NEXT: Successor(s): ir-bb<loop>
1012 ; CHECK-NEXT: ir-bb<loop>:
1013 ; CHECK-NEXT: IR %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
1014 ; CHECK: IR %exitcond = icmp eq i64 %iv.next, %n
1015 ; CHECK-NEXT: No successors
1022 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
1023 %gep.x = getelementptr inbounds i32, ptr %x, i64 %iv
1024 %lv = load i32, ptr %gep.x, align 4
1025 %or.1 = or disjoint i32 %lv, 1
1026 %or.2 = or i32 %lv, 3
1027 %add = add nsw nuw i32 %or.1, %or.2
1028 store i32 %add, ptr %gep.x, align 4
1029 %iv.next = add i64 %iv, 1
1030 %exitcond = icmp eq i64 %iv.next, %n
1031 br i1 %exitcond, label %exit, label %loop
1037 define void @zext_nneg(ptr noalias %p, ptr noalias %p1) {
1038 ; CHECK-LABEL: LV: Checking a loop in 'zext_nneg'
1039 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
1040 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
1041 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
1042 ; CHECK-NEXT: Live-in ir<1000> = original trip-count
1044 ; CHECK-NEXT: vector.ph:
1045 ; CHECK-NEXT: Successor(s): vector loop
1047 ; CHECK-NEXT: <x1> vector loop: {
1048 ; CHECK-NEXT: vector.body:
1049 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
1050 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
1051 ; CHECK-NEXT: CLONE ir<%idx> = getelementptr ir<%p>, vp<[[STEPS]]>
1052 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%idx>
1053 ; CHECK-NEXT: WIDEN ir<%l> = load vp<[[VEC_PTR]]>
1054 ; CHECK-NEXT: WIDEN-CAST ir<%zext> = zext nneg ir<%l>
1055 ; CHECK-NEXT: REPLICATE store ir<%zext>, ir<%p1>
1056 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>
1057 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
1058 ; CHECK-NEXT: No successors
1065 %iv = phi i64 [ %next, %body ], [ 0, %entry ]
1066 %idx = getelementptr i32, ptr %p, i64 %iv
1067 %l = load i32, ptr %idx, align 8
1068 %zext = zext nneg i32 %l to i64
1069 store i64 %zext, ptr %p1, align 8
1070 %next = add i64 %iv, 1
1071 %cmp = icmp eq i64 %next, 1000
1072 br i1 %cmp, label %exit, label %body
1078 define i16 @print_first_order_recurrence_and_result(ptr %ptr) {
1079 ; CHECK-LABEL: 'print_first_order_recurrence_and_result'
1080 ; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
1081 ; CHECK-NEXT: Live-in vp<[[VFxUF:%.+]]> = VF * UF
1082 ; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
1083 ; CHECK-NEXT: Live-in ir<1000> = original trip-count
1085 ; CHECK-NEXT: vector.ph:
1086 ; CHECK-NEXT: Successor(s): vector loop
1088 ; CHECK-NEXT: <x1> vector loop: {
1089 ; CHECK-NEXT: vector.body:
1090 ; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION
1091 ; CHECK-NEXT: FIRST-ORDER-RECURRENCE-PHI ir<%for.1> = phi ir<22>, ir<%for.1.next>
1092 ; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
1093 ; CHECK-NEXT: CLONE ir<%gep.ptr> = getelementptr inbounds ir<%ptr>, vp<[[STEPS]]>
1094 ; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%gep.ptr>
1095 ; CHECK-NEXT: WIDEN ir<%for.1.next> = load vp<[[VEC_PTR]]>
1096 ; CHECK-NEXT: EMIT vp<[[FOR1_SPLICE:%.+]]> = first-order splice ir<%for.1>, ir<%for.1.next>
1097 ; CHECK-NEXT: WIDEN ir<%add> = add vp<[[FOR1_SPLICE]]>, ir<1>
1098 ; CHECK-NEXT: vp<[[VEC_PTR2:%.+]]> = vector-pointer ir<%gep.ptr>
1099 ; CHECK-NEXT: WIDEN store vp<[[VEC_PTR2]]>, ir<%add>
1100 ; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT:%.+]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
1101 ; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
1102 ; CHECK-NEXT: No successors
1104 ; CHECK-NEXT: Successor(s): middle.block
1106 ; CHECK-NEXT: middle.block:
1107 ; CHECK-NEXT: EMIT vp<[[FOR_RESULT:%.+]]> = extract-from-end ir<%for.1.next>, ir<2>
1108 ; CHECK-NEXT: EMIT vp<[[RESUME_1:%.+]]> = extract-from-end ir<%for.1.next>, ir<1>
1109 ; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp eq ir<1000>, vp<[[VTC]]>
1110 ; CHECK-NEXT: EMIT branch-on-cond vp<[[CMP]]>
1111 ; CHECK-NEXT: Successor(s): ir-bb<exit>, scalar.ph
1113 ; CHECK-NEXT: ir-bb<exit>
1114 ; CHECK-NEXT: IR %for.1.lcssa = phi i16 [ %for.1, %loop ] (extra operand: vp<[[FOR_RESULT]]> from middle.block)
1115 ; CHECK-NEXT: No successors
1117 ; CHECK-NEXT: scalar.ph
1118 ; CHECK-NEXT: EMIT vp<[[RESUME_P:%.*]]> = resume-phi vp<[[RESUME_1]]>, ir<22>
1119 ; CHECK-NEXT: Successor(s): ir-bb<loop>
1121 ; CHECK-NEXT: ir-bb<loop>:
1122 ; CHECK-NEXT: IR %for.1 = phi i16 [ 22, %entry ], [ %for.1.next, %loop ] (extra operand: vp<[[RESUME_P]]> from scalar.ph)
1123 ; CHECK-NEXT: IR %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
1124 ; CHECK: IR %exitcond.not = icmp eq i64 %iv.next, 1000
1125 ; CHECK-NEXT: No successors
1132 %for.1 = phi i16 [ 22, %entry ], [ %for.1.next, %loop ]
1133 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
1134 %iv.next = add nuw nsw i64 %iv, 1
1135 %gep.ptr = getelementptr inbounds i16, ptr %ptr, i64 %iv
1136 %for.1.next = load i16, ptr %gep.ptr, align 2
1137 %add = add i16 %for.1, 1
1138 store i16 %add, ptr %gep.ptr
1139 %exitcond.not = icmp eq i64 %iv.next, 1000
1140 br i1 %exitcond.not, label %exit, label %loop
1146 !llvm.dbg.cu = !{!0}
1147 !llvm.module.flags = !{!3, !4}
1149 declare float @foo(float) #0
1150 declare <2 x float> @vector_foo(<2 x float>, <2 x i1>)
1152 ; We need a vector variant in order to allow for vectorization at present, but
1153 ; we want to test scalarization of conditional calls. If we provide a variant
1154 ; with a different number of lanes than the VF we force via
1155 ; "-force-vector-width=4", then it should pass the legality checks but
1156 ; scalarize. TODO: Remove the requirement to have a variant.
1157 attributes #0 = { readonly nounwind "vector-function-abi-variant"="_ZGV_LLVM_M2v_foo(vector_foo)" }
1159 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug, enums: !2)
1160 !1 = !DIFile(filename: "/tmp/s.c", directory: "/tmp")
1162 !3 = !{i32 2, !"Debug Info Version", i32 3}
1163 !4 = !{i32 7, !"PIC Level", i32 2}
1164 !5 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !6, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
1165 !6 = !DISubroutineType(types: !2)
1166 !7 = !DILocation(line: 5, column: 3, scope: !5)
1167 !8 = !DILocation(line: 5, column: 21, scope: !5)