1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -p loop-vectorize -S %s | FileCheck --check-prefix=DEFAULT %s
3 ; RUN: opt -p loop-vectorize -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue -S %s | FileCheck --check-prefix=PRED %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6 target triple = "arm64-apple-macosx14.0.0"
8 define void @invar_cond_gep_store(ptr %dst, i32 %0) {
9 ; DEFAULT-LABEL: define void @invar_cond_gep_store(
10 ; DEFAULT-SAME: ptr [[DST:%.*]], i32 [[TMP0:%.*]]) {
11 ; DEFAULT-NEXT: entry:
12 ; DEFAULT-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
14 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i64 0
15 ; DEFAULT-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer
16 ; DEFAULT-NEXT: br label [[VECTOR_BODY:%.*]]
17 ; DEFAULT: vector.body:
18 ; DEFAULT-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_STORE_CONTINUE14:%.*]] ]
19 ; DEFAULT-NEXT: [[OFFSET_IDX:%.*]] = add i64 1, [[INDEX]]
20 ; DEFAULT-NEXT: [[TMP1:%.*]] = icmp eq <4 x i32> [[BROADCAST_SPLAT]], zeroinitializer
21 ; DEFAULT-NEXT: [[TMP2:%.*]] = icmp eq <4 x i32> [[BROADCAST_SPLAT]], zeroinitializer
22 ; DEFAULT-NEXT: [[TMP3:%.*]] = extractelement <4 x i1> [[TMP1]], i32 0
23 ; DEFAULT-NEXT: br i1 [[TMP3]], label [[PRED_STORE_IF:%.*]], label [[PRED_STORE_CONTINUE:%.*]]
24 ; DEFAULT: pred.store.if:
25 ; DEFAULT-NEXT: [[TMP4:%.*]] = add i64 [[OFFSET_IDX]], 0
26 ; DEFAULT-NEXT: [[TMP5:%.*]] = add i64 [[TMP4]], 1
27 ; DEFAULT-NEXT: [[TMP6:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP5]]
28 ; DEFAULT-NEXT: store i32 1, ptr [[TMP6]], align 4
29 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE]]
30 ; DEFAULT: pred.store.continue:
31 ; DEFAULT-NEXT: [[TMP7:%.*]] = extractelement <4 x i1> [[TMP1]], i32 1
32 ; DEFAULT-NEXT: br i1 [[TMP7]], label [[PRED_STORE_IF1:%.*]], label [[PRED_STORE_CONTINUE2:%.*]]
33 ; DEFAULT: pred.store.if1:
34 ; DEFAULT-NEXT: [[TMP8:%.*]] = add i64 [[OFFSET_IDX]], 1
35 ; DEFAULT-NEXT: [[TMP9:%.*]] = add i64 [[TMP8]], 1
36 ; DEFAULT-NEXT: [[TMP10:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP9]]
37 ; DEFAULT-NEXT: store i32 1, ptr [[TMP10]], align 4
38 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE2]]
39 ; DEFAULT: pred.store.continue2:
40 ; DEFAULT-NEXT: [[TMP11:%.*]] = extractelement <4 x i1> [[TMP1]], i32 2
41 ; DEFAULT-NEXT: br i1 [[TMP11]], label [[PRED_STORE_IF3:%.*]], label [[PRED_STORE_CONTINUE4:%.*]]
42 ; DEFAULT: pred.store.if3:
43 ; DEFAULT-NEXT: [[TMP12:%.*]] = add i64 [[OFFSET_IDX]], 2
44 ; DEFAULT-NEXT: [[TMP13:%.*]] = add i64 [[TMP12]], 1
45 ; DEFAULT-NEXT: [[TMP14:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP13]]
46 ; DEFAULT-NEXT: store i32 1, ptr [[TMP14]], align 4
47 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE4]]
48 ; DEFAULT: pred.store.continue4:
49 ; DEFAULT-NEXT: [[TMP15:%.*]] = extractelement <4 x i1> [[TMP1]], i32 3
50 ; DEFAULT-NEXT: br i1 [[TMP15]], label [[PRED_STORE_IF5:%.*]], label [[PRED_STORE_CONTINUE6:%.*]]
51 ; DEFAULT: pred.store.if5:
52 ; DEFAULT-NEXT: [[TMP16:%.*]] = add i64 [[OFFSET_IDX]], 3
53 ; DEFAULT-NEXT: [[TMP17:%.*]] = add i64 [[TMP16]], 1
54 ; DEFAULT-NEXT: [[TMP18:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP17]]
55 ; DEFAULT-NEXT: store i32 1, ptr [[TMP18]], align 4
56 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE6]]
57 ; DEFAULT: pred.store.continue6:
58 ; DEFAULT-NEXT: [[TMP19:%.*]] = extractelement <4 x i1> [[TMP2]], i32 0
59 ; DEFAULT-NEXT: br i1 [[TMP19]], label [[PRED_STORE_IF7:%.*]], label [[PRED_STORE_CONTINUE8:%.*]]
60 ; DEFAULT: pred.store.if7:
61 ; DEFAULT-NEXT: [[TMP20:%.*]] = add i64 [[OFFSET_IDX]], 4
62 ; DEFAULT-NEXT: [[TMP21:%.*]] = add i64 [[TMP20]], 1
63 ; DEFAULT-NEXT: [[TMP22:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP21]]
64 ; DEFAULT-NEXT: store i32 1, ptr [[TMP22]], align 4
65 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE8]]
66 ; DEFAULT: pred.store.continue8:
67 ; DEFAULT-NEXT: [[TMP23:%.*]] = extractelement <4 x i1> [[TMP2]], i32 1
68 ; DEFAULT-NEXT: br i1 [[TMP23]], label [[PRED_STORE_IF9:%.*]], label [[PRED_STORE_CONTINUE10:%.*]]
69 ; DEFAULT: pred.store.if9:
70 ; DEFAULT-NEXT: [[TMP24:%.*]] = add i64 [[OFFSET_IDX]], 5
71 ; DEFAULT-NEXT: [[TMP25:%.*]] = add i64 [[TMP24]], 1
72 ; DEFAULT-NEXT: [[TMP26:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP25]]
73 ; DEFAULT-NEXT: store i32 1, ptr [[TMP26]], align 4
74 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE10]]
75 ; DEFAULT: pred.store.continue10:
76 ; DEFAULT-NEXT: [[TMP27:%.*]] = extractelement <4 x i1> [[TMP2]], i32 2
77 ; DEFAULT-NEXT: br i1 [[TMP27]], label [[PRED_STORE_IF11:%.*]], label [[PRED_STORE_CONTINUE12:%.*]]
78 ; DEFAULT: pred.store.if11:
79 ; DEFAULT-NEXT: [[TMP28:%.*]] = add i64 [[OFFSET_IDX]], 6
80 ; DEFAULT-NEXT: [[TMP29:%.*]] = add i64 [[TMP28]], 1
81 ; DEFAULT-NEXT: [[TMP30:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP29]]
82 ; DEFAULT-NEXT: store i32 1, ptr [[TMP30]], align 4
83 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE12]]
84 ; DEFAULT: pred.store.continue12:
85 ; DEFAULT-NEXT: [[TMP31:%.*]] = extractelement <4 x i1> [[TMP2]], i32 3
86 ; DEFAULT-NEXT: br i1 [[TMP31]], label [[PRED_STORE_IF13:%.*]], label [[PRED_STORE_CONTINUE14]]
87 ; DEFAULT: pred.store.if13:
88 ; DEFAULT-NEXT: [[TMP32:%.*]] = add i64 [[OFFSET_IDX]], 7
89 ; DEFAULT-NEXT: [[TMP33:%.*]] = add i64 [[TMP32]], 1
90 ; DEFAULT-NEXT: [[TMP34:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP33]]
91 ; DEFAULT-NEXT: store i32 1, ptr [[TMP34]], align 4
92 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE14]]
93 ; DEFAULT: pred.store.continue14:
94 ; DEFAULT-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 8
95 ; DEFAULT-NEXT: [[TMP35:%.*]] = icmp eq i64 [[INDEX_NEXT]], 96
96 ; DEFAULT-NEXT: br i1 [[TMP35]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
97 ; DEFAULT: middle.block:
98 ; DEFAULT-NEXT: br i1 false, label [[EXIT:%.*]], label [[SCALAR_PH]]
100 ; DEFAULT-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 97, [[MIDDLE_BLOCK]] ], [ 1, [[ENTRY:%.*]] ]
101 ; DEFAULT-NEXT: br label [[LOOP_HEADER:%.*]]
102 ; DEFAULT: loop.header:
103 ; DEFAULT-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP_LATCH:%.*]] ]
104 ; DEFAULT-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
105 ; DEFAULT-NEXT: [[CMP9:%.*]] = icmp eq i32 [[TMP0]], 0
106 ; DEFAULT-NEXT: br i1 [[CMP9]], label [[THEN:%.*]], label [[LOOP_LATCH]]
108 ; DEFAULT-NEXT: [[GEP:%.*]] = getelementptr i32, ptr [[DST]], i64 [[IV_NEXT]]
109 ; DEFAULT-NEXT: store i32 1, ptr [[GEP]], align 4
110 ; DEFAULT-NEXT: br label [[LOOP_LATCH]]
111 ; DEFAULT: loop.latch:
112 ; DEFAULT-NEXT: [[EC:%.*]] = icmp eq i64 [[IV]], 100
113 ; DEFAULT-NEXT: br i1 [[EC]], label [[EXIT]], label [[LOOP_HEADER]], !llvm.loop [[LOOP3:![0-9]+]]
115 ; DEFAULT-NEXT: ret void
117 ; PRED-LABEL: define void @invar_cond_gep_store(
118 ; PRED-SAME: ptr [[DST:%.*]], i32 [[TMP0:%.*]]) {
120 ; PRED-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
122 ; PRED-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x i32> poison, i32 [[TMP0]], i64 0
123 ; PRED-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x i32> [[BROADCAST_SPLATINSERT]], <4 x i32> poison, <4 x i32> zeroinitializer
124 ; PRED-NEXT: br label [[VECTOR_BODY:%.*]]
126 ; PRED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_STORE_CONTINUE6:%.*]] ]
127 ; PRED-NEXT: [[OFFSET_IDX:%.*]] = add i64 1, [[INDEX]]
128 ; PRED-NEXT: [[TMP1:%.*]] = icmp eq <4 x i32> [[BROADCAST_SPLAT]], zeroinitializer
129 ; PRED-NEXT: [[TMP2:%.*]] = extractelement <4 x i1> [[TMP1]], i32 0
130 ; PRED-NEXT: br i1 [[TMP2]], label [[PRED_STORE_IF:%.*]], label [[PRED_STORE_CONTINUE:%.*]]
131 ; PRED: pred.store.if:
132 ; PRED-NEXT: [[TMP3:%.*]] = add i64 [[OFFSET_IDX]], 0
133 ; PRED-NEXT: [[TMP4:%.*]] = add i64 [[TMP3]], 1
134 ; PRED-NEXT: [[TMP5:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP4]]
135 ; PRED-NEXT: store i32 1, ptr [[TMP5]], align 4
136 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE]]
137 ; PRED: pred.store.continue:
138 ; PRED-NEXT: [[TMP6:%.*]] = extractelement <4 x i1> [[TMP1]], i32 1
139 ; PRED-NEXT: br i1 [[TMP6]], label [[PRED_STORE_IF1:%.*]], label [[PRED_STORE_CONTINUE2:%.*]]
140 ; PRED: pred.store.if1:
141 ; PRED-NEXT: [[TMP7:%.*]] = add i64 [[OFFSET_IDX]], 1
142 ; PRED-NEXT: [[TMP8:%.*]] = add i64 [[TMP7]], 1
143 ; PRED-NEXT: [[TMP9:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP8]]
144 ; PRED-NEXT: store i32 1, ptr [[TMP9]], align 4
145 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE2]]
146 ; PRED: pred.store.continue2:
147 ; PRED-NEXT: [[TMP10:%.*]] = extractelement <4 x i1> [[TMP1]], i32 2
148 ; PRED-NEXT: br i1 [[TMP10]], label [[PRED_STORE_IF3:%.*]], label [[PRED_STORE_CONTINUE4:%.*]]
149 ; PRED: pred.store.if3:
150 ; PRED-NEXT: [[TMP11:%.*]] = add i64 [[OFFSET_IDX]], 2
151 ; PRED-NEXT: [[TMP12:%.*]] = add i64 [[TMP11]], 1
152 ; PRED-NEXT: [[TMP13:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP12]]
153 ; PRED-NEXT: store i32 1, ptr [[TMP13]], align 4
154 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE4]]
155 ; PRED: pred.store.continue4:
156 ; PRED-NEXT: [[TMP14:%.*]] = extractelement <4 x i1> [[TMP1]], i32 3
157 ; PRED-NEXT: br i1 [[TMP14]], label [[PRED_STORE_IF5:%.*]], label [[PRED_STORE_CONTINUE6]]
158 ; PRED: pred.store.if5:
159 ; PRED-NEXT: [[TMP15:%.*]] = add i64 [[OFFSET_IDX]], 3
160 ; PRED-NEXT: [[TMP16:%.*]] = add i64 [[TMP15]], 1
161 ; PRED-NEXT: [[TMP17:%.*]] = getelementptr i32, ptr [[DST]], i64 [[TMP16]]
162 ; PRED-NEXT: store i32 1, ptr [[TMP17]], align 4
163 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE6]]
164 ; PRED: pred.store.continue6:
165 ; PRED-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
166 ; PRED-NEXT: [[TMP18:%.*]] = icmp eq i64 [[INDEX_NEXT]], 100
167 ; PRED-NEXT: br i1 [[TMP18]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
168 ; PRED: middle.block:
169 ; PRED-NEXT: br i1 true, label [[EXIT:%.*]], label [[SCALAR_PH]]
171 ; PRED-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 101, [[MIDDLE_BLOCK]] ], [ 1, [[ENTRY:%.*]] ]
172 ; PRED-NEXT: br label [[LOOP_HEADER:%.*]]
174 ; PRED-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP_LATCH:%.*]] ]
175 ; PRED-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
176 ; PRED-NEXT: [[CMP9:%.*]] = icmp eq i32 [[TMP0]], 0
177 ; PRED-NEXT: br i1 [[CMP9]], label [[THEN:%.*]], label [[LOOP_LATCH]]
179 ; PRED-NEXT: [[GEP:%.*]] = getelementptr i32, ptr [[DST]], i64 [[IV_NEXT]]
180 ; PRED-NEXT: store i32 1, ptr [[GEP]], align 4
181 ; PRED-NEXT: br label [[LOOP_LATCH]]
183 ; PRED-NEXT: [[EC:%.*]] = icmp eq i64 [[IV]], 100
184 ; PRED-NEXT: br i1 [[EC]], label [[EXIT]], label [[LOOP_HEADER]], !llvm.loop [[LOOP3:![0-9]+]]
186 ; PRED-NEXT: ret void
189 br label %loop.header
192 %iv = phi i64 [ 1, %entry ], [ %iv.next, %loop.latch ]
193 %iv.next = add i64 %iv, 1
194 %cmp9 = icmp eq i32 %0, 0
195 br i1 %cmp9, label %then, label %loop.latch
198 %gep = getelementptr i32, ptr %dst, i64 %iv.next
199 store i32 1, ptr %gep, align 4
203 %ec = icmp eq i64 %iv, 100
204 br i1 %ec, label %exit, label %loop.header
210 declare double @llvm.fabs.f64(double) #0
212 define void @loop_dependent_cond(ptr %src, ptr noalias %dst, i64 %N) {
213 ; DEFAULT-LABEL: define void @loop_dependent_cond(
214 ; DEFAULT-SAME: ptr [[SRC:%.*]], ptr noalias [[DST:%.*]], i64 [[N:%.*]]) {
215 ; DEFAULT-NEXT: entry:
216 ; DEFAULT-NEXT: [[TMP0:%.*]] = add i64 [[N]], 1
217 ; DEFAULT-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP0]], 4
218 ; DEFAULT-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
219 ; DEFAULT: vector.ph:
220 ; DEFAULT-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[TMP0]], 4
221 ; DEFAULT-NEXT: [[N_VEC:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF]]
222 ; DEFAULT-NEXT: br label [[VECTOR_BODY:%.*]]
223 ; DEFAULT: vector.body:
224 ; DEFAULT-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_STORE_CONTINUE7:%.*]] ]
225 ; DEFAULT-NEXT: [[TMP1:%.*]] = add i64 [[INDEX]], 0
226 ; DEFAULT-NEXT: [[TMP2:%.*]] = add i64 [[INDEX]], 2
227 ; DEFAULT-NEXT: [[TMP3:%.*]] = getelementptr double, ptr [[SRC]], i64 [[TMP1]]
228 ; DEFAULT-NEXT: [[TMP4:%.*]] = getelementptr double, ptr [[SRC]], i64 [[TMP2]]
229 ; DEFAULT-NEXT: [[TMP5:%.*]] = getelementptr double, ptr [[TMP3]], i32 0
230 ; DEFAULT-NEXT: [[TMP6:%.*]] = getelementptr double, ptr [[TMP3]], i32 2
231 ; DEFAULT-NEXT: [[WIDE_LOAD:%.*]] = load <2 x double>, ptr [[TMP5]], align 8
232 ; DEFAULT-NEXT: [[WIDE_LOAD1:%.*]] = load <2 x double>, ptr [[TMP6]], align 8
233 ; DEFAULT-NEXT: [[TMP7:%.*]] = call <2 x double> @llvm.fabs.v2f64(<2 x double> [[WIDE_LOAD]])
234 ; DEFAULT-NEXT: [[TMP8:%.*]] = call <2 x double> @llvm.fabs.v2f64(<2 x double> [[WIDE_LOAD1]])
235 ; DEFAULT-NEXT: [[TMP9:%.*]] = fcmp ogt <2 x double> [[TMP7]], <double 1.000000e+00, double 1.000000e+00>
236 ; DEFAULT-NEXT: [[TMP10:%.*]] = fcmp ogt <2 x double> [[TMP8]], <double 1.000000e+00, double 1.000000e+00>
237 ; DEFAULT-NEXT: [[TMP11:%.*]] = extractelement <2 x i1> [[TMP9]], i32 0
238 ; DEFAULT-NEXT: br i1 [[TMP11]], label [[PRED_STORE_IF:%.*]], label [[PRED_STORE_CONTINUE:%.*]]
239 ; DEFAULT: pred.store.if:
240 ; DEFAULT-NEXT: store i32 0, ptr [[DST]], align 4
241 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE]]
242 ; DEFAULT: pred.store.continue:
243 ; DEFAULT-NEXT: [[TMP12:%.*]] = extractelement <2 x i1> [[TMP9]], i32 1
244 ; DEFAULT-NEXT: br i1 [[TMP12]], label [[PRED_STORE_IF2:%.*]], label [[PRED_STORE_CONTINUE3:%.*]]
245 ; DEFAULT: pred.store.if2:
246 ; DEFAULT-NEXT: store i32 0, ptr [[DST]], align 4
247 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE3]]
248 ; DEFAULT: pred.store.continue3:
249 ; DEFAULT-NEXT: [[TMP13:%.*]] = extractelement <2 x i1> [[TMP10]], i32 0
250 ; DEFAULT-NEXT: br i1 [[TMP13]], label [[PRED_STORE_IF4:%.*]], label [[PRED_STORE_CONTINUE5:%.*]]
251 ; DEFAULT: pred.store.if4:
252 ; DEFAULT-NEXT: store i32 0, ptr [[DST]], align 4
253 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE5]]
254 ; DEFAULT: pred.store.continue5:
255 ; DEFAULT-NEXT: [[TMP14:%.*]] = extractelement <2 x i1> [[TMP10]], i32 1
256 ; DEFAULT-NEXT: br i1 [[TMP14]], label [[PRED_STORE_IF6:%.*]], label [[PRED_STORE_CONTINUE7]]
257 ; DEFAULT: pred.store.if6:
258 ; DEFAULT-NEXT: store i32 0, ptr [[DST]], align 4
259 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE7]]
260 ; DEFAULT: pred.store.continue7:
261 ; DEFAULT-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 4
262 ; DEFAULT-NEXT: [[TMP15:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
263 ; DEFAULT-NEXT: br i1 [[TMP15]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP4:![0-9]+]]
264 ; DEFAULT: middle.block:
265 ; DEFAULT-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[TMP0]], [[N_VEC]]
266 ; DEFAULT-NEXT: br i1 [[CMP_N]], label [[FOR_END123:%.*]], label [[SCALAR_PH]]
267 ; DEFAULT: scalar.ph:
268 ; DEFAULT-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ]
269 ; DEFAULT-NEXT: br label [[FOR_BODY112:%.*]]
270 ; DEFAULT: loop.header:
271 ; DEFAULT-NEXT: [[IV175:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT176:%.*]], [[FOR_INC121:%.*]] ]
272 ; DEFAULT-NEXT: [[ARRAYIDX114:%.*]] = getelementptr double, ptr [[SRC]], i64 [[IV175]]
273 ; DEFAULT-NEXT: [[TMP16:%.*]] = load double, ptr [[ARRAYIDX114]], align 8
274 ; DEFAULT-NEXT: [[TMP17:%.*]] = tail call double @llvm.fabs.f64(double [[TMP16]])
275 ; DEFAULT-NEXT: [[CMP115:%.*]] = fcmp ogt double [[TMP17]], 1.000000e+00
276 ; DEFAULT-NEXT: br i1 [[CMP115]], label [[IF_THEN117:%.*]], label [[FOR_INC121]]
278 ; DEFAULT-NEXT: store i32 0, ptr [[DST]], align 4
279 ; DEFAULT-NEXT: br label [[FOR_INC121]]
280 ; DEFAULT: loop.latch:
281 ; DEFAULT-NEXT: [[IV_NEXT176]] = add i64 [[IV175]], 1
282 ; DEFAULT-NEXT: [[EXITCOND180_NOT:%.*]] = icmp eq i64 [[IV175]], [[N]]
283 ; DEFAULT-NEXT: br i1 [[EXITCOND180_NOT]], label [[FOR_END123]], label [[FOR_BODY112]], !llvm.loop [[LOOP5:![0-9]+]]
285 ; DEFAULT-NEXT: ret void
287 ; PRED-LABEL: define void @loop_dependent_cond(
288 ; PRED-SAME: ptr [[SRC:%.*]], ptr noalias [[DST:%.*]], i64 [[N:%.*]]) {
290 ; PRED-NEXT: br label [[FOR_BODY112:%.*]]
292 ; PRED-NEXT: [[IV175:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT176:%.*]], [[FOR_INC121:%.*]] ]
293 ; PRED-NEXT: [[ARRAYIDX114:%.*]] = getelementptr double, ptr [[SRC]], i64 [[IV175]]
294 ; PRED-NEXT: [[TMP0:%.*]] = load double, ptr [[ARRAYIDX114]], align 8
295 ; PRED-NEXT: [[TMP1:%.*]] = tail call double @llvm.fabs.f64(double [[TMP0]])
296 ; PRED-NEXT: [[CMP115:%.*]] = fcmp ogt double [[TMP1]], 1.000000e+00
297 ; PRED-NEXT: br i1 [[CMP115]], label [[IF_THEN117:%.*]], label [[FOR_INC121]]
299 ; PRED-NEXT: store i32 0, ptr [[DST]], align 4
300 ; PRED-NEXT: br label [[FOR_INC121]]
302 ; PRED-NEXT: [[IV_NEXT176]] = add i64 [[IV175]], 1
303 ; PRED-NEXT: [[EXITCOND180_NOT:%.*]] = icmp eq i64 [[IV175]], [[N]]
304 ; PRED-NEXT: br i1 [[EXITCOND180_NOT]], label [[FOR_END123:%.*]], label [[FOR_BODY112]]
306 ; PRED-NEXT: ret void
309 br label %loop.header
312 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
313 %gep = getelementptr double, ptr %src, i64 %iv
314 %l = load double, ptr %gep, align 8
315 %abs = tail call double @llvm.fabs.f64(double %l)
316 %cmp = fcmp ogt double %abs, 1.000000e+00
317 br i1 %cmp, label %then, label %loop.latch
320 store i32 0, ptr %dst, align 4
324 %iv.next = add i64 %iv, 1
325 %ec = icmp eq i64 %iv, %N
326 br i1 %ec, label %exit, label %loop.header
332 define void @invar_cond_chain_1(ptr %I, ptr noalias %src, i1 %c) {
333 ; DEFAULT-LABEL: define void @invar_cond_chain_1(
334 ; DEFAULT-SAME: ptr [[I:%.*]], ptr noalias [[SRC:%.*]], i1 [[C:%.*]]) {
335 ; DEFAULT-NEXT: entry:
336 ; DEFAULT-NEXT: br label [[FOR_BODY313:%.*]]
337 ; DEFAULT: loop.header:
338 ; DEFAULT-NEXT: [[__BEGIN3_011973:%.*]] = phi ptr [ [[SRC]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR329:%.*]], [[IF_END327:%.*]] ]
339 ; DEFAULT-NEXT: [[TMP28:%.*]] = load i32, ptr [[__BEGIN3_011973]], align 4
340 ; DEFAULT-NEXT: br i1 true, label [[IF_ELSE321:%.*]], label [[IF_THEN316:%.*]]
342 ; DEFAULT-NEXT: br label [[IF_END327_SINK_SPLIT:%.*]]
344 ; DEFAULT-NEXT: br i1 [[C]], label [[IF_THEN323:%.*]], label [[IF_END327]]
346 ; DEFAULT-NEXT: br label [[IF_END327_SINK_SPLIT]]
348 ; DEFAULT-NEXT: store i32 [[TMP28]], ptr [[I]], align 4
349 ; DEFAULT-NEXT: br label [[IF_END327]]
350 ; DEFAULT: loop.latch:
351 ; DEFAULT-NEXT: [[INCDEC_PTR329]] = getelementptr inbounds i8, ptr [[__BEGIN3_011973]], i64 4
352 ; DEFAULT-NEXT: [[CMP311_NOT:%.*]] = icmp eq ptr [[__BEGIN3_011973]], [[I]]
353 ; DEFAULT-NEXT: br i1 [[CMP311_NOT]], label [[EXIT:%.*]], label [[FOR_BODY313]]
355 ; DEFAULT-NEXT: ret void
357 ; PRED-LABEL: define void @invar_cond_chain_1(
358 ; PRED-SAME: ptr [[I:%.*]], ptr noalias [[SRC:%.*]], i1 [[C:%.*]]) {
360 ; PRED-NEXT: br label [[FOR_BODY313:%.*]]
362 ; PRED-NEXT: [[__BEGIN3_011973:%.*]] = phi ptr [ [[SRC]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR329:%.*]], [[IF_END327:%.*]] ]
363 ; PRED-NEXT: [[TMP0:%.*]] = load i32, ptr [[__BEGIN3_011973]], align 4
364 ; PRED-NEXT: br i1 true, label [[IF_ELSE321:%.*]], label [[IF_THEN316:%.*]]
366 ; PRED-NEXT: br label [[IF_END327_SINK_SPLIT:%.*]]
368 ; PRED-NEXT: br i1 [[C]], label [[IF_THEN323:%.*]], label [[IF_END327]]
370 ; PRED-NEXT: br label [[IF_END327_SINK_SPLIT]]
372 ; PRED-NEXT: store i32 [[TMP0]], ptr [[I]], align 4
373 ; PRED-NEXT: br label [[IF_END327]]
375 ; PRED-NEXT: [[INCDEC_PTR329]] = getelementptr inbounds i8, ptr [[__BEGIN3_011973]], i64 4
376 ; PRED-NEXT: [[CMP311_NOT:%.*]] = icmp eq ptr [[__BEGIN3_011973]], [[I]]
377 ; PRED-NEXT: br i1 [[CMP311_NOT]], label [[FOR_COND_CLEANUP312_LOOPEXIT:%.*]], label [[FOR_BODY313]]
379 ; PRED-NEXT: ret void
382 br label %loop.header
385 %ptr.iv = phi ptr [ %src, %entry ], [ %ptr.iv.next, %loop.latch ]
386 %l = load i32, ptr %ptr.iv, align 4
387 br i1 true, label %else.1, label %if
393 br i1 %c, label %else.2, label %loop.latch
399 store i32 %l, ptr %I, align 4
403 %ptr.iv.next = getelementptr inbounds i8, ptr %ptr.iv, i64 4
404 %ec = icmp eq ptr %ptr.iv, %I
405 br i1 %ec, label %exit, label %loop.header
411 define void @invar_cond_chain_2(ptr %I, ptr noalias %src, ptr noalias %dst, i32 %a) {
412 ; DEFAULT-LABEL: define void @invar_cond_chain_2(
413 ; DEFAULT-SAME: ptr [[I:%.*]], ptr noalias [[SRC:%.*]], ptr noalias [[DST:%.*]], i32 [[A:%.*]]) {
414 ; DEFAULT-NEXT: entry:
415 ; DEFAULT-NEXT: br label [[FOR_BODY313:%.*]]
416 ; DEFAULT: loop.header:
417 ; DEFAULT-NEXT: [[__BEGIN3_01197:%.*]] = phi ptr [ [[SRC]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR329:%.*]], [[IF_END327:%.*]] ]
418 ; DEFAULT-NEXT: [[CMP315_NOT:%.*]] = icmp sgt i32 [[A]], 0
419 ; DEFAULT-NEXT: br i1 [[CMP315_NOT]], label [[IF_END327]], label [[IF_THEN316:%.*]]
421 ; DEFAULT-NEXT: br label [[IF_END327_SINK_SPLIT:%.*]]
423 ; DEFAULT-NEXT: store i32 0, ptr [[DST]], align 4
424 ; DEFAULT-NEXT: br label [[IF_END327]]
425 ; DEFAULT: loop.latch:
426 ; DEFAULT-NEXT: [[INCDEC_PTR329]] = getelementptr inbounds i8, ptr [[__BEGIN3_01197]], i64 4
427 ; DEFAULT-NEXT: [[CMP311_NOT:%.*]] = icmp eq ptr [[__BEGIN3_01197]], [[I]]
428 ; DEFAULT-NEXT: br i1 [[CMP311_NOT]], label [[EXIT:%.*]], label [[FOR_BODY313]]
430 ; DEFAULT-NEXT: ret void
432 ; PRED-LABEL: define void @invar_cond_chain_2(
433 ; PRED-SAME: ptr [[I:%.*]], ptr noalias [[SRC:%.*]], ptr noalias [[DST:%.*]], i32 [[A:%.*]]) {
435 ; PRED-NEXT: br label [[FOR_BODY313:%.*]]
437 ; PRED-NEXT: [[__BEGIN3_01197:%.*]] = phi ptr [ [[SRC]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR329:%.*]], [[IF_END327:%.*]] ]
438 ; PRED-NEXT: [[CMP315_NOT:%.*]] = icmp sgt i32 [[A]], 0
439 ; PRED-NEXT: br i1 [[CMP315_NOT]], label [[IF_END327]], label [[IF_THEN316:%.*]]
441 ; PRED-NEXT: br label [[IF_END327_SINK_SPLIT:%.*]]
443 ; PRED-NEXT: store i32 0, ptr [[DST]], align 4
444 ; PRED-NEXT: br label [[IF_END327]]
446 ; PRED-NEXT: [[INCDEC_PTR329]] = getelementptr inbounds i8, ptr [[__BEGIN3_01197]], i64 4
447 ; PRED-NEXT: [[CMP311_NOT:%.*]] = icmp eq ptr [[__BEGIN3_01197]], [[I]]
448 ; PRED-NEXT: br i1 [[CMP311_NOT]], label [[EXIT:%.*]], label [[FOR_BODY313]]
450 ; PRED-NEXT: ret void
453 br label %loop.header
456 %ptr.iv = phi ptr [ %src, %entry ], [ %ptr.iv.next, %loop.latch ]
457 %cmp315.not = icmp sgt i32 %a, 0
458 br i1 %cmp315.not, label %loop.latch, label %if
464 store i32 0, ptr %dst, align 4
468 %ptr.iv.next = getelementptr inbounds i8, ptr %ptr.iv, i64 4
469 %cmp311.not = icmp eq ptr %ptr.iv, %I
470 br i1 %cmp311.not, label %exit, label %loop.header
476 define void @latch_branch_cost(ptr %dst) {
477 ; DEFAULT-LABEL: define void @latch_branch_cost(
478 ; DEFAULT-SAME: ptr [[DST:%.*]]) {
479 ; DEFAULT-NEXT: iter.check:
480 ; DEFAULT-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
481 ; DEFAULT: vector.main.loop.iter.check:
482 ; DEFAULT-NEXT: br i1 false, label [[VEC_EPILOG_PH:%.*]], label [[VECTOR_PH1:%.*]]
483 ; DEFAULT: vector.ph:
484 ; DEFAULT-NEXT: br label [[VECTOR_BODY:%.*]]
485 ; DEFAULT: vector.body:
486 ; DEFAULT-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH1]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
487 ; DEFAULT-NEXT: [[TMP0:%.*]] = add i64 [[INDEX]], 0
488 ; DEFAULT-NEXT: [[TMP1:%.*]] = add i64 [[INDEX]], 16
489 ; DEFAULT-NEXT: [[TMP2:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP0]]
490 ; DEFAULT-NEXT: [[TMP3:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP1]]
491 ; DEFAULT-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[TMP2]], i32 0
492 ; DEFAULT-NEXT: [[TMP5:%.*]] = getelementptr i8, ptr [[TMP2]], i32 16
493 ; DEFAULT-NEXT: store <16 x i8> zeroinitializer, ptr [[TMP6]], align 1
494 ; DEFAULT-NEXT: store <16 x i8> zeroinitializer, ptr [[TMP5]], align 1
495 ; DEFAULT-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 32
496 ; DEFAULT-NEXT: [[TMP4:%.*]] = icmp eq i64 [[INDEX_NEXT]], 96
497 ; DEFAULT-NEXT: br i1 [[TMP4]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP6:![0-9]+]]
498 ; DEFAULT: middle.block:
499 ; DEFAULT-NEXT: br i1 false, label [[FOR_END:%.*]], label [[VEC_EPILOG_ITER_CHECK:%.*]]
500 ; DEFAULT: vec.epilog.iter.check:
501 ; DEFAULT-NEXT: br i1 false, label [[SCALAR_PH]], label [[VEC_EPILOG_PH]]
502 ; DEFAULT: vec.epilog.ph:
503 ; DEFAULT-NEXT: [[VEC_EPILOG_RESUME_VAL:%.*]] = phi i64 [ 96, [[VEC_EPILOG_ITER_CHECK]] ], [ 0, [[VECTOR_PH]] ]
504 ; DEFAULT-NEXT: br label [[VEC_EPILOG_VECTOR_BODY:%.*]]
505 ; DEFAULT: vec.epilog.vector.body:
506 ; DEFAULT-NEXT: [[INDEX1:%.*]] = phi i64 [ [[VEC_EPILOG_RESUME_VAL]], [[VEC_EPILOG_PH]] ], [ [[INDEX_NEXT2:%.*]], [[VEC_EPILOG_VECTOR_BODY]] ]
507 ; DEFAULT-NEXT: [[TMP7:%.*]] = add i64 [[INDEX1]], 0
508 ; DEFAULT-NEXT: [[TMP8:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP7]]
509 ; DEFAULT-NEXT: [[TMP9:%.*]] = getelementptr i8, ptr [[TMP8]], i32 0
510 ; DEFAULT-NEXT: store <4 x i8> zeroinitializer, ptr [[TMP9]], align 1
511 ; DEFAULT-NEXT: [[INDEX_NEXT2]] = add nuw i64 [[INDEX1]], 4
512 ; DEFAULT-NEXT: [[TMP10:%.*]] = icmp eq i64 [[INDEX_NEXT2]], 100
513 ; DEFAULT-NEXT: br i1 [[TMP10]], label [[VEC_EPILOG_MIDDLE_BLOCK:%.*]], label [[VEC_EPILOG_VECTOR_BODY]], !llvm.loop [[LOOP7:![0-9]+]]
514 ; DEFAULT: vec.epilog.middle.block:
515 ; DEFAULT-NEXT: br i1 true, label [[FOR_END]], label [[SCALAR_PH]]
516 ; DEFAULT: vec.epilog.scalar.ph:
517 ; DEFAULT-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 100, [[VEC_EPILOG_MIDDLE_BLOCK]] ], [ 96, [[VEC_EPILOG_ITER_CHECK]] ], [ 0, [[ITER_CHECK:%.*]] ]
518 ; DEFAULT-NEXT: br label [[FOR_BODY:%.*]]
520 ; DEFAULT-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
521 ; DEFAULT-NEXT: [[ARRAYIDX:%.*]] = getelementptr i8, ptr [[DST]], i64 [[INDVARS_IV]]
522 ; DEFAULT-NEXT: store i8 0, ptr [[ARRAYIDX]], align 1
523 ; DEFAULT-NEXT: [[INDVARS_IV_NEXT]] = add i64 [[INDVARS_IV]], 1
524 ; DEFAULT-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], 100
525 ; DEFAULT-NEXT: br i1 [[EXITCOND_NOT]], label [[FOR_END]], label [[FOR_BODY]], !llvm.loop [[LOOP8:![0-9]+]]
527 ; DEFAULT-NEXT: ret void
529 ; PRED-LABEL: define void @latch_branch_cost(
530 ; PRED-SAME: ptr [[DST:%.*]]) {
532 ; PRED-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
534 ; PRED-NEXT: br label [[VECTOR_BODY:%.*]]
536 ; PRED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_STORE_CONTINUE6:%.*]] ]
537 ; PRED-NEXT: [[VEC_IND:%.*]] = phi <8 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7>, [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[PRED_STORE_CONTINUE6]] ]
538 ; PRED-NEXT: [[TMP0:%.*]] = icmp ule <8 x i64> [[VEC_IND]], <i64 99, i64 99, i64 99, i64 99, i64 99, i64 99, i64 99, i64 99>
539 ; PRED-NEXT: [[TMP1:%.*]] = extractelement <8 x i1> [[TMP0]], i32 0
540 ; PRED-NEXT: br i1 [[TMP1]], label [[PRED_STORE_IF:%.*]], label [[PRED_STORE_CONTINUE:%.*]]
541 ; PRED: pred.store.if:
542 ; PRED-NEXT: [[TMP2:%.*]] = add i64 [[INDEX]], 0
543 ; PRED-NEXT: [[TMP3:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP2]]
544 ; PRED-NEXT: store i8 0, ptr [[TMP3]], align 1
545 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE]]
546 ; PRED: pred.store.continue:
547 ; PRED-NEXT: [[TMP4:%.*]] = extractelement <8 x i1> [[TMP0]], i32 1
548 ; PRED-NEXT: br i1 [[TMP4]], label [[PRED_STORE_IF1:%.*]], label [[PRED_STORE_CONTINUE2:%.*]]
549 ; PRED: pred.store.if1:
550 ; PRED-NEXT: [[TMP5:%.*]] = add i64 [[INDEX]], 1
551 ; PRED-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP5]]
552 ; PRED-NEXT: store i8 0, ptr [[TMP6]], align 1
553 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE2]]
554 ; PRED: pred.store.continue2:
555 ; PRED-NEXT: [[TMP7:%.*]] = extractelement <8 x i1> [[TMP0]], i32 2
556 ; PRED-NEXT: br i1 [[TMP7]], label [[PRED_STORE_IF3:%.*]], label [[PRED_STORE_CONTINUE4:%.*]]
557 ; PRED: pred.store.if3:
558 ; PRED-NEXT: [[TMP8:%.*]] = add i64 [[INDEX]], 2
559 ; PRED-NEXT: [[TMP9:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP8]]
560 ; PRED-NEXT: store i8 0, ptr [[TMP9]], align 1
561 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE4]]
562 ; PRED: pred.store.continue4:
563 ; PRED-NEXT: [[TMP10:%.*]] = extractelement <8 x i1> [[TMP0]], i32 3
564 ; PRED-NEXT: br i1 [[TMP10]], label [[PRED_STORE_IF5:%.*]], label [[PRED_STORE_CONTINUE7:%.*]]
565 ; PRED: pred.store.if5:
566 ; PRED-NEXT: [[TMP11:%.*]] = add i64 [[INDEX]], 3
567 ; PRED-NEXT: [[TMP12:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP11]]
568 ; PRED-NEXT: store i8 0, ptr [[TMP12]], align 1
569 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE7]]
570 ; PRED: pred.store.continue6:
571 ; PRED-NEXT: [[TMP13:%.*]] = extractelement <8 x i1> [[TMP0]], i32 4
572 ; PRED-NEXT: br i1 [[TMP13]], label [[PRED_STORE_IF7:%.*]], label [[PRED_STORE_CONTINUE8:%.*]]
573 ; PRED: pred.store.if7:
574 ; PRED-NEXT: [[TMP14:%.*]] = add i64 [[INDEX]], 4
575 ; PRED-NEXT: [[TMP15:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP14]]
576 ; PRED-NEXT: store i8 0, ptr [[TMP15]], align 1
577 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE8]]
578 ; PRED: pred.store.continue8:
579 ; PRED-NEXT: [[TMP16:%.*]] = extractelement <8 x i1> [[TMP0]], i32 5
580 ; PRED-NEXT: br i1 [[TMP16]], label [[PRED_STORE_IF9:%.*]], label [[PRED_STORE_CONTINUE10:%.*]]
581 ; PRED: pred.store.if9:
582 ; PRED-NEXT: [[TMP17:%.*]] = add i64 [[INDEX]], 5
583 ; PRED-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP17]]
584 ; PRED-NEXT: store i8 0, ptr [[TMP18]], align 1
585 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE10]]
586 ; PRED: pred.store.continue10:
587 ; PRED-NEXT: [[TMP19:%.*]] = extractelement <8 x i1> [[TMP0]], i32 6
588 ; PRED-NEXT: br i1 [[TMP19]], label [[PRED_STORE_IF11:%.*]], label [[PRED_STORE_CONTINUE12:%.*]]
589 ; PRED: pred.store.if11:
590 ; PRED-NEXT: [[TMP20:%.*]] = add i64 [[INDEX]], 6
591 ; PRED-NEXT: [[TMP21:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP20]]
592 ; PRED-NEXT: store i8 0, ptr [[TMP21]], align 1
593 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE12]]
594 ; PRED: pred.store.continue12:
595 ; PRED-NEXT: [[TMP22:%.*]] = extractelement <8 x i1> [[TMP0]], i32 7
596 ; PRED-NEXT: br i1 [[TMP22]], label [[PRED_STORE_IF13:%.*]], label [[PRED_STORE_CONTINUE6]]
597 ; PRED: pred.store.if13:
598 ; PRED-NEXT: [[TMP23:%.*]] = add i64 [[INDEX]], 7
599 ; PRED-NEXT: [[TMP24:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP23]]
600 ; PRED-NEXT: store i8 0, ptr [[TMP24]], align 1
601 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE6]]
602 ; PRED: pred.store.continue14:
603 ; PRED-NEXT: [[INDEX_NEXT]] = add i64 [[INDEX]], 8
604 ; PRED-NEXT: [[VEC_IND_NEXT]] = add <8 x i64> [[VEC_IND]], <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8>
605 ; PRED-NEXT: [[TMP25:%.*]] = icmp eq i64 [[INDEX_NEXT]], 104
606 ; PRED-NEXT: br i1 [[TMP25]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP4:![0-9]+]]
607 ; PRED: middle.block:
608 ; PRED-NEXT: br i1 true, label [[FOR_END:%.*]], label [[SCALAR_PH]]
610 ; PRED-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 104, [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ]
611 ; PRED-NEXT: br label [[FOR_BODY:%.*]]
613 ; PRED-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]
614 ; PRED-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[DST]], i64 [[IV]]
615 ; PRED-NEXT: store i8 0, ptr [[GEP]], align 1
616 ; PRED-NEXT: [[INDVARS_IV_NEXT]] = add i64 [[IV]], 1
617 ; PRED-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], 100
618 ; PRED-NEXT: br i1 [[EXITCOND_NOT]], label [[FOR_END]], label [[FOR_BODY]], !llvm.loop [[LOOP5:![0-9]+]]
620 ; PRED-NEXT: ret void
626 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
627 %gep = getelementptr i8, ptr %dst, i64 %iv
628 store i8 0, ptr %gep, align 1
629 %iv.next = add i64 %iv, 1
630 %ec = icmp eq i64 %iv.next, 100
631 br i1 %ec, label %exit, label %loop
637 define i32 @header_mask_and_invariant_compare(ptr %A, ptr %B, ptr %C, ptr %D, ptr %E, i64 %N) "target-features"="+sve" {
638 ; DEFAULT-LABEL: define i32 @header_mask_and_invariant_compare(
639 ; DEFAULT-SAME: ptr [[A:%.*]], ptr [[B:%.*]], ptr [[C:%.*]], ptr [[D:%.*]], ptr [[E:%.*]], i64 [[N:%.*]]) #[[ATTR1:[0-9]+]] {
640 ; DEFAULT-NEXT: entry:
641 ; DEFAULT-NEXT: [[TMP0:%.*]] = add i64 [[N]], 1
642 ; DEFAULT-NEXT: [[TMP1:%.*]] = call i64 @llvm.vscale.i64()
643 ; DEFAULT-NEXT: [[TMP2:%.*]] = mul i64 [[TMP1]], 4
644 ; DEFAULT-NEXT: [[TMP3:%.*]] = call i64 @llvm.umax.i64(i64 64, i64 [[TMP2]])
645 ; DEFAULT-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP0]], [[TMP3]]
646 ; DEFAULT-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_MEMCHECK:%.*]]
647 ; DEFAULT: vector.memcheck:
648 ; DEFAULT-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[E]], i64 4
649 ; DEFAULT-NEXT: [[TMP4:%.*]] = shl i64 [[N]], 2
650 ; DEFAULT-NEXT: [[TMP5:%.*]] = add i64 [[TMP4]], 4
651 ; DEFAULT-NEXT: [[SCEVGEP1:%.*]] = getelementptr i8, ptr [[D]], i64 [[TMP5]]
652 ; DEFAULT-NEXT: [[SCEVGEP2:%.*]] = getelementptr i8, ptr [[A]], i64 4
653 ; DEFAULT-NEXT: [[SCEVGEP3:%.*]] = getelementptr i8, ptr [[B]], i64 4
654 ; DEFAULT-NEXT: [[SCEVGEP4:%.*]] = getelementptr i8, ptr [[C]], i64 4
655 ; DEFAULT-NEXT: [[BOUND0:%.*]] = icmp ult ptr [[E]], [[SCEVGEP1]]
656 ; DEFAULT-NEXT: [[BOUND1:%.*]] = icmp ult ptr [[D]], [[SCEVGEP]]
657 ; DEFAULT-NEXT: [[FOUND_CONFLICT:%.*]] = and i1 [[BOUND0]], [[BOUND1]]
658 ; DEFAULT-NEXT: [[BOUND05:%.*]] = icmp ult ptr [[E]], [[SCEVGEP2]]
659 ; DEFAULT-NEXT: [[BOUND16:%.*]] = icmp ult ptr [[A]], [[SCEVGEP]]
660 ; DEFAULT-NEXT: [[FOUND_CONFLICT7:%.*]] = and i1 [[BOUND05]], [[BOUND16]]
661 ; DEFAULT-NEXT: [[CONFLICT_RDX:%.*]] = or i1 [[FOUND_CONFLICT]], [[FOUND_CONFLICT7]]
662 ; DEFAULT-NEXT: [[BOUND08:%.*]] = icmp ult ptr [[E]], [[SCEVGEP3]]
663 ; DEFAULT-NEXT: [[BOUND19:%.*]] = icmp ult ptr [[B]], [[SCEVGEP]]
664 ; DEFAULT-NEXT: [[FOUND_CONFLICT10:%.*]] = and i1 [[BOUND08]], [[BOUND19]]
665 ; DEFAULT-NEXT: [[CONFLICT_RDX11:%.*]] = or i1 [[CONFLICT_RDX]], [[FOUND_CONFLICT10]]
666 ; DEFAULT-NEXT: [[BOUND012:%.*]] = icmp ult ptr [[E]], [[SCEVGEP4]]
667 ; DEFAULT-NEXT: [[BOUND113:%.*]] = icmp ult ptr [[C]], [[SCEVGEP]]
668 ; DEFAULT-NEXT: [[FOUND_CONFLICT14:%.*]] = and i1 [[BOUND012]], [[BOUND113]]
669 ; DEFAULT-NEXT: [[CONFLICT_RDX15:%.*]] = or i1 [[CONFLICT_RDX11]], [[FOUND_CONFLICT14]]
670 ; DEFAULT-NEXT: [[BOUND016:%.*]] = icmp ult ptr [[D]], [[SCEVGEP2]]
671 ; DEFAULT-NEXT: [[BOUND117:%.*]] = icmp ult ptr [[A]], [[SCEVGEP1]]
672 ; DEFAULT-NEXT: [[FOUND_CONFLICT18:%.*]] = and i1 [[BOUND016]], [[BOUND117]]
673 ; DEFAULT-NEXT: [[CONFLICT_RDX19:%.*]] = or i1 [[CONFLICT_RDX15]], [[FOUND_CONFLICT18]]
674 ; DEFAULT-NEXT: [[BOUND020:%.*]] = icmp ult ptr [[D]], [[SCEVGEP3]]
675 ; DEFAULT-NEXT: [[BOUND121:%.*]] = icmp ult ptr [[B]], [[SCEVGEP1]]
676 ; DEFAULT-NEXT: [[FOUND_CONFLICT22:%.*]] = and i1 [[BOUND020]], [[BOUND121]]
677 ; DEFAULT-NEXT: [[CONFLICT_RDX23:%.*]] = or i1 [[CONFLICT_RDX19]], [[FOUND_CONFLICT22]]
678 ; DEFAULT-NEXT: [[BOUND024:%.*]] = icmp ult ptr [[D]], [[SCEVGEP4]]
679 ; DEFAULT-NEXT: [[BOUND125:%.*]] = icmp ult ptr [[C]], [[SCEVGEP1]]
680 ; DEFAULT-NEXT: [[FOUND_CONFLICT26:%.*]] = and i1 [[BOUND024]], [[BOUND125]]
681 ; DEFAULT-NEXT: [[CONFLICT_RDX27:%.*]] = or i1 [[CONFLICT_RDX23]], [[FOUND_CONFLICT26]]
682 ; DEFAULT-NEXT: br i1 [[CONFLICT_RDX27]], label [[SCALAR_PH]], label [[VECTOR_PH:%.*]]
683 ; DEFAULT: vector.ph:
684 ; DEFAULT-NEXT: [[TMP6:%.*]] = call i64 @llvm.vscale.i64()
685 ; DEFAULT-NEXT: [[TMP7:%.*]] = mul i64 [[TMP6]], 4
686 ; DEFAULT-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[TMP0]], [[TMP7]]
687 ; DEFAULT-NEXT: [[N_VEC:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF]]
688 ; DEFAULT-NEXT: [[TMP8:%.*]] = call i64 @llvm.vscale.i64()
689 ; DEFAULT-NEXT: [[TMP9:%.*]] = mul i64 [[TMP8]], 4
690 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT32:%.*]] = insertelement <vscale x 4 x ptr> poison, ptr [[E]], i64 0
691 ; DEFAULT-NEXT: [[BROADCAST_SPLAT33:%.*]] = shufflevector <vscale x 4 x ptr> [[BROADCAST_SPLATINSERT32]], <vscale x 4 x ptr> poison, <vscale x 4 x i32> zeroinitializer
692 ; DEFAULT-NEXT: br label [[VECTOR_BODY:%.*]]
693 ; DEFAULT: vector.body:
694 ; DEFAULT-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
695 ; DEFAULT-NEXT: [[TMP10:%.*]] = add i64 [[INDEX]], 0
696 ; DEFAULT-NEXT: [[TMP11:%.*]] = load i32, ptr [[A]], align 4, !alias.scope [[META9:![0-9]+]]
697 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT28:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP11]], i64 0
698 ; DEFAULT-NEXT: [[BROADCAST_SPLAT29:%.*]] = shufflevector <vscale x 4 x i32> [[BROADCAST_SPLATINSERT28]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
699 ; DEFAULT-NEXT: [[TMP12:%.*]] = load i32, ptr [[B]], align 4, !alias.scope [[META12:![0-9]+]]
700 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP12]], i64 0
701 ; DEFAULT-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[BROADCAST_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
702 ; DEFAULT-NEXT: [[TMP13:%.*]] = or <vscale x 4 x i32> [[BROADCAST_SPLAT]], [[BROADCAST_SPLAT29]]
703 ; DEFAULT-NEXT: [[TMP14:%.*]] = load i32, ptr [[C]], align 4, !alias.scope [[META14:![0-9]+]]
704 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT30:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP14]], i64 0
705 ; DEFAULT-NEXT: [[BROADCAST_SPLAT31:%.*]] = shufflevector <vscale x 4 x i32> [[BROADCAST_SPLATINSERT30]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
706 ; DEFAULT-NEXT: [[TMP15:%.*]] = icmp ugt <vscale x 4 x i32> [[BROADCAST_SPLAT31]], [[TMP13]]
707 ; DEFAULT-NEXT: [[TMP16:%.*]] = getelementptr i32, ptr [[D]], i64 [[TMP10]]
708 ; DEFAULT-NEXT: call void @llvm.masked.scatter.nxv4i32.nxv4p0(<vscale x 4 x i32> [[TMP13]], <vscale x 4 x ptr> [[BROADCAST_SPLAT33]], i32 4, <vscale x 4 x i1> [[TMP15]]), !alias.scope [[META16:![0-9]+]], !noalias [[META18:![0-9]+]]
709 ; DEFAULT-NEXT: [[TMP17:%.*]] = getelementptr i32, ptr [[TMP16]], i32 0
710 ; DEFAULT-NEXT: call void @llvm.masked.store.nxv4i32.p0(<vscale x 4 x i32> zeroinitializer, ptr [[TMP17]], i32 4, <vscale x 4 x i1> [[TMP15]]), !alias.scope [[META20:![0-9]+]], !noalias [[META21:![0-9]+]]
711 ; DEFAULT-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], [[TMP9]]
712 ; DEFAULT-NEXT: [[TMP18:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
713 ; DEFAULT-NEXT: br i1 [[TMP18]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP22:![0-9]+]]
714 ; DEFAULT: middle.block:
715 ; DEFAULT-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[TMP0]], [[N_VEC]]
716 ; DEFAULT-NEXT: br i1 [[CMP_N]], label [[EXIT:%.*]], label [[SCALAR_PH]]
717 ; DEFAULT: scalar.ph:
718 ; DEFAULT-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ], [ 0, [[VECTOR_MEMCHECK]] ]
719 ; DEFAULT-NEXT: br label [[LOOP_HEADER:%.*]]
720 ; DEFAULT: loop.header:
721 ; DEFAULT-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP_LATCH:%.*]] ]
722 ; DEFAULT-NEXT: [[L_A:%.*]] = load i32, ptr [[A]], align 4
723 ; DEFAULT-NEXT: [[L_B:%.*]] = load i32, ptr [[B]], align 4
724 ; DEFAULT-NEXT: [[OR:%.*]] = or i32 [[L_B]], [[L_A]]
725 ; DEFAULT-NEXT: [[L_C:%.*]] = load i32, ptr [[C]], align 4
726 ; DEFAULT-NEXT: [[C_0:%.*]] = icmp ugt i32 [[L_C]], [[OR]]
727 ; DEFAULT-NEXT: br i1 [[C_0]], label [[IF_THEN:%.*]], label [[LOOP_LATCH]]
729 ; DEFAULT-NEXT: [[GEP_D:%.*]] = getelementptr i32, ptr [[D]], i64 [[IV]]
730 ; DEFAULT-NEXT: store i32 [[OR]], ptr [[E]], align 4
731 ; DEFAULT-NEXT: store i32 0, ptr [[GEP_D]], align 4
732 ; DEFAULT-NEXT: br label [[LOOP_LATCH]]
733 ; DEFAULT: loop.latch:
734 ; DEFAULT-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
735 ; DEFAULT-NEXT: [[C_1:%.*]] = icmp eq i64 [[IV]], [[N]]
736 ; DEFAULT-NEXT: br i1 [[C_1]], label [[EXIT]], label [[LOOP_HEADER]], !llvm.loop [[LOOP23:![0-9]+]]
738 ; DEFAULT-NEXT: ret i32 0
740 ; PRED-LABEL: define i32 @header_mask_and_invariant_compare(
741 ; PRED-SAME: ptr [[A:%.*]], ptr [[B:%.*]], ptr [[C:%.*]], ptr [[D:%.*]], ptr [[E:%.*]], i64 [[N:%.*]]) #[[ATTR1:[0-9]+]] {
743 ; PRED-NEXT: [[TMP0:%.*]] = add i64 [[N]], 1
744 ; PRED-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_MEMCHECK:%.*]]
745 ; PRED: vector.memcheck:
746 ; PRED-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[E]], i64 4
747 ; PRED-NEXT: [[TMP1:%.*]] = shl i64 [[N]], 2
748 ; PRED-NEXT: [[TMP2:%.*]] = add i64 [[TMP1]], 4
749 ; PRED-NEXT: [[SCEVGEP1:%.*]] = getelementptr i8, ptr [[D]], i64 [[TMP2]]
750 ; PRED-NEXT: [[SCEVGEP2:%.*]] = getelementptr i8, ptr [[A]], i64 4
751 ; PRED-NEXT: [[SCEVGEP3:%.*]] = getelementptr i8, ptr [[B]], i64 4
752 ; PRED-NEXT: [[SCEVGEP4:%.*]] = getelementptr i8, ptr [[C]], i64 4
753 ; PRED-NEXT: [[BOUND0:%.*]] = icmp ult ptr [[E]], [[SCEVGEP1]]
754 ; PRED-NEXT: [[BOUND1:%.*]] = icmp ult ptr [[D]], [[SCEVGEP]]
755 ; PRED-NEXT: [[FOUND_CONFLICT:%.*]] = and i1 [[BOUND0]], [[BOUND1]]
756 ; PRED-NEXT: [[BOUND05:%.*]] = icmp ult ptr [[E]], [[SCEVGEP2]]
757 ; PRED-NEXT: [[BOUND16:%.*]] = icmp ult ptr [[A]], [[SCEVGEP]]
758 ; PRED-NEXT: [[FOUND_CONFLICT7:%.*]] = and i1 [[BOUND05]], [[BOUND16]]
759 ; PRED-NEXT: [[CONFLICT_RDX:%.*]] = or i1 [[FOUND_CONFLICT]], [[FOUND_CONFLICT7]]
760 ; PRED-NEXT: [[BOUND08:%.*]] = icmp ult ptr [[E]], [[SCEVGEP3]]
761 ; PRED-NEXT: [[BOUND19:%.*]] = icmp ult ptr [[B]], [[SCEVGEP]]
762 ; PRED-NEXT: [[FOUND_CONFLICT10:%.*]] = and i1 [[BOUND08]], [[BOUND19]]
763 ; PRED-NEXT: [[CONFLICT_RDX11:%.*]] = or i1 [[CONFLICT_RDX]], [[FOUND_CONFLICT10]]
764 ; PRED-NEXT: [[BOUND012:%.*]] = icmp ult ptr [[E]], [[SCEVGEP4]]
765 ; PRED-NEXT: [[BOUND113:%.*]] = icmp ult ptr [[C]], [[SCEVGEP]]
766 ; PRED-NEXT: [[FOUND_CONFLICT14:%.*]] = and i1 [[BOUND012]], [[BOUND113]]
767 ; PRED-NEXT: [[CONFLICT_RDX15:%.*]] = or i1 [[CONFLICT_RDX11]], [[FOUND_CONFLICT14]]
768 ; PRED-NEXT: [[BOUND016:%.*]] = icmp ult ptr [[D]], [[SCEVGEP2]]
769 ; PRED-NEXT: [[BOUND117:%.*]] = icmp ult ptr [[A]], [[SCEVGEP1]]
770 ; PRED-NEXT: [[FOUND_CONFLICT18:%.*]] = and i1 [[BOUND016]], [[BOUND117]]
771 ; PRED-NEXT: [[CONFLICT_RDX19:%.*]] = or i1 [[CONFLICT_RDX15]], [[FOUND_CONFLICT18]]
772 ; PRED-NEXT: [[BOUND020:%.*]] = icmp ult ptr [[D]], [[SCEVGEP3]]
773 ; PRED-NEXT: [[BOUND121:%.*]] = icmp ult ptr [[B]], [[SCEVGEP1]]
774 ; PRED-NEXT: [[FOUND_CONFLICT22:%.*]] = and i1 [[BOUND020]], [[BOUND121]]
775 ; PRED-NEXT: [[CONFLICT_RDX23:%.*]] = or i1 [[CONFLICT_RDX19]], [[FOUND_CONFLICT22]]
776 ; PRED-NEXT: [[BOUND024:%.*]] = icmp ult ptr [[D]], [[SCEVGEP4]]
777 ; PRED-NEXT: [[BOUND125:%.*]] = icmp ult ptr [[C]], [[SCEVGEP1]]
778 ; PRED-NEXT: [[FOUND_CONFLICT26:%.*]] = and i1 [[BOUND024]], [[BOUND125]]
779 ; PRED-NEXT: [[CONFLICT_RDX27:%.*]] = or i1 [[CONFLICT_RDX23]], [[FOUND_CONFLICT26]]
780 ; PRED-NEXT: br i1 [[CONFLICT_RDX27]], label [[SCALAR_PH]], label [[VECTOR_PH:%.*]]
782 ; PRED-NEXT: [[TMP3:%.*]] = call i64 @llvm.vscale.i64()
783 ; PRED-NEXT: [[TMP4:%.*]] = mul i64 [[TMP3]], 4
784 ; PRED-NEXT: [[TMP7:%.*]] = sub i64 [[TMP4]], 1
785 ; PRED-NEXT: [[N_RND_UP:%.*]] = add i64 [[TMP0]], [[TMP7]]
786 ; PRED-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N_RND_UP]], [[TMP4]]
787 ; PRED-NEXT: [[N_VEC:%.*]] = sub i64 [[N_RND_UP]], [[N_MOD_VF]]
788 ; PRED-NEXT: [[TMP8:%.*]] = call i64 @llvm.vscale.i64()
789 ; PRED-NEXT: [[TMP9:%.*]] = mul i64 [[TMP8]], 4
790 ; PRED-NEXT: [[TMP10:%.*]] = call i64 @llvm.vscale.i64()
791 ; PRED-NEXT: [[TMP11:%.*]] = mul i64 [[TMP10]], 4
792 ; PRED-NEXT: [[TMP12:%.*]] = sub i64 [[TMP0]], [[TMP11]]
793 ; PRED-NEXT: [[TMP13:%.*]] = icmp ugt i64 [[TMP0]], [[TMP11]]
794 ; PRED-NEXT: [[TMP14:%.*]] = select i1 [[TMP13]], i64 [[TMP12]], i64 0
795 ; PRED-NEXT: [[ACTIVE_LANE_MASK_ENTRY:%.*]] = call <vscale x 4 x i1> @llvm.get.active.lane.mask.nxv4i1.i64(i64 0, i64 [[TMP0]])
796 ; PRED-NEXT: [[BROADCAST_SPLATINSERT32:%.*]] = insertelement <vscale x 4 x ptr> poison, ptr [[E]], i64 0
797 ; PRED-NEXT: [[BROADCAST_SPLAT33:%.*]] = shufflevector <vscale x 4 x ptr> [[BROADCAST_SPLATINSERT32]], <vscale x 4 x ptr> poison, <vscale x 4 x i32> zeroinitializer
798 ; PRED-NEXT: br label [[VECTOR_BODY:%.*]]
800 ; PRED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
801 ; PRED-NEXT: [[ACTIVE_LANE_MASK:%.*]] = phi <vscale x 4 x i1> [ [[ACTIVE_LANE_MASK_ENTRY]], [[VECTOR_PH]] ], [ [[ACTIVE_LANE_MASK_NEXT:%.*]], [[VECTOR_BODY]] ]
802 ; PRED-NEXT: [[TMP15:%.*]] = add i64 [[INDEX]], 0
803 ; PRED-NEXT: [[TMP16:%.*]] = load i32, ptr [[A]], align 4, !alias.scope [[META6:![0-9]+]]
804 ; PRED-NEXT: [[BROADCAST_SPLATINSERT28:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP16]], i64 0
805 ; PRED-NEXT: [[BROADCAST_SPLAT29:%.*]] = shufflevector <vscale x 4 x i32> [[BROADCAST_SPLATINSERT28]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
806 ; PRED-NEXT: [[TMP17:%.*]] = load i32, ptr [[B]], align 4, !alias.scope [[META9:![0-9]+]]
807 ; PRED-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP17]], i64 0
808 ; PRED-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[BROADCAST_SPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
809 ; PRED-NEXT: [[TMP18:%.*]] = or <vscale x 4 x i32> [[BROADCAST_SPLAT]], [[BROADCAST_SPLAT29]]
810 ; PRED-NEXT: [[TMP19:%.*]] = load i32, ptr [[C]], align 4, !alias.scope [[META11:![0-9]+]]
811 ; PRED-NEXT: [[BROADCAST_SPLATINSERT30:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP19]], i64 0
812 ; PRED-NEXT: [[BROADCAST_SPLAT31:%.*]] = shufflevector <vscale x 4 x i32> [[BROADCAST_SPLATINSERT30]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
813 ; PRED-NEXT: [[TMP20:%.*]] = icmp ugt <vscale x 4 x i32> [[BROADCAST_SPLAT31]], [[TMP18]]
814 ; PRED-NEXT: [[TMP21:%.*]] = select <vscale x 4 x i1> [[ACTIVE_LANE_MASK]], <vscale x 4 x i1> [[TMP20]], <vscale x 4 x i1> zeroinitializer
815 ; PRED-NEXT: [[TMP22:%.*]] = getelementptr i32, ptr [[D]], i64 [[TMP15]]
816 ; PRED-NEXT: call void @llvm.masked.scatter.nxv4i32.nxv4p0(<vscale x 4 x i32> [[TMP18]], <vscale x 4 x ptr> [[BROADCAST_SPLAT33]], i32 4, <vscale x 4 x i1> [[TMP21]]), !alias.scope [[META13:![0-9]+]], !noalias [[META15:![0-9]+]]
817 ; PRED-NEXT: [[TMP23:%.*]] = getelementptr i32, ptr [[TMP22]], i32 0
818 ; PRED-NEXT: call void @llvm.masked.store.nxv4i32.p0(<vscale x 4 x i32> zeroinitializer, ptr [[TMP23]], i32 4, <vscale x 4 x i1> [[TMP21]]), !alias.scope [[META17:![0-9]+]], !noalias [[META18:![0-9]+]]
819 ; PRED-NEXT: [[INDEX_NEXT]] = add i64 [[INDEX]], [[TMP9]]
820 ; PRED-NEXT: [[ACTIVE_LANE_MASK_NEXT]] = call <vscale x 4 x i1> @llvm.get.active.lane.mask.nxv4i1.i64(i64 [[INDEX]], i64 [[TMP14]])
821 ; PRED-NEXT: [[TMP24:%.*]] = xor <vscale x 4 x i1> [[ACTIVE_LANE_MASK_NEXT]], shufflevector (<vscale x 4 x i1> insertelement (<vscale x 4 x i1> poison, i1 true, i64 0), <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer)
822 ; PRED-NEXT: [[TMP25:%.*]] = extractelement <vscale x 4 x i1> [[TMP24]], i32 0
823 ; PRED-NEXT: br i1 [[TMP25]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP19:![0-9]+]]
824 ; PRED: middle.block:
825 ; PRED-NEXT: br i1 true, label [[EXIT:%.*]], label [[SCALAR_PH]]
827 ; PRED-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ], [ 0, [[VECTOR_MEMCHECK]] ]
828 ; PRED-NEXT: br label [[LOOP_HEADER:%.*]]
830 ; PRED-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP_LATCH:%.*]] ]
831 ; PRED-NEXT: [[L_A:%.*]] = load i32, ptr [[A]], align 4
832 ; PRED-NEXT: [[L_B:%.*]] = load i32, ptr [[B]], align 4
833 ; PRED-NEXT: [[OR:%.*]] = or i32 [[L_B]], [[L_A]]
834 ; PRED-NEXT: [[L_C:%.*]] = load i32, ptr [[C]], align 4
835 ; PRED-NEXT: [[C_0:%.*]] = icmp ugt i32 [[L_C]], [[OR]]
836 ; PRED-NEXT: br i1 [[C_0]], label [[IF_THEN:%.*]], label [[LOOP_LATCH]]
838 ; PRED-NEXT: [[GEP_D:%.*]] = getelementptr i32, ptr [[D]], i64 [[IV]]
839 ; PRED-NEXT: store i32 [[OR]], ptr [[E]], align 4
840 ; PRED-NEXT: store i32 0, ptr [[GEP_D]], align 4
841 ; PRED-NEXT: br label [[LOOP_LATCH]]
843 ; PRED-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
844 ; PRED-NEXT: [[C_1:%.*]] = icmp eq i64 [[IV]], [[N]]
845 ; PRED-NEXT: br i1 [[C_1]], label [[EXIT]], label [[LOOP_HEADER]], !llvm.loop [[LOOP20:![0-9]+]]
847 ; PRED-NEXT: ret i32 0
850 br label %loop.header
853 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
854 %l.A = load i32, ptr %A, align 4
855 %l.B = load i32, ptr %B, align 4
856 %or = or i32 %l.B, %l.A
857 %l.C = load i32, ptr %C, align 4
858 %c.0 = icmp ugt i32 %l.C, %or
859 br i1 %c.0, label %if.then, label %loop.latch
862 %gep.D = getelementptr i32, ptr %D, i64 %iv
863 store i32 %or, ptr %E, align 4
864 store i32 0, ptr %gep.D, align 4
868 %iv.next = add i64 %iv, 1
869 %c.1 = icmp eq i64 %iv, %N
870 br i1 %c.1, label %exit, label %loop.header
876 define void @multiple_exit_conditions(ptr %src, ptr noalias %dst) #1 {
877 ; DEFAULT-LABEL: define void @multiple_exit_conditions(
878 ; DEFAULT-SAME: ptr [[SRC:%.*]], ptr noalias [[DST:%.*]]) #[[ATTR2:[0-9]+]] {
879 ; DEFAULT-NEXT: entry:
880 ; DEFAULT-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
881 ; DEFAULT: vector.ph:
882 ; DEFAULT-NEXT: [[IND_END:%.*]] = getelementptr i8, ptr [[DST]], i64 2048
883 ; DEFAULT-NEXT: br label [[VECTOR_BODY:%.*]]
884 ; DEFAULT: vector.body:
885 ; DEFAULT-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
886 ; DEFAULT-NEXT: [[OFFSET_IDX:%.*]] = mul i64 [[INDEX]], 8
887 ; DEFAULT-NEXT: [[TMP0:%.*]] = add i64 [[OFFSET_IDX]], 0
888 ; DEFAULT-NEXT: [[NEXT_GEP:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP0]]
889 ; DEFAULT-NEXT: [[TMP1:%.*]] = load i16, ptr [[SRC]], align 2
890 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <8 x i16> poison, i16 [[TMP1]], i64 0
891 ; DEFAULT-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <8 x i16> [[BROADCAST_SPLATINSERT]], <8 x i16> poison, <8 x i32> zeroinitializer
892 ; DEFAULT-NEXT: [[TMP2:%.*]] = or <8 x i16> [[BROADCAST_SPLAT]], <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
893 ; DEFAULT-NEXT: [[TMP3:%.*]] = uitofp <8 x i16> [[TMP2]] to <8 x double>
894 ; DEFAULT-NEXT: [[TMP4:%.*]] = getelementptr double, ptr [[NEXT_GEP]], i32 0
895 ; DEFAULT-NEXT: store <8 x double> [[TMP3]], ptr [[TMP4]], align 8
896 ; DEFAULT-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 8
897 ; DEFAULT-NEXT: [[TMP5:%.*]] = icmp eq i64 [[INDEX_NEXT]], 256
898 ; DEFAULT-NEXT: br i1 [[TMP5]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP24:![0-9]+]]
899 ; DEFAULT: middle.block:
900 ; DEFAULT-NEXT: br i1 false, label [[EXIT:%.*]], label [[SCALAR_PH]]
901 ; DEFAULT: scalar.ph:
902 ; DEFAULT-NEXT: [[BC_RESUME_VAL:%.*]] = phi ptr [ [[IND_END]], [[MIDDLE_BLOCK]] ], [ [[DST]], [[ENTRY:%.*]] ]
903 ; DEFAULT-NEXT: [[BC_RESUME_VAL1:%.*]] = phi i64 [ 512, [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY]] ]
904 ; DEFAULT-NEXT: br label [[LOOP:%.*]]
905 ; DEFAULT: vector.scevcheck:
906 ; DEFAULT-NEXT: unreachable
908 ; DEFAULT-NEXT: [[PTR_IV:%.*]] = phi ptr [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[PTR_IV_NEXT:%.*]], [[LOOP]] ]
909 ; DEFAULT-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL1]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
910 ; DEFAULT-NEXT: [[L:%.*]] = load i16, ptr [[SRC]], align 2
911 ; DEFAULT-NEXT: [[O:%.*]] = or i16 [[L]], 1
912 ; DEFAULT-NEXT: [[CONV:%.*]] = uitofp i16 [[O]] to double
913 ; DEFAULT-NEXT: store double [[CONV]], ptr [[PTR_IV]], align 8
914 ; DEFAULT-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 2
915 ; DEFAULT-NEXT: [[PTR_IV_NEXT]] = getelementptr i8, ptr [[PTR_IV]], i64 8
916 ; DEFAULT-NEXT: [[IV_CLAMP:%.*]] = and i64 [[IV]], 4294967294
917 ; DEFAULT-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_CLAMP]], 512
918 ; DEFAULT-NEXT: br i1 [[EC]], label [[EXIT]], label [[LOOP]], !llvm.loop [[LOOP25:![0-9]+]]
920 ; DEFAULT-NEXT: ret void
922 ; PRED-LABEL: define void @multiple_exit_conditions(
923 ; PRED-SAME: ptr [[SRC:%.*]], ptr noalias [[DST:%.*]]) #[[ATTR2:[0-9]+]] {
925 ; PRED-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
927 ; PRED-NEXT: [[TMP0:%.*]] = call i64 @llvm.vscale.i64()
928 ; PRED-NEXT: [[TMP1:%.*]] = mul i64 [[TMP0]], 2
929 ; PRED-NEXT: [[TMP2:%.*]] = sub i64 [[TMP1]], 1
930 ; PRED-NEXT: [[N_RND_UP:%.*]] = add i64 257, [[TMP2]]
931 ; PRED-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N_RND_UP]], [[TMP1]]
932 ; PRED-NEXT: [[N_VEC:%.*]] = sub i64 [[N_RND_UP]], [[N_MOD_VF]]
933 ; PRED-NEXT: [[TMP3:%.*]] = mul i64 [[N_VEC]], 8
934 ; PRED-NEXT: [[IND_END:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP3]]
935 ; PRED-NEXT: [[IND_END1:%.*]] = mul i64 [[N_VEC]], 2
936 ; PRED-NEXT: [[TMP4:%.*]] = call i64 @llvm.vscale.i64()
937 ; PRED-NEXT: [[TMP5:%.*]] = mul i64 [[TMP4]], 2
938 ; PRED-NEXT: [[TMP6:%.*]] = call i64 @llvm.vscale.i64()
939 ; PRED-NEXT: [[TMP7:%.*]] = mul i64 [[TMP6]], 2
940 ; PRED-NEXT: [[TMP8:%.*]] = sub i64 257, [[TMP7]]
941 ; PRED-NEXT: [[TMP9:%.*]] = icmp ugt i64 257, [[TMP7]]
942 ; PRED-NEXT: [[TMP10:%.*]] = select i1 [[TMP9]], i64 [[TMP8]], i64 0
943 ; PRED-NEXT: [[ACTIVE_LANE_MASK_ENTRY:%.*]] = call <vscale x 2 x i1> @llvm.get.active.lane.mask.nxv2i1.i64(i64 0, i64 257)
944 ; PRED-NEXT: br label [[VECTOR_BODY:%.*]]
946 ; PRED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[VECTOR_BODY]] ]
947 ; PRED-NEXT: [[ACTIVE_LANE_MASK:%.*]] = phi <vscale x 2 x i1> [ [[ACTIVE_LANE_MASK_ENTRY]], [[VECTOR_PH]] ], [ [[ACTIVE_LANE_MASK_NEXT:%.*]], [[VECTOR_BODY]] ]
948 ; PRED-NEXT: [[OFFSET_IDX:%.*]] = mul i64 [[INDEX]], 8
949 ; PRED-NEXT: [[TMP11:%.*]] = add i64 [[OFFSET_IDX]], 0
950 ; PRED-NEXT: [[NEXT_GEP:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP11]]
951 ; PRED-NEXT: [[TMP12:%.*]] = load i16, ptr [[SRC]], align 2
952 ; PRED-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <vscale x 2 x i16> poison, i16 [[TMP12]], i64 0
953 ; PRED-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <vscale x 2 x i16> [[BROADCAST_SPLATINSERT]], <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
954 ; PRED-NEXT: [[TMP13:%.*]] = or <vscale x 2 x i16> [[BROADCAST_SPLAT]], shufflevector (<vscale x 2 x i16> insertelement (<vscale x 2 x i16> poison, i16 1, i64 0), <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer)
955 ; PRED-NEXT: [[TMP14:%.*]] = uitofp <vscale x 2 x i16> [[TMP13]] to <vscale x 2 x double>
956 ; PRED-NEXT: [[TMP15:%.*]] = getelementptr double, ptr [[NEXT_GEP]], i32 0
957 ; PRED-NEXT: call void @llvm.masked.store.nxv2f64.p0(<vscale x 2 x double> [[TMP14]], ptr [[TMP15]], i32 8, <vscale x 2 x i1> [[ACTIVE_LANE_MASK]])
958 ; PRED-NEXT: [[INDEX_NEXT]] = add i64 [[INDEX]], [[TMP5]]
959 ; PRED-NEXT: [[ACTIVE_LANE_MASK_NEXT]] = call <vscale x 2 x i1> @llvm.get.active.lane.mask.nxv2i1.i64(i64 [[INDEX]], i64 [[TMP10]])
960 ; PRED-NEXT: [[TMP16:%.*]] = xor <vscale x 2 x i1> [[ACTIVE_LANE_MASK_NEXT]], shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer)
961 ; PRED-NEXT: [[TMP17:%.*]] = extractelement <vscale x 2 x i1> [[TMP16]], i32 0
962 ; PRED-NEXT: br i1 [[TMP17]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP21:![0-9]+]]
963 ; PRED: middle.block:
964 ; PRED-NEXT: br i1 true, label [[EXIT:%.*]], label [[SCALAR_PH]]
966 ; PRED-NEXT: [[BC_RESUME_VAL:%.*]] = phi ptr [ [[IND_END]], [[MIDDLE_BLOCK]] ], [ [[DST]], [[ENTRY:%.*]] ]
967 ; PRED-NEXT: [[BC_RESUME_VAL2:%.*]] = phi i64 [ [[IND_END1]], [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY]] ]
968 ; PRED-NEXT: br label [[LOOP:%.*]]
969 ; PRED: vector.scevcheck:
970 ; PRED-NEXT: unreachable
972 ; PRED-NEXT: [[PTR_IV:%.*]] = phi ptr [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[PTR_IV_NEXT:%.*]], [[LOOP]] ]
973 ; PRED-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL2]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
974 ; PRED-NEXT: [[L:%.*]] = load i16, ptr [[SRC]], align 2
975 ; PRED-NEXT: [[O:%.*]] = or i16 [[L]], 1
976 ; PRED-NEXT: [[CONV:%.*]] = uitofp i16 [[O]] to double
977 ; PRED-NEXT: store double [[CONV]], ptr [[PTR_IV]], align 8
978 ; PRED-NEXT: [[IV_NEXT]] = add nsw i64 [[IV]], 2
979 ; PRED-NEXT: [[PTR_IV_NEXT]] = getelementptr i8, ptr [[PTR_IV]], i64 8
980 ; PRED-NEXT: [[IV_CLAMP:%.*]] = and i64 [[IV]], 4294967294
981 ; PRED-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_CLAMP]], 512
982 ; PRED-NEXT: br i1 [[EC]], label [[EXIT]], label [[LOOP]], !llvm.loop [[LOOP22:![0-9]+]]
984 ; PRED-NEXT: ret void
990 %ptr.iv = phi ptr [ %dst, %entry ], [ %ptr.iv.next, %loop ]
991 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
992 %l = load i16, ptr %src, align 2
994 %conv = uitofp i16 %o to double
995 store double %conv, ptr %ptr.iv, align 8
996 %iv.next = add nsw i64 %iv, 2
997 %ptr.iv.next = getelementptr i8, ptr %ptr.iv, i64 8
998 %iv.clamp = and i64 %iv, 4294967294
999 %ec = icmp eq i64 %iv.clamp, 512
1000 br i1 %ec, label %exit, label %loop
1006 define void @low_trip_count_fold_tail_scalarized_store(ptr %dst) {
1007 ; DEFAULT-LABEL: define void @low_trip_count_fold_tail_scalarized_store(
1008 ; DEFAULT-SAME: ptr [[DST:%.*]]) {
1009 ; DEFAULT-NEXT: entry:
1010 ; DEFAULT-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
1011 ; DEFAULT: vector.ph:
1012 ; DEFAULT-NEXT: br label [[VECTOR_BODY:%.*]]
1013 ; DEFAULT: vector.body:
1014 ; DEFAULT-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_STORE_CONTINUE14:%.*]] ]
1015 ; DEFAULT-NEXT: [[VEC_IND:%.*]] = phi <8 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7>, [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[PRED_STORE_CONTINUE14]] ]
1016 ; DEFAULT-NEXT: [[TMP0:%.*]] = trunc i64 [[INDEX]] to i8
1017 ; DEFAULT-NEXT: [[TMP1:%.*]] = icmp ule <8 x i64> [[VEC_IND]], <i64 6, i64 6, i64 6, i64 6, i64 6, i64 6, i64 6, i64 6>
1018 ; DEFAULT-NEXT: [[TMP2:%.*]] = extractelement <8 x i1> [[TMP1]], i32 0
1019 ; DEFAULT-NEXT: br i1 [[TMP2]], label [[PRED_STORE_IF:%.*]], label [[PRED_STORE_CONTINUE:%.*]]
1020 ; DEFAULT: pred.store.if:
1021 ; DEFAULT-NEXT: [[TMP3:%.*]] = add i64 [[INDEX]], 0
1022 ; DEFAULT-NEXT: [[TMP4:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP3]]
1023 ; DEFAULT-NEXT: [[TMP5:%.*]] = add i8 [[TMP0]], 0
1024 ; DEFAULT-NEXT: store i8 [[TMP5]], ptr [[TMP4]], align 1
1025 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE]]
1026 ; DEFAULT: pred.store.continue:
1027 ; DEFAULT-NEXT: [[TMP6:%.*]] = extractelement <8 x i1> [[TMP1]], i32 1
1028 ; DEFAULT-NEXT: br i1 [[TMP6]], label [[PRED_STORE_IF1:%.*]], label [[PRED_STORE_CONTINUE2:%.*]]
1029 ; DEFAULT: pred.store.if1:
1030 ; DEFAULT-NEXT: [[TMP7:%.*]] = add i64 [[INDEX]], 1
1031 ; DEFAULT-NEXT: [[TMP8:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP7]]
1032 ; DEFAULT-NEXT: [[TMP9:%.*]] = add i8 [[TMP0]], 1
1033 ; DEFAULT-NEXT: store i8 [[TMP9]], ptr [[TMP8]], align 1
1034 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE2]]
1035 ; DEFAULT: pred.store.continue2:
1036 ; DEFAULT-NEXT: [[TMP10:%.*]] = extractelement <8 x i1> [[TMP1]], i32 2
1037 ; DEFAULT-NEXT: br i1 [[TMP10]], label [[PRED_STORE_IF3:%.*]], label [[PRED_STORE_CONTINUE4:%.*]]
1038 ; DEFAULT: pred.store.if3:
1039 ; DEFAULT-NEXT: [[TMP11:%.*]] = add i64 [[INDEX]], 2
1040 ; DEFAULT-NEXT: [[TMP12:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP11]]
1041 ; DEFAULT-NEXT: [[TMP13:%.*]] = add i8 [[TMP0]], 2
1042 ; DEFAULT-NEXT: store i8 [[TMP13]], ptr [[TMP12]], align 1
1043 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE4]]
1044 ; DEFAULT: pred.store.continue4:
1045 ; DEFAULT-NEXT: [[TMP14:%.*]] = extractelement <8 x i1> [[TMP1]], i32 3
1046 ; DEFAULT-NEXT: br i1 [[TMP14]], label [[PRED_STORE_IF5:%.*]], label [[PRED_STORE_CONTINUE6:%.*]]
1047 ; DEFAULT: pred.store.if5:
1048 ; DEFAULT-NEXT: [[TMP15:%.*]] = add i64 [[INDEX]], 3
1049 ; DEFAULT-NEXT: [[TMP16:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP15]]
1050 ; DEFAULT-NEXT: [[TMP17:%.*]] = add i8 [[TMP0]], 3
1051 ; DEFAULT-NEXT: store i8 [[TMP17]], ptr [[TMP16]], align 1
1052 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE6]]
1053 ; DEFAULT: pred.store.continue6:
1054 ; DEFAULT-NEXT: [[TMP18:%.*]] = extractelement <8 x i1> [[TMP1]], i32 4
1055 ; DEFAULT-NEXT: br i1 [[TMP18]], label [[PRED_STORE_IF7:%.*]], label [[PRED_STORE_CONTINUE8:%.*]]
1056 ; DEFAULT: pred.store.if7:
1057 ; DEFAULT-NEXT: [[TMP19:%.*]] = add i64 [[INDEX]], 4
1058 ; DEFAULT-NEXT: [[TMP20:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP19]]
1059 ; DEFAULT-NEXT: [[TMP21:%.*]] = add i8 [[TMP0]], 4
1060 ; DEFAULT-NEXT: store i8 [[TMP21]], ptr [[TMP20]], align 1
1061 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE8]]
1062 ; DEFAULT: pred.store.continue8:
1063 ; DEFAULT-NEXT: [[TMP22:%.*]] = extractelement <8 x i1> [[TMP1]], i32 5
1064 ; DEFAULT-NEXT: br i1 [[TMP22]], label [[PRED_STORE_IF9:%.*]], label [[PRED_STORE_CONTINUE10:%.*]]
1065 ; DEFAULT: pred.store.if9:
1066 ; DEFAULT-NEXT: [[TMP23:%.*]] = add i64 [[INDEX]], 5
1067 ; DEFAULT-NEXT: [[TMP24:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP23]]
1068 ; DEFAULT-NEXT: [[TMP25:%.*]] = add i8 [[TMP0]], 5
1069 ; DEFAULT-NEXT: store i8 [[TMP25]], ptr [[TMP24]], align 1
1070 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE10]]
1071 ; DEFAULT: pred.store.continue10:
1072 ; DEFAULT-NEXT: [[TMP26:%.*]] = extractelement <8 x i1> [[TMP1]], i32 6
1073 ; DEFAULT-NEXT: br i1 [[TMP26]], label [[PRED_STORE_IF11:%.*]], label [[PRED_STORE_CONTINUE12:%.*]]
1074 ; DEFAULT: pred.store.if11:
1075 ; DEFAULT-NEXT: [[TMP27:%.*]] = add i64 [[INDEX]], 6
1076 ; DEFAULT-NEXT: [[TMP28:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP27]]
1077 ; DEFAULT-NEXT: [[TMP29:%.*]] = add i8 [[TMP0]], 6
1078 ; DEFAULT-NEXT: store i8 [[TMP29]], ptr [[TMP28]], align 1
1079 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE12]]
1080 ; DEFAULT: pred.store.continue12:
1081 ; DEFAULT-NEXT: [[TMP30:%.*]] = extractelement <8 x i1> [[TMP1]], i32 7
1082 ; DEFAULT-NEXT: br i1 [[TMP30]], label [[PRED_STORE_IF13:%.*]], label [[PRED_STORE_CONTINUE14]]
1083 ; DEFAULT: pred.store.if13:
1084 ; DEFAULT-NEXT: [[TMP31:%.*]] = add i64 [[INDEX]], 7
1085 ; DEFAULT-NEXT: [[TMP32:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP31]]
1086 ; DEFAULT-NEXT: [[TMP33:%.*]] = add i8 [[TMP0]], 7
1087 ; DEFAULT-NEXT: store i8 [[TMP33]], ptr [[TMP32]], align 1
1088 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE14]]
1089 ; DEFAULT: pred.store.continue14:
1090 ; DEFAULT-NEXT: [[VEC_IND_NEXT]] = add <8 x i64> [[VEC_IND]], <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8>
1091 ; DEFAULT-NEXT: [[INDEX_NEXT]] = add i64 [[INDEX]], 8
1092 ; DEFAULT-NEXT: br i1 true, label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP26:![0-9]+]]
1093 ; DEFAULT: middle.block:
1094 ; DEFAULT-NEXT: br i1 true, label [[EXIT:%.*]], label [[SCALAR_PH]]
1095 ; DEFAULT: scalar.ph:
1096 ; DEFAULT-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 8, [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ]
1097 ; DEFAULT-NEXT: br label [[LOOP:%.*]]
1099 ; DEFAULT-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
1100 ; DEFAULT-NEXT: [[IV_TRUNC:%.*]] = trunc i64 [[IV]] to i8
1101 ; DEFAULT-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[DST]], i64 [[IV]]
1102 ; DEFAULT-NEXT: store i8 [[IV_TRUNC]], ptr [[GEP]], align 1
1103 ; DEFAULT-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
1104 ; DEFAULT-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], 7
1105 ; DEFAULT-NEXT: br i1 [[EC]], label [[EXIT]], label [[LOOP]], !llvm.loop [[LOOP27:![0-9]+]]
1107 ; DEFAULT-NEXT: ret void
1109 ; PRED-LABEL: define void @low_trip_count_fold_tail_scalarized_store(
1110 ; PRED-SAME: ptr [[DST:%.*]]) {
1112 ; PRED-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
1114 ; PRED-NEXT: br label [[VECTOR_BODY:%.*]]
1115 ; PRED: vector.body:
1116 ; PRED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_STORE_CONTINUE14:%.*]] ]
1117 ; PRED-NEXT: [[VEC_IND:%.*]] = phi <8 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7>, [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[PRED_STORE_CONTINUE14]] ]
1118 ; PRED-NEXT: [[TMP0:%.*]] = trunc i64 [[INDEX]] to i8
1119 ; PRED-NEXT: [[TMP1:%.*]] = icmp ule <8 x i64> [[VEC_IND]], <i64 6, i64 6, i64 6, i64 6, i64 6, i64 6, i64 6, i64 6>
1120 ; PRED-NEXT: [[TMP2:%.*]] = extractelement <8 x i1> [[TMP1]], i32 0
1121 ; PRED-NEXT: br i1 [[TMP2]], label [[PRED_STORE_IF:%.*]], label [[PRED_STORE_CONTINUE:%.*]]
1122 ; PRED: pred.store.if:
1123 ; PRED-NEXT: [[TMP3:%.*]] = add i64 [[INDEX]], 0
1124 ; PRED-NEXT: [[TMP4:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP3]]
1125 ; PRED-NEXT: [[TMP5:%.*]] = add i8 [[TMP0]], 0
1126 ; PRED-NEXT: store i8 [[TMP5]], ptr [[TMP4]], align 1
1127 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE]]
1128 ; PRED: pred.store.continue:
1129 ; PRED-NEXT: [[TMP6:%.*]] = extractelement <8 x i1> [[TMP1]], i32 1
1130 ; PRED-NEXT: br i1 [[TMP6]], label [[PRED_STORE_IF1:%.*]], label [[PRED_STORE_CONTINUE2:%.*]]
1131 ; PRED: pred.store.if1:
1132 ; PRED-NEXT: [[TMP7:%.*]] = add i64 [[INDEX]], 1
1133 ; PRED-NEXT: [[TMP8:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP7]]
1134 ; PRED-NEXT: [[TMP9:%.*]] = add i8 [[TMP0]], 1
1135 ; PRED-NEXT: store i8 [[TMP9]], ptr [[TMP8]], align 1
1136 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE2]]
1137 ; PRED: pred.store.continue2:
1138 ; PRED-NEXT: [[TMP10:%.*]] = extractelement <8 x i1> [[TMP1]], i32 2
1139 ; PRED-NEXT: br i1 [[TMP10]], label [[PRED_STORE_IF3:%.*]], label [[PRED_STORE_CONTINUE4:%.*]]
1140 ; PRED: pred.store.if3:
1141 ; PRED-NEXT: [[TMP11:%.*]] = add i64 [[INDEX]], 2
1142 ; PRED-NEXT: [[TMP12:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP11]]
1143 ; PRED-NEXT: [[TMP13:%.*]] = add i8 [[TMP0]], 2
1144 ; PRED-NEXT: store i8 [[TMP13]], ptr [[TMP12]], align 1
1145 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE4]]
1146 ; PRED: pred.store.continue4:
1147 ; PRED-NEXT: [[TMP14:%.*]] = extractelement <8 x i1> [[TMP1]], i32 3
1148 ; PRED-NEXT: br i1 [[TMP14]], label [[PRED_STORE_IF5:%.*]], label [[PRED_STORE_CONTINUE6:%.*]]
1149 ; PRED: pred.store.if5:
1150 ; PRED-NEXT: [[TMP15:%.*]] = add i64 [[INDEX]], 3
1151 ; PRED-NEXT: [[TMP16:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP15]]
1152 ; PRED-NEXT: [[TMP17:%.*]] = add i8 [[TMP0]], 3
1153 ; PRED-NEXT: store i8 [[TMP17]], ptr [[TMP16]], align 1
1154 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE6]]
1155 ; PRED: pred.store.continue6:
1156 ; PRED-NEXT: [[TMP18:%.*]] = extractelement <8 x i1> [[TMP1]], i32 4
1157 ; PRED-NEXT: br i1 [[TMP18]], label [[PRED_STORE_IF7:%.*]], label [[PRED_STORE_CONTINUE8:%.*]]
1158 ; PRED: pred.store.if7:
1159 ; PRED-NEXT: [[TMP19:%.*]] = add i64 [[INDEX]], 4
1160 ; PRED-NEXT: [[TMP20:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP19]]
1161 ; PRED-NEXT: [[TMP21:%.*]] = add i8 [[TMP0]], 4
1162 ; PRED-NEXT: store i8 [[TMP21]], ptr [[TMP20]], align 1
1163 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE8]]
1164 ; PRED: pred.store.continue8:
1165 ; PRED-NEXT: [[TMP22:%.*]] = extractelement <8 x i1> [[TMP1]], i32 5
1166 ; PRED-NEXT: br i1 [[TMP22]], label [[PRED_STORE_IF9:%.*]], label [[PRED_STORE_CONTINUE10:%.*]]
1167 ; PRED: pred.store.if9:
1168 ; PRED-NEXT: [[TMP23:%.*]] = add i64 [[INDEX]], 5
1169 ; PRED-NEXT: [[TMP24:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP23]]
1170 ; PRED-NEXT: [[TMP25:%.*]] = add i8 [[TMP0]], 5
1171 ; PRED-NEXT: store i8 [[TMP25]], ptr [[TMP24]], align 1
1172 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE10]]
1173 ; PRED: pred.store.continue10:
1174 ; PRED-NEXT: [[TMP26:%.*]] = extractelement <8 x i1> [[TMP1]], i32 6
1175 ; PRED-NEXT: br i1 [[TMP26]], label [[PRED_STORE_IF11:%.*]], label [[PRED_STORE_CONTINUE12:%.*]]
1176 ; PRED: pred.store.if11:
1177 ; PRED-NEXT: [[TMP27:%.*]] = add i64 [[INDEX]], 6
1178 ; PRED-NEXT: [[TMP28:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP27]]
1179 ; PRED-NEXT: [[TMP29:%.*]] = add i8 [[TMP0]], 6
1180 ; PRED-NEXT: store i8 [[TMP29]], ptr [[TMP28]], align 1
1181 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE12]]
1182 ; PRED: pred.store.continue12:
1183 ; PRED-NEXT: [[TMP30:%.*]] = extractelement <8 x i1> [[TMP1]], i32 7
1184 ; PRED-NEXT: br i1 [[TMP30]], label [[PRED_STORE_IF13:%.*]], label [[PRED_STORE_CONTINUE14]]
1185 ; PRED: pred.store.if13:
1186 ; PRED-NEXT: [[TMP31:%.*]] = add i64 [[INDEX]], 7
1187 ; PRED-NEXT: [[TMP32:%.*]] = getelementptr i8, ptr [[DST]], i64 [[TMP31]]
1188 ; PRED-NEXT: [[TMP33:%.*]] = add i8 [[TMP0]], 7
1189 ; PRED-NEXT: store i8 [[TMP33]], ptr [[TMP32]], align 1
1190 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE14]]
1191 ; PRED: pred.store.continue14:
1192 ; PRED-NEXT: [[VEC_IND_NEXT]] = add <8 x i64> [[VEC_IND]], <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8>
1193 ; PRED-NEXT: [[INDEX_NEXT]] = add i64 [[INDEX]], 8
1194 ; PRED-NEXT: br i1 true, label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP23:![0-9]+]]
1195 ; PRED: middle.block:
1196 ; PRED-NEXT: br i1 true, label [[EXIT:%.*]], label [[SCALAR_PH]]
1198 ; PRED-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 8, [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ]
1199 ; PRED-NEXT: br label [[LOOP:%.*]]
1201 ; PRED-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
1202 ; PRED-NEXT: [[IV_TRUNC:%.*]] = trunc i64 [[IV]] to i8
1203 ; PRED-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[DST]], i64 [[IV]]
1204 ; PRED-NEXT: store i8 [[IV_TRUNC]], ptr [[GEP]], align 1
1205 ; PRED-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
1206 ; PRED-NEXT: [[EC:%.*]] = icmp eq i64 [[IV_NEXT]], 7
1207 ; PRED-NEXT: br i1 [[EC]], label [[EXIT]], label [[LOOP]], !llvm.loop [[LOOP24:![0-9]+]]
1209 ; PRED-NEXT: ret void
1215 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
1216 %iv.trunc = trunc i64 %iv to i8
1217 %gep = getelementptr i8, ptr %dst, i64 %iv
1218 store i8 %iv.trunc, ptr %gep, align 1
1219 %iv.next = add i64 %iv, 1
1220 %ec = icmp eq i64 %iv.next, 7
1221 br i1 %ec, label %exit, label %loop
1227 define void @test_conditional_interleave_group (ptr noalias %src.1, ptr noalias %src.2, ptr noalias %src.3, ptr noalias %src.4, ptr noalias %dst, i64 %N) #2 {
1228 ; DEFAULT-LABEL: define void @test_conditional_interleave_group(
1229 ; DEFAULT-SAME: ptr noalias [[SRC_1:%.*]], ptr noalias [[SRC_2:%.*]], ptr noalias [[SRC_3:%.*]], ptr noalias [[SRC_4:%.*]], ptr noalias [[DST:%.*]], i64 [[N:%.*]]) #[[ATTR3:[0-9]+]] {
1230 ; DEFAULT-NEXT: entry:
1231 ; DEFAULT-NEXT: [[TMP0:%.*]] = add i64 [[N]], 1
1232 ; DEFAULT-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[TMP0]], 32
1233 ; DEFAULT-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_SCEVCHECK:%.*]]
1234 ; DEFAULT: vector.scevcheck:
1235 ; DEFAULT-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[DST]], i64 4
1236 ; DEFAULT-NEXT: [[MUL:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 16, i64 [[N]])
1237 ; DEFAULT-NEXT: [[MUL_RESULT:%.*]] = extractvalue { i64, i1 } [[MUL]], 0
1238 ; DEFAULT-NEXT: [[MUL_OVERFLOW:%.*]] = extractvalue { i64, i1 } [[MUL]], 1
1239 ; DEFAULT-NEXT: [[TMP1:%.*]] = sub i64 0, [[MUL_RESULT]]
1240 ; DEFAULT-NEXT: [[TMP2:%.*]] = getelementptr i8, ptr [[SCEVGEP]], i64 [[MUL_RESULT]]
1241 ; DEFAULT-NEXT: [[TMP3:%.*]] = icmp ult ptr [[TMP2]], [[SCEVGEP]]
1242 ; DEFAULT-NEXT: [[TMP4:%.*]] = or i1 [[TMP3]], [[MUL_OVERFLOW]]
1243 ; DEFAULT-NEXT: [[SCEVGEP1:%.*]] = getelementptr i8, ptr [[DST]], i64 8
1244 ; DEFAULT-NEXT: [[MUL2:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 16, i64 [[N]])
1245 ; DEFAULT-NEXT: [[MUL_RESULT3:%.*]] = extractvalue { i64, i1 } [[MUL2]], 0
1246 ; DEFAULT-NEXT: [[MUL_OVERFLOW4:%.*]] = extractvalue { i64, i1 } [[MUL2]], 1
1247 ; DEFAULT-NEXT: [[TMP5:%.*]] = sub i64 0, [[MUL_RESULT3]]
1248 ; DEFAULT-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[SCEVGEP1]], i64 [[MUL_RESULT3]]
1249 ; DEFAULT-NEXT: [[TMP7:%.*]] = icmp ult ptr [[TMP6]], [[SCEVGEP1]]
1250 ; DEFAULT-NEXT: [[TMP8:%.*]] = or i1 [[TMP7]], [[MUL_OVERFLOW4]]
1251 ; DEFAULT-NEXT: [[MUL5:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 16, i64 [[N]])
1252 ; DEFAULT-NEXT: [[MUL_RESULT6:%.*]] = extractvalue { i64, i1 } [[MUL5]], 0
1253 ; DEFAULT-NEXT: [[MUL_OVERFLOW7:%.*]] = extractvalue { i64, i1 } [[MUL5]], 1
1254 ; DEFAULT-NEXT: [[TMP9:%.*]] = sub i64 0, [[MUL_RESULT6]]
1255 ; DEFAULT-NEXT: [[TMP10:%.*]] = getelementptr i8, ptr [[DST]], i64 [[MUL_RESULT6]]
1256 ; DEFAULT-NEXT: [[TMP11:%.*]] = icmp ult ptr [[TMP10]], [[DST]]
1257 ; DEFAULT-NEXT: [[TMP12:%.*]] = or i1 [[TMP11]], [[MUL_OVERFLOW7]]
1258 ; DEFAULT-NEXT: [[TMP13:%.*]] = or i1 [[TMP4]], [[TMP8]]
1259 ; DEFAULT-NEXT: [[TMP14:%.*]] = or i1 [[TMP13]], [[TMP12]]
1260 ; DEFAULT-NEXT: br i1 [[TMP14]], label [[SCALAR_PH]], label [[VECTOR_PH:%.*]]
1261 ; DEFAULT: vector.ph:
1262 ; DEFAULT-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[TMP0]], 8
1263 ; DEFAULT-NEXT: [[N_VEC:%.*]] = sub i64 [[TMP0]], [[N_MOD_VF]]
1264 ; DEFAULT-NEXT: br label [[VECTOR_BODY:%.*]]
1265 ; DEFAULT: vector.body:
1266 ; DEFAULT-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_STORE_CONTINUE27:%.*]] ]
1267 ; DEFAULT-NEXT: [[VEC_IND:%.*]] = phi <8 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7>, [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[PRED_STORE_CONTINUE27]] ]
1268 ; DEFAULT-NEXT: [[TMP15:%.*]] = load float, ptr [[SRC_1]], align 4
1269 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <8 x float> poison, float [[TMP15]], i64 0
1270 ; DEFAULT-NEXT: [[BROADCAST_SPLAT9:%.*]] = shufflevector <8 x float> [[BROADCAST_SPLATINSERT8]], <8 x float> poison, <8 x i32> zeroinitializer
1271 ; DEFAULT-NEXT: [[TMP16:%.*]] = load float, ptr [[SRC_2]], align 4
1272 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <8 x float> poison, float [[TMP16]], i64 0
1273 ; DEFAULT-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <8 x float> [[BROADCAST_SPLATINSERT]], <8 x float> poison, <8 x i32> zeroinitializer
1274 ; DEFAULT-NEXT: [[TMP17:%.*]] = fmul <8 x float> [[BROADCAST_SPLAT]], zeroinitializer
1275 ; DEFAULT-NEXT: [[TMP18:%.*]] = call <8 x float> @llvm.fmuladd.v8f32(<8 x float> [[BROADCAST_SPLAT9]], <8 x float> zeroinitializer, <8 x float> [[TMP17]])
1276 ; DEFAULT-NEXT: [[TMP19:%.*]] = load float, ptr [[SRC_3]], align 4
1277 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT10:%.*]] = insertelement <8 x float> poison, float [[TMP19]], i64 0
1278 ; DEFAULT-NEXT: [[BROADCAST_SPLAT11:%.*]] = shufflevector <8 x float> [[BROADCAST_SPLATINSERT10]], <8 x float> poison, <8 x i32> zeroinitializer
1279 ; DEFAULT-NEXT: [[TMP20:%.*]] = call <8 x float> @llvm.fmuladd.v8f32(<8 x float> [[BROADCAST_SPLAT11]], <8 x float> zeroinitializer, <8 x float> [[TMP18]])
1280 ; DEFAULT-NEXT: [[TMP21:%.*]] = load float, ptr [[SRC_3]], align 4
1281 ; DEFAULT-NEXT: [[BROADCAST_SPLATINSERT12:%.*]] = insertelement <8 x float> poison, float [[TMP21]], i64 0
1282 ; DEFAULT-NEXT: [[BROADCAST_SPLAT13:%.*]] = shufflevector <8 x float> [[BROADCAST_SPLATINSERT12]], <8 x float> poison, <8 x i32> zeroinitializer
1283 ; DEFAULT-NEXT: [[TMP22:%.*]] = fcmp ogt <8 x float> [[TMP20]], [[BROADCAST_SPLAT13]]
1284 ; DEFAULT-NEXT: [[TMP23:%.*]] = getelementptr { [4 x float] }, ptr [[DST]], <8 x i64> [[VEC_IND]]
1285 ; DEFAULT-NEXT: [[TMP24:%.*]] = extractelement <8 x i1> [[TMP22]], i32 0
1286 ; DEFAULT-NEXT: br i1 [[TMP24]], label [[PRED_STORE_IF:%.*]], label [[PRED_STORE_CONTINUE:%.*]]
1287 ; DEFAULT: pred.store.if:
1288 ; DEFAULT-NEXT: [[TMP25:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 0
1289 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP25]], align 4
1290 ; DEFAULT-NEXT: [[TMP26:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 0
1291 ; DEFAULT-NEXT: [[TMP27:%.*]] = getelementptr i8, ptr [[TMP26]], i64 4
1292 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP27]], align 4
1293 ; DEFAULT-NEXT: [[TMP28:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 0
1294 ; DEFAULT-NEXT: [[TMP29:%.*]] = getelementptr i8, ptr [[TMP28]], i64 8
1295 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP29]], align 4
1296 ; DEFAULT-NEXT: [[TMP30:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 0
1297 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP30]], align 4
1298 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE]]
1299 ; DEFAULT: pred.store.continue:
1300 ; DEFAULT-NEXT: [[TMP31:%.*]] = extractelement <8 x i1> [[TMP22]], i32 1
1301 ; DEFAULT-NEXT: br i1 [[TMP31]], label [[PRED_STORE_IF14:%.*]], label [[PRED_STORE_CONTINUE15:%.*]]
1302 ; DEFAULT: pred.store.if14:
1303 ; DEFAULT-NEXT: [[TMP32:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 1
1304 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP32]], align 4
1305 ; DEFAULT-NEXT: [[TMP33:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 1
1306 ; DEFAULT-NEXT: [[TMP34:%.*]] = getelementptr i8, ptr [[TMP33]], i64 4
1307 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP34]], align 4
1308 ; DEFAULT-NEXT: [[TMP35:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 1
1309 ; DEFAULT-NEXT: [[TMP36:%.*]] = getelementptr i8, ptr [[TMP35]], i64 8
1310 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP36]], align 4
1311 ; DEFAULT-NEXT: [[TMP37:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 1
1312 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP37]], align 4
1313 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE15]]
1314 ; DEFAULT: pred.store.continue15:
1315 ; DEFAULT-NEXT: [[TMP38:%.*]] = extractelement <8 x i1> [[TMP22]], i32 2
1316 ; DEFAULT-NEXT: br i1 [[TMP38]], label [[PRED_STORE_IF16:%.*]], label [[PRED_STORE_CONTINUE17:%.*]]
1317 ; DEFAULT: pred.store.if16:
1318 ; DEFAULT-NEXT: [[TMP39:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 2
1319 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP39]], align 4
1320 ; DEFAULT-NEXT: [[TMP40:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 2
1321 ; DEFAULT-NEXT: [[TMP41:%.*]] = getelementptr i8, ptr [[TMP40]], i64 4
1322 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP41]], align 4
1323 ; DEFAULT-NEXT: [[TMP42:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 2
1324 ; DEFAULT-NEXT: [[TMP43:%.*]] = getelementptr i8, ptr [[TMP42]], i64 8
1325 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP43]], align 4
1326 ; DEFAULT-NEXT: [[TMP44:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 2
1327 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP44]], align 4
1328 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE17]]
1329 ; DEFAULT: pred.store.continue17:
1330 ; DEFAULT-NEXT: [[TMP45:%.*]] = extractelement <8 x i1> [[TMP22]], i32 3
1331 ; DEFAULT-NEXT: br i1 [[TMP45]], label [[PRED_STORE_IF18:%.*]], label [[PRED_STORE_CONTINUE19:%.*]]
1332 ; DEFAULT: pred.store.if18:
1333 ; DEFAULT-NEXT: [[TMP46:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 3
1334 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP46]], align 4
1335 ; DEFAULT-NEXT: [[TMP47:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 3
1336 ; DEFAULT-NEXT: [[TMP48:%.*]] = getelementptr i8, ptr [[TMP47]], i64 4
1337 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP48]], align 4
1338 ; DEFAULT-NEXT: [[TMP49:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 3
1339 ; DEFAULT-NEXT: [[TMP50:%.*]] = getelementptr i8, ptr [[TMP49]], i64 8
1340 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP50]], align 4
1341 ; DEFAULT-NEXT: [[TMP51:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 3
1342 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP51]], align 4
1343 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE19]]
1344 ; DEFAULT: pred.store.continue19:
1345 ; DEFAULT-NEXT: [[TMP52:%.*]] = extractelement <8 x i1> [[TMP22]], i32 4
1346 ; DEFAULT-NEXT: br i1 [[TMP52]], label [[PRED_STORE_IF20:%.*]], label [[PRED_STORE_CONTINUE21:%.*]]
1347 ; DEFAULT: pred.store.if20:
1348 ; DEFAULT-NEXT: [[TMP53:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 4
1349 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP53]], align 4
1350 ; DEFAULT-NEXT: [[TMP54:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 4
1351 ; DEFAULT-NEXT: [[TMP55:%.*]] = getelementptr i8, ptr [[TMP54]], i64 4
1352 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP55]], align 4
1353 ; DEFAULT-NEXT: [[TMP56:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 4
1354 ; DEFAULT-NEXT: [[TMP57:%.*]] = getelementptr i8, ptr [[TMP56]], i64 8
1355 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP57]], align 4
1356 ; DEFAULT-NEXT: [[TMP58:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 4
1357 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP58]], align 4
1358 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE21]]
1359 ; DEFAULT: pred.store.continue21:
1360 ; DEFAULT-NEXT: [[TMP59:%.*]] = extractelement <8 x i1> [[TMP22]], i32 5
1361 ; DEFAULT-NEXT: br i1 [[TMP59]], label [[PRED_STORE_IF22:%.*]], label [[PRED_STORE_CONTINUE23:%.*]]
1362 ; DEFAULT: pred.store.if22:
1363 ; DEFAULT-NEXT: [[TMP60:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 5
1364 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP60]], align 4
1365 ; DEFAULT-NEXT: [[TMP61:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 5
1366 ; DEFAULT-NEXT: [[TMP62:%.*]] = getelementptr i8, ptr [[TMP61]], i64 4
1367 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP62]], align 4
1368 ; DEFAULT-NEXT: [[TMP63:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 5
1369 ; DEFAULT-NEXT: [[TMP64:%.*]] = getelementptr i8, ptr [[TMP63]], i64 8
1370 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP64]], align 4
1371 ; DEFAULT-NEXT: [[TMP65:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 5
1372 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP65]], align 4
1373 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE23]]
1374 ; DEFAULT: pred.store.continue23:
1375 ; DEFAULT-NEXT: [[TMP66:%.*]] = extractelement <8 x i1> [[TMP22]], i32 6
1376 ; DEFAULT-NEXT: br i1 [[TMP66]], label [[PRED_STORE_IF24:%.*]], label [[PRED_STORE_CONTINUE25:%.*]]
1377 ; DEFAULT: pred.store.if24:
1378 ; DEFAULT-NEXT: [[TMP67:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 6
1379 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP67]], align 4
1380 ; DEFAULT-NEXT: [[TMP68:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 6
1381 ; DEFAULT-NEXT: [[TMP69:%.*]] = getelementptr i8, ptr [[TMP68]], i64 4
1382 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP69]], align 4
1383 ; DEFAULT-NEXT: [[TMP70:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 6
1384 ; DEFAULT-NEXT: [[TMP71:%.*]] = getelementptr i8, ptr [[TMP70]], i64 8
1385 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP71]], align 4
1386 ; DEFAULT-NEXT: [[TMP72:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 6
1387 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP72]], align 4
1388 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE25]]
1389 ; DEFAULT: pred.store.continue25:
1390 ; DEFAULT-NEXT: [[TMP73:%.*]] = extractelement <8 x i1> [[TMP22]], i32 7
1391 ; DEFAULT-NEXT: br i1 [[TMP73]], label [[PRED_STORE_IF26:%.*]], label [[PRED_STORE_CONTINUE27]]
1392 ; DEFAULT: pred.store.if26:
1393 ; DEFAULT-NEXT: [[TMP74:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 7
1394 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP74]], align 4
1395 ; DEFAULT-NEXT: [[TMP75:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 7
1396 ; DEFAULT-NEXT: [[TMP76:%.*]] = getelementptr i8, ptr [[TMP75]], i64 4
1397 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP76]], align 4
1398 ; DEFAULT-NEXT: [[TMP77:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 7
1399 ; DEFAULT-NEXT: [[TMP78:%.*]] = getelementptr i8, ptr [[TMP77]], i64 8
1400 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP78]], align 4
1401 ; DEFAULT-NEXT: [[TMP79:%.*]] = extractelement <8 x ptr> [[TMP23]], i32 7
1402 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[TMP79]], align 4
1403 ; DEFAULT-NEXT: br label [[PRED_STORE_CONTINUE27]]
1404 ; DEFAULT: pred.store.continue27:
1405 ; DEFAULT-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 8
1406 ; DEFAULT-NEXT: [[VEC_IND_NEXT]] = add <8 x i64> [[VEC_IND]], <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8>
1407 ; DEFAULT-NEXT: [[TMP80:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
1408 ; DEFAULT-NEXT: br i1 [[TMP80]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP28:![0-9]+]]
1409 ; DEFAULT: middle.block:
1410 ; DEFAULT-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[TMP0]], [[N_VEC]]
1411 ; DEFAULT-NEXT: br i1 [[CMP_N]], label [[EXIT:%.*]], label [[SCALAR_PH]]
1412 ; DEFAULT: scalar.ph:
1413 ; DEFAULT-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ], [ 0, [[VECTOR_SCEVCHECK]] ]
1414 ; DEFAULT-NEXT: br label [[LOOP_HEADER:%.*]]
1415 ; DEFAULT: loop.header:
1416 ; DEFAULT-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP_LATCH:%.*]] ]
1417 ; DEFAULT-NEXT: [[TMP81:%.*]] = load float, ptr [[SRC_1]], align 4
1418 ; DEFAULT-NEXT: [[TMP82:%.*]] = load float, ptr [[SRC_2]], align 4
1419 ; DEFAULT-NEXT: [[MUL8_I_US:%.*]] = fmul float [[TMP82]], 0.000000e+00
1420 ; DEFAULT-NEXT: [[TMP83:%.*]] = tail call float @llvm.fmuladd.f32(float [[TMP81]], float 0.000000e+00, float [[MUL8_I_US]])
1421 ; DEFAULT-NEXT: [[TMP84:%.*]] = load float, ptr [[SRC_3]], align 4
1422 ; DEFAULT-NEXT: [[TMP85:%.*]] = tail call float @llvm.fmuladd.f32(float [[TMP84]], float 0.000000e+00, float [[TMP83]])
1423 ; DEFAULT-NEXT: [[TMP86:%.*]] = load float, ptr [[SRC_3]], align 4
1424 ; DEFAULT-NEXT: [[C:%.*]] = fcmp ogt float [[TMP85]], [[TMP86]]
1425 ; DEFAULT-NEXT: br i1 [[C]], label [[IF_THEN:%.*]], label [[LOOP_LATCH]]
1427 ; DEFAULT-NEXT: [[DST_0:%.*]] = getelementptr { [4 x float] }, ptr [[DST]], i64 [[IV]]
1428 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[DST_0]], align 4
1429 ; DEFAULT-NEXT: [[DST_1:%.*]] = getelementptr i8, ptr [[DST_0]], i64 4
1430 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[DST_1]], align 4
1431 ; DEFAULT-NEXT: [[DST_2:%.*]] = getelementptr i8, ptr [[DST_0]], i64 8
1432 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[DST_2]], align 4
1433 ; DEFAULT-NEXT: [[DST_3:%.*]] = getelementptr i8, ptr [[DST_0]], i64 16
1434 ; DEFAULT-NEXT: store float 0.000000e+00, ptr [[DST_0]], align 4
1435 ; DEFAULT-NEXT: br label [[LOOP_LATCH]]
1436 ; DEFAULT: loop.latch:
1437 ; DEFAULT-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
1438 ; DEFAULT-NEXT: [[EC:%.*]] = icmp eq i64 [[IV]], [[N]]
1439 ; DEFAULT-NEXT: br i1 [[EC]], label [[EXIT]], label [[LOOP_HEADER]], !llvm.loop [[LOOP29:![0-9]+]]
1441 ; DEFAULT-NEXT: ret void
1443 ; PRED-LABEL: define void @test_conditional_interleave_group(
1444 ; PRED-SAME: ptr noalias [[SRC_1:%.*]], ptr noalias [[SRC_2:%.*]], ptr noalias [[SRC_3:%.*]], ptr noalias [[SRC_4:%.*]], ptr noalias [[DST:%.*]], i64 [[N:%.*]]) #[[ATTR3:[0-9]+]] {
1446 ; PRED-NEXT: [[TMP0:%.*]] = add i64 [[N]], 1
1447 ; PRED-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_SCEVCHECK:%.*]]
1448 ; PRED: vector.scevcheck:
1449 ; PRED-NEXT: [[SCEVGEP:%.*]] = getelementptr i8, ptr [[DST]], i64 4
1450 ; PRED-NEXT: [[MUL:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 16, i64 [[N]])
1451 ; PRED-NEXT: [[MUL_RESULT:%.*]] = extractvalue { i64, i1 } [[MUL]], 0
1452 ; PRED-NEXT: [[MUL_OVERFLOW:%.*]] = extractvalue { i64, i1 } [[MUL]], 1
1453 ; PRED-NEXT: [[TMP1:%.*]] = sub i64 0, [[MUL_RESULT]]
1454 ; PRED-NEXT: [[TMP2:%.*]] = getelementptr i8, ptr [[SCEVGEP]], i64 [[MUL_RESULT]]
1455 ; PRED-NEXT: [[TMP3:%.*]] = icmp ult ptr [[TMP2]], [[SCEVGEP]]
1456 ; PRED-NEXT: [[TMP4:%.*]] = or i1 [[TMP3]], [[MUL_OVERFLOW]]
1457 ; PRED-NEXT: [[SCEVGEP1:%.*]] = getelementptr i8, ptr [[DST]], i64 8
1458 ; PRED-NEXT: [[MUL2:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 16, i64 [[N]])
1459 ; PRED-NEXT: [[MUL_RESULT3:%.*]] = extractvalue { i64, i1 } [[MUL2]], 0
1460 ; PRED-NEXT: [[MUL_OVERFLOW4:%.*]] = extractvalue { i64, i1 } [[MUL2]], 1
1461 ; PRED-NEXT: [[TMP5:%.*]] = sub i64 0, [[MUL_RESULT3]]
1462 ; PRED-NEXT: [[TMP6:%.*]] = getelementptr i8, ptr [[SCEVGEP1]], i64 [[MUL_RESULT3]]
1463 ; PRED-NEXT: [[TMP7:%.*]] = icmp ult ptr [[TMP6]], [[SCEVGEP1]]
1464 ; PRED-NEXT: [[TMP8:%.*]] = or i1 [[TMP7]], [[MUL_OVERFLOW4]]
1465 ; PRED-NEXT: [[MUL5:%.*]] = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 16, i64 [[N]])
1466 ; PRED-NEXT: [[MUL_RESULT6:%.*]] = extractvalue { i64, i1 } [[MUL5]], 0
1467 ; PRED-NEXT: [[MUL_OVERFLOW7:%.*]] = extractvalue { i64, i1 } [[MUL5]], 1
1468 ; PRED-NEXT: [[TMP9:%.*]] = sub i64 0, [[MUL_RESULT6]]
1469 ; PRED-NEXT: [[TMP10:%.*]] = getelementptr i8, ptr [[DST]], i64 [[MUL_RESULT6]]
1470 ; PRED-NEXT: [[TMP11:%.*]] = icmp ult ptr [[TMP10]], [[DST]]
1471 ; PRED-NEXT: [[TMP12:%.*]] = or i1 [[TMP11]], [[MUL_OVERFLOW7]]
1472 ; PRED-NEXT: [[TMP13:%.*]] = or i1 [[TMP4]], [[TMP8]]
1473 ; PRED-NEXT: [[TMP14:%.*]] = or i1 [[TMP13]], [[TMP12]]
1474 ; PRED-NEXT: br i1 [[TMP14]], label [[SCALAR_PH]], label [[VECTOR_PH:%.*]]
1476 ; PRED-NEXT: [[N_RND_UP:%.*]] = add i64 [[TMP0]], 7
1477 ; PRED-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[N_RND_UP]], 8
1478 ; PRED-NEXT: [[N_VEC:%.*]] = sub i64 [[N_RND_UP]], [[N_MOD_VF]]
1479 ; PRED-NEXT: [[TMP15:%.*]] = sub i64 [[TMP0]], 8
1480 ; PRED-NEXT: [[TMP16:%.*]] = icmp ugt i64 [[TMP0]], 8
1481 ; PRED-NEXT: [[TMP17:%.*]] = select i1 [[TMP16]], i64 [[TMP15]], i64 0
1482 ; PRED-NEXT: [[ACTIVE_LANE_MASK_ENTRY:%.*]] = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i64(i64 0, i64 [[TMP0]])
1483 ; PRED-NEXT: br label [[VECTOR_BODY:%.*]]
1484 ; PRED: vector.body:
1485 ; PRED-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_STORE_CONTINUE27:%.*]] ]
1486 ; PRED-NEXT: [[ACTIVE_LANE_MASK:%.*]] = phi <8 x i1> [ [[ACTIVE_LANE_MASK_ENTRY]], [[VECTOR_PH]] ], [ [[ACTIVE_LANE_MASK_NEXT:%.*]], [[PRED_STORE_CONTINUE27]] ]
1487 ; PRED-NEXT: [[VEC_IND:%.*]] = phi <8 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7>, [[VECTOR_PH]] ], [ [[VEC_IND_NEXT:%.*]], [[PRED_STORE_CONTINUE27]] ]
1488 ; PRED-NEXT: [[TMP18:%.*]] = load float, ptr [[SRC_1]], align 4
1489 ; PRED-NEXT: [[BROADCAST_SPLATINSERT8:%.*]] = insertelement <8 x float> poison, float [[TMP18]], i64 0
1490 ; PRED-NEXT: [[BROADCAST_SPLAT9:%.*]] = shufflevector <8 x float> [[BROADCAST_SPLATINSERT8]], <8 x float> poison, <8 x i32> zeroinitializer
1491 ; PRED-NEXT: [[TMP19:%.*]] = load float, ptr [[SRC_2]], align 4
1492 ; PRED-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <8 x float> poison, float [[TMP19]], i64 0
1493 ; PRED-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <8 x float> [[BROADCAST_SPLATINSERT]], <8 x float> poison, <8 x i32> zeroinitializer
1494 ; PRED-NEXT: [[TMP20:%.*]] = fmul <8 x float> [[BROADCAST_SPLAT]], zeroinitializer
1495 ; PRED-NEXT: [[TMP21:%.*]] = call <8 x float> @llvm.fmuladd.v8f32(<8 x float> [[BROADCAST_SPLAT9]], <8 x float> zeroinitializer, <8 x float> [[TMP20]])
1496 ; PRED-NEXT: [[TMP22:%.*]] = load float, ptr [[SRC_3]], align 4
1497 ; PRED-NEXT: [[BROADCAST_SPLATINSERT10:%.*]] = insertelement <8 x float> poison, float [[TMP22]], i64 0
1498 ; PRED-NEXT: [[BROADCAST_SPLAT11:%.*]] = shufflevector <8 x float> [[BROADCAST_SPLATINSERT10]], <8 x float> poison, <8 x i32> zeroinitializer
1499 ; PRED-NEXT: [[TMP23:%.*]] = call <8 x float> @llvm.fmuladd.v8f32(<8 x float> [[BROADCAST_SPLAT11]], <8 x float> zeroinitializer, <8 x float> [[TMP21]])
1500 ; PRED-NEXT: [[TMP24:%.*]] = load float, ptr [[SRC_3]], align 4
1501 ; PRED-NEXT: [[BROADCAST_SPLATINSERT12:%.*]] = insertelement <8 x float> poison, float [[TMP24]], i64 0
1502 ; PRED-NEXT: [[BROADCAST_SPLAT13:%.*]] = shufflevector <8 x float> [[BROADCAST_SPLATINSERT12]], <8 x float> poison, <8 x i32> zeroinitializer
1503 ; PRED-NEXT: [[TMP25:%.*]] = fcmp ogt <8 x float> [[TMP23]], [[BROADCAST_SPLAT13]]
1504 ; PRED-NEXT: [[TMP26:%.*]] = select <8 x i1> [[ACTIVE_LANE_MASK]], <8 x i1> [[TMP25]], <8 x i1> zeroinitializer
1505 ; PRED-NEXT: [[TMP27:%.*]] = getelementptr { [4 x float] }, ptr [[DST]], <8 x i64> [[VEC_IND]]
1506 ; PRED-NEXT: [[TMP28:%.*]] = extractelement <8 x i1> [[TMP26]], i32 0
1507 ; PRED-NEXT: br i1 [[TMP28]], label [[PRED_STORE_IF:%.*]], label [[PRED_STORE_CONTINUE:%.*]]
1508 ; PRED: pred.store.if:
1509 ; PRED-NEXT: [[TMP29:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 0
1510 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP29]], align 4
1511 ; PRED-NEXT: [[TMP30:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 0
1512 ; PRED-NEXT: [[TMP31:%.*]] = getelementptr i8, ptr [[TMP30]], i64 4
1513 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP31]], align 4
1514 ; PRED-NEXT: [[TMP32:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 0
1515 ; PRED-NEXT: [[TMP33:%.*]] = getelementptr i8, ptr [[TMP32]], i64 8
1516 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP33]], align 4
1517 ; PRED-NEXT: [[TMP34:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 0
1518 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP34]], align 4
1519 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE]]
1520 ; PRED: pred.store.continue:
1521 ; PRED-NEXT: [[TMP35:%.*]] = extractelement <8 x i1> [[TMP26]], i32 1
1522 ; PRED-NEXT: br i1 [[TMP35]], label [[PRED_STORE_IF14:%.*]], label [[PRED_STORE_CONTINUE15:%.*]]
1523 ; PRED: pred.store.if14:
1524 ; PRED-NEXT: [[TMP36:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 1
1525 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP36]], align 4
1526 ; PRED-NEXT: [[TMP37:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 1
1527 ; PRED-NEXT: [[TMP38:%.*]] = getelementptr i8, ptr [[TMP37]], i64 4
1528 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP38]], align 4
1529 ; PRED-NEXT: [[TMP39:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 1
1530 ; PRED-NEXT: [[TMP40:%.*]] = getelementptr i8, ptr [[TMP39]], i64 8
1531 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP40]], align 4
1532 ; PRED-NEXT: [[TMP41:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 1
1533 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP41]], align 4
1534 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE15]]
1535 ; PRED: pred.store.continue15:
1536 ; PRED-NEXT: [[TMP42:%.*]] = extractelement <8 x i1> [[TMP26]], i32 2
1537 ; PRED-NEXT: br i1 [[TMP42]], label [[PRED_STORE_IF16:%.*]], label [[PRED_STORE_CONTINUE17:%.*]]
1538 ; PRED: pred.store.if16:
1539 ; PRED-NEXT: [[TMP43:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 2
1540 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP43]], align 4
1541 ; PRED-NEXT: [[TMP44:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 2
1542 ; PRED-NEXT: [[TMP45:%.*]] = getelementptr i8, ptr [[TMP44]], i64 4
1543 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP45]], align 4
1544 ; PRED-NEXT: [[TMP46:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 2
1545 ; PRED-NEXT: [[TMP47:%.*]] = getelementptr i8, ptr [[TMP46]], i64 8
1546 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP47]], align 4
1547 ; PRED-NEXT: [[TMP48:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 2
1548 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP48]], align 4
1549 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE17]]
1550 ; PRED: pred.store.continue17:
1551 ; PRED-NEXT: [[TMP49:%.*]] = extractelement <8 x i1> [[TMP26]], i32 3
1552 ; PRED-NEXT: br i1 [[TMP49]], label [[PRED_STORE_IF18:%.*]], label [[PRED_STORE_CONTINUE19:%.*]]
1553 ; PRED: pred.store.if18:
1554 ; PRED-NEXT: [[TMP50:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 3
1555 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP50]], align 4
1556 ; PRED-NEXT: [[TMP51:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 3
1557 ; PRED-NEXT: [[TMP52:%.*]] = getelementptr i8, ptr [[TMP51]], i64 4
1558 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP52]], align 4
1559 ; PRED-NEXT: [[TMP53:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 3
1560 ; PRED-NEXT: [[TMP54:%.*]] = getelementptr i8, ptr [[TMP53]], i64 8
1561 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP54]], align 4
1562 ; PRED-NEXT: [[TMP55:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 3
1563 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP55]], align 4
1564 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE19]]
1565 ; PRED: pred.store.continue19:
1566 ; PRED-NEXT: [[TMP56:%.*]] = extractelement <8 x i1> [[TMP26]], i32 4
1567 ; PRED-NEXT: br i1 [[TMP56]], label [[PRED_STORE_IF20:%.*]], label [[PRED_STORE_CONTINUE21:%.*]]
1568 ; PRED: pred.store.if20:
1569 ; PRED-NEXT: [[TMP57:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 4
1570 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP57]], align 4
1571 ; PRED-NEXT: [[TMP58:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 4
1572 ; PRED-NEXT: [[TMP59:%.*]] = getelementptr i8, ptr [[TMP58]], i64 4
1573 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP59]], align 4
1574 ; PRED-NEXT: [[TMP60:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 4
1575 ; PRED-NEXT: [[TMP61:%.*]] = getelementptr i8, ptr [[TMP60]], i64 8
1576 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP61]], align 4
1577 ; PRED-NEXT: [[TMP62:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 4
1578 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP62]], align 4
1579 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE21]]
1580 ; PRED: pred.store.continue21:
1581 ; PRED-NEXT: [[TMP63:%.*]] = extractelement <8 x i1> [[TMP26]], i32 5
1582 ; PRED-NEXT: br i1 [[TMP63]], label [[PRED_STORE_IF22:%.*]], label [[PRED_STORE_CONTINUE23:%.*]]
1583 ; PRED: pred.store.if22:
1584 ; PRED-NEXT: [[TMP64:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 5
1585 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP64]], align 4
1586 ; PRED-NEXT: [[TMP65:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 5
1587 ; PRED-NEXT: [[TMP66:%.*]] = getelementptr i8, ptr [[TMP65]], i64 4
1588 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP66]], align 4
1589 ; PRED-NEXT: [[TMP67:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 5
1590 ; PRED-NEXT: [[TMP68:%.*]] = getelementptr i8, ptr [[TMP67]], i64 8
1591 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP68]], align 4
1592 ; PRED-NEXT: [[TMP69:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 5
1593 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP69]], align 4
1594 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE23]]
1595 ; PRED: pred.store.continue23:
1596 ; PRED-NEXT: [[TMP70:%.*]] = extractelement <8 x i1> [[TMP26]], i32 6
1597 ; PRED-NEXT: br i1 [[TMP70]], label [[PRED_STORE_IF24:%.*]], label [[PRED_STORE_CONTINUE25:%.*]]
1598 ; PRED: pred.store.if24:
1599 ; PRED-NEXT: [[TMP71:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 6
1600 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP71]], align 4
1601 ; PRED-NEXT: [[TMP72:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 6
1602 ; PRED-NEXT: [[TMP73:%.*]] = getelementptr i8, ptr [[TMP72]], i64 4
1603 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP73]], align 4
1604 ; PRED-NEXT: [[TMP74:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 6
1605 ; PRED-NEXT: [[TMP75:%.*]] = getelementptr i8, ptr [[TMP74]], i64 8
1606 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP75]], align 4
1607 ; PRED-NEXT: [[TMP76:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 6
1608 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP76]], align 4
1609 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE25]]
1610 ; PRED: pred.store.continue25:
1611 ; PRED-NEXT: [[TMP77:%.*]] = extractelement <8 x i1> [[TMP26]], i32 7
1612 ; PRED-NEXT: br i1 [[TMP77]], label [[PRED_STORE_IF26:%.*]], label [[PRED_STORE_CONTINUE27]]
1613 ; PRED: pred.store.if26:
1614 ; PRED-NEXT: [[TMP78:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 7
1615 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP78]], align 4
1616 ; PRED-NEXT: [[TMP79:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 7
1617 ; PRED-NEXT: [[TMP80:%.*]] = getelementptr i8, ptr [[TMP79]], i64 4
1618 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP80]], align 4
1619 ; PRED-NEXT: [[TMP81:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 7
1620 ; PRED-NEXT: [[TMP82:%.*]] = getelementptr i8, ptr [[TMP81]], i64 8
1621 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP82]], align 4
1622 ; PRED-NEXT: [[TMP83:%.*]] = extractelement <8 x ptr> [[TMP27]], i32 7
1623 ; PRED-NEXT: store float 0.000000e+00, ptr [[TMP83]], align 4
1624 ; PRED-NEXT: br label [[PRED_STORE_CONTINUE27]]
1625 ; PRED: pred.store.continue27:
1626 ; PRED-NEXT: [[INDEX_NEXT]] = add i64 [[INDEX]], 8
1627 ; PRED-NEXT: [[ACTIVE_LANE_MASK_NEXT]] = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i64(i64 [[INDEX]], i64 [[TMP17]])
1628 ; PRED-NEXT: [[TMP84:%.*]] = xor <8 x i1> [[ACTIVE_LANE_MASK_NEXT]], <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>
1629 ; PRED-NEXT: [[VEC_IND_NEXT]] = add <8 x i64> [[VEC_IND]], <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8>
1630 ; PRED-NEXT: [[TMP85:%.*]] = extractelement <8 x i1> [[TMP84]], i32 0
1631 ; PRED-NEXT: br i1 [[TMP85]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.loop [[LOOP25:![0-9]+]]
1632 ; PRED: middle.block:
1633 ; PRED-NEXT: br i1 true, label [[EXIT:%.*]], label [[SCALAR_PH]]
1635 ; PRED-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.*]] ], [ 0, [[VECTOR_SCEVCHECK]] ]
1636 ; PRED-NEXT: br label [[LOOP_HEADER:%.*]]
1637 ; PRED: loop.header:
1638 ; PRED-NEXT: [[IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[IV_NEXT:%.*]], [[LOOP_LATCH:%.*]] ]
1639 ; PRED-NEXT: [[TMP86:%.*]] = load float, ptr [[SRC_1]], align 4
1640 ; PRED-NEXT: [[TMP87:%.*]] = load float, ptr [[SRC_2]], align 4
1641 ; PRED-NEXT: [[MUL8_I_US:%.*]] = fmul float [[TMP87]], 0.000000e+00
1642 ; PRED-NEXT: [[TMP88:%.*]] = tail call float @llvm.fmuladd.f32(float [[TMP86]], float 0.000000e+00, float [[MUL8_I_US]])
1643 ; PRED-NEXT: [[TMP89:%.*]] = load float, ptr [[SRC_3]], align 4
1644 ; PRED-NEXT: [[TMP90:%.*]] = tail call float @llvm.fmuladd.f32(float [[TMP89]], float 0.000000e+00, float [[TMP88]])
1645 ; PRED-NEXT: [[TMP91:%.*]] = load float, ptr [[SRC_3]], align 4
1646 ; PRED-NEXT: [[C:%.*]] = fcmp ogt float [[TMP90]], [[TMP91]]
1647 ; PRED-NEXT: br i1 [[C]], label [[IF_THEN:%.*]], label [[LOOP_LATCH]]
1649 ; PRED-NEXT: [[DST_0:%.*]] = getelementptr { [4 x float] }, ptr [[DST]], i64 [[IV]]
1650 ; PRED-NEXT: store float 0.000000e+00, ptr [[DST_0]], align 4
1651 ; PRED-NEXT: [[DST_1:%.*]] = getelementptr i8, ptr [[DST_0]], i64 4
1652 ; PRED-NEXT: store float 0.000000e+00, ptr [[DST_1]], align 4
1653 ; PRED-NEXT: [[DST_2:%.*]] = getelementptr i8, ptr [[DST_0]], i64 8
1654 ; PRED-NEXT: store float 0.000000e+00, ptr [[DST_2]], align 4
1655 ; PRED-NEXT: [[DST_3:%.*]] = getelementptr i8, ptr [[DST_0]], i64 16
1656 ; PRED-NEXT: store float 0.000000e+00, ptr [[DST_0]], align 4
1657 ; PRED-NEXT: br label [[LOOP_LATCH]]
1659 ; PRED-NEXT: [[IV_NEXT]] = add i64 [[IV]], 1
1660 ; PRED-NEXT: [[EC:%.*]] = icmp eq i64 [[IV]], [[N]]
1661 ; PRED-NEXT: br i1 [[EC]], label [[EXIT]], label [[LOOP_HEADER]], !llvm.loop [[LOOP26:![0-9]+]]
1663 ; PRED-NEXT: ret void
1666 br label %loop.header
1669 %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
1670 %0 = load float, ptr %src.1, align 4
1671 %1 = load float, ptr %src.2, align 4
1672 %mul8.i.us = fmul float %1, 0.000000e+00
1673 %2 = tail call float @llvm.fmuladd.f32(float %0, float 0.000000e+00, float %mul8.i.us)
1674 %3 = load float, ptr %src.3, align 4
1675 %4 = tail call float @llvm.fmuladd.f32(float %3, float 0.000000e+00, float %2)
1676 %5 = load float, ptr %src.3, align 4
1677 %c = fcmp ogt float %4, %5
1678 br i1 %c, label %if.then, label %loop.latch
1681 %dst.0 = getelementptr { [4 x float] }, ptr %dst, i64 %iv
1682 store float 0.000000e+00, ptr %dst.0, align 4
1683 %dst.1 = getelementptr i8, ptr %dst.0, i64 4
1684 store float 0.000000e+00, ptr %dst.1, align 4
1685 %dst.2 = getelementptr i8, ptr %dst.0, i64 8
1686 store float 0.000000e+00, ptr %dst.2, align 4
1687 %dst.3 = getelementptr i8, ptr %dst.0, i64 16
1688 store float 0.000000e+00, ptr %dst.0, align 4
1689 br label %loop.latch
1692 %iv.next = add i64 %iv, 1
1693 %ec = icmp eq i64 %iv, %N
1694 br i1 %ec, label %exit, label %loop.header
1700 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
1701 declare float @llvm.fmuladd.f32(float, float, float) #1
1703 attributes #1 = { "target-cpu"="neoverse-512tvb" }
1704 attributes #2 = { vscale_range(2,2) "target-cpu"="neoverse-512tvb" }
1707 ; DEFAULT: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]}
1708 ; DEFAULT: [[META1]] = !{!"llvm.loop.isvectorized", i32 1}
1709 ; DEFAULT: [[META2]] = !{!"llvm.loop.unroll.runtime.disable"}
1710 ; DEFAULT: [[LOOP3]] = distinct !{[[LOOP3]], [[META2]], [[META1]]}
1711 ; DEFAULT: [[LOOP4]] = distinct !{[[LOOP4]], [[META1]], [[META2]]}
1712 ; DEFAULT: [[LOOP5]] = distinct !{[[LOOP5]], [[META2]], [[META1]]}
1713 ; DEFAULT: [[LOOP6]] = distinct !{[[LOOP6]], [[META1]], [[META2]]}
1714 ; DEFAULT: [[LOOP7]] = distinct !{[[LOOP7]], [[META1]], [[META2]]}
1715 ; DEFAULT: [[LOOP8]] = distinct !{[[LOOP8]], [[META2]], [[META1]]}
1716 ; DEFAULT: [[META9]] = !{[[META10:![0-9]+]]}
1717 ; DEFAULT: [[META10]] = distinct !{[[META10]], [[META11:![0-9]+]]}
1718 ; DEFAULT: [[META11]] = distinct !{[[META11]], !"LVerDomain"}
1719 ; DEFAULT: [[META12]] = !{[[META13:![0-9]+]]}
1720 ; DEFAULT: [[META13]] = distinct !{[[META13]], [[META11]]}
1721 ; DEFAULT: [[META14]] = !{[[META15:![0-9]+]]}
1722 ; DEFAULT: [[META15]] = distinct !{[[META15]], [[META11]]}
1723 ; DEFAULT: [[META16]] = !{[[META17:![0-9]+]]}
1724 ; DEFAULT: [[META17]] = distinct !{[[META17]], [[META11]]}
1725 ; DEFAULT: [[META18]] = !{[[META19:![0-9]+]], [[META10]], [[META13]], [[META15]]}
1726 ; DEFAULT: [[META19]] = distinct !{[[META19]], [[META11]]}
1727 ; DEFAULT: [[META20]] = !{[[META19]]}
1728 ; DEFAULT: [[META21]] = !{[[META10]], [[META13]], [[META15]]}
1729 ; DEFAULT: [[LOOP22]] = distinct !{[[LOOP22]], [[META1]], [[META2]]}
1730 ; DEFAULT: [[LOOP23]] = distinct !{[[LOOP23]], [[META1]]}
1731 ; DEFAULT: [[LOOP24]] = distinct !{[[LOOP24]], [[META1]], [[META2]]}
1732 ; DEFAULT: [[LOOP25]] = distinct !{[[LOOP25]], [[META2]], [[META1]]}
1733 ; DEFAULT: [[LOOP26]] = distinct !{[[LOOP26]], [[META1]], [[META2]]}
1734 ; DEFAULT: [[LOOP27]] = distinct !{[[LOOP27]], [[META2]], [[META1]]}
1735 ; DEFAULT: [[LOOP28]] = distinct !{[[LOOP28]], [[META1]], [[META2]]}
1736 ; DEFAULT: [[LOOP29]] = distinct !{[[LOOP29]], [[META1]]}
1738 ; PRED: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]}
1739 ; PRED: [[META1]] = !{!"llvm.loop.isvectorized", i32 1}
1740 ; PRED: [[META2]] = !{!"llvm.loop.unroll.runtime.disable"}
1741 ; PRED: [[LOOP3]] = distinct !{[[LOOP3]], [[META2]], [[META1]]}
1742 ; PRED: [[LOOP4]] = distinct !{[[LOOP4]], [[META1]], [[META2]]}
1743 ; PRED: [[LOOP5]] = distinct !{[[LOOP5]], [[META2]], [[META1]]}
1744 ; PRED: [[META6]] = !{[[META7:![0-9]+]]}
1745 ; PRED: [[META7]] = distinct !{[[META7]], [[META8:![0-9]+]]}
1746 ; PRED: [[META8]] = distinct !{[[META8]], !"LVerDomain"}
1747 ; PRED: [[META9]] = !{[[META10:![0-9]+]]}
1748 ; PRED: [[META10]] = distinct !{[[META10]], [[META8]]}
1749 ; PRED: [[META11]] = !{[[META12:![0-9]+]]}
1750 ; PRED: [[META12]] = distinct !{[[META12]], [[META8]]}
1751 ; PRED: [[META13]] = !{[[META14:![0-9]+]]}
1752 ; PRED: [[META14]] = distinct !{[[META14]], [[META8]]}
1753 ; PRED: [[META15]] = !{[[META16:![0-9]+]], [[META7]], [[META10]], [[META12]]}
1754 ; PRED: [[META16]] = distinct !{[[META16]], [[META8]]}
1755 ; PRED: [[META17]] = !{[[META16]]}
1756 ; PRED: [[META18]] = !{[[META7]], [[META10]], [[META12]]}
1757 ; PRED: [[LOOP19]] = distinct !{[[LOOP19]], [[META1]], [[META2]]}
1758 ; PRED: [[LOOP20]] = distinct !{[[LOOP20]], [[META1]]}
1759 ; PRED: [[LOOP21]] = distinct !{[[LOOP21]], [[META1]], [[META2]]}
1760 ; PRED: [[LOOP22]] = distinct !{[[LOOP22]], [[META2]], [[META1]]}
1761 ; PRED: [[LOOP23]] = distinct !{[[LOOP23]], [[META1]], [[META2]]}
1762 ; PRED: [[LOOP24]] = distinct !{[[LOOP24]], [[META2]], [[META1]]}
1763 ; PRED: [[LOOP25]] = distinct !{[[LOOP25]], [[META1]], [[META2]]}
1764 ; PRED: [[LOOP26]] = distinct !{[[LOOP26]], [[META1]]}