Lines Matching refs:GATHER
3 …r-width=8 -force-vector-interleave=1 -loop-vectorize < %s | FileCheck %s --check-prefix=SINK-GATHER
81 ; SINK-GATHER-LABEL: @predicated_sdiv_masked_load(
82 ; SINK-GATHER-NEXT: entry:
83 ; SINK-GATHER-NEXT: br i1 false, label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
84 ; SINK-GATHER: vector.ph:
85 ; SINK-GATHER-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <8 x i1> poison, i1 [[C:%.*]],…
86 ; SINK-GATHER-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <8 x i1> [[BROADCAST_SPLATINSERT]], …
87 ; SINK-GATHER-NEXT: br label [[VECTOR_BODY:%.*]]
88 ; SINK-GATHER: vector.body:
89 ; SINK-GATHER-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_S…
90 ; SINK-GATHER-NEXT: [[VEC_PHI:%.*]] = phi <8 x i32> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP4…
91 ; SINK-GATHER-NEXT: [[TMP0:%.*]] = add i64 [[INDEX]], 0
92 ; SINK-GATHER-NEXT: [[TMP1:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[TMP0]]
93 ; SINK-GATHER-NEXT: [[TMP2:%.*]] = getelementptr inbounds i32, i32* [[TMP1]], i32 0
94 ; SINK-GATHER-NEXT: [[TMP3:%.*]] = bitcast i32* [[TMP2]] to <8 x i32>*
95 ; SINK-GATHER-NEXT: [[WIDE_LOAD:%.*]] = load <8 x i32>, <8 x i32>* [[TMP3]], align 4
96 ; SINK-GATHER-NEXT: [[TMP4:%.*]] = getelementptr i32, i32* [[B:%.*]], i64 [[TMP0]]
97 ; SINK-GATHER-NEXT: [[TMP5:%.*]] = getelementptr i32, i32* [[TMP4]], i32 0
98 ; SINK-GATHER-NEXT: [[TMP6:%.*]] = bitcast i32* [[TMP5]] to <8 x i32>*
99 ; SINK-GATHER-NEXT: [[WIDE_MASKED_LOAD:%.*]] = call <8 x i32> @llvm.masked.load.v8i32.p0v8i32(<8…
100 ; SINK-GATHER-NEXT: [[TMP7:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 0
101 ; SINK-GATHER-NEXT: br i1 [[TMP7]], label [[PRED_SDIV_IF:%.*]], label [[PRED_SDIV_CONTINUE:%.*]]
102 ; SINK-GATHER: pred.sdiv.if:
103 ; SINK-GATHER-NEXT: [[TMP8:%.*]] = extractelement <8 x i32> [[WIDE_MASKED_LOAD]], i32 0
104 ; SINK-GATHER-NEXT: [[TMP9:%.*]] = sdiv i32 [[TMP8]], [[X:%.*]]
105 ; SINK-GATHER-NEXT: [[TMP10:%.*]] = insertelement <8 x i32> poison, i32 [[TMP9]], i32 0
106 ; SINK-GATHER-NEXT: br label [[PRED_SDIV_CONTINUE]]
107 ; SINK-GATHER: pred.sdiv.continue:
108 ; SINK-GATHER-NEXT: [[TMP11:%.*]] = phi <8 x i32> [ poison, [[VECTOR_BODY]] ], [ [[TMP10]], [[PR…
109 ; SINK-GATHER-NEXT: [[TMP12:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 1
110 ; SINK-GATHER-NEXT: br i1 [[TMP12]], label [[PRED_SDIV_IF1:%.*]], label [[PRED_SDIV_CONTINUE2:%.…
111 ; SINK-GATHER: pred.sdiv.if1:
112 ; SINK-GATHER-NEXT: [[TMP13:%.*]] = extractelement <8 x i32> [[WIDE_MASKED_LOAD]], i32 1
113 ; SINK-GATHER-NEXT: [[TMP14:%.*]] = sdiv i32 [[TMP13]], [[X]]
114 ; SINK-GATHER-NEXT: [[TMP15:%.*]] = insertelement <8 x i32> [[TMP11]], i32 [[TMP14]], i32 1
115 ; SINK-GATHER-NEXT: br label [[PRED_SDIV_CONTINUE2]]
116 ; SINK-GATHER: pred.sdiv.continue2:
117 ; SINK-GATHER-NEXT: [[TMP16:%.*]] = phi <8 x i32> [ [[TMP11]], [[PRED_SDIV_CONTINUE]] ], [ [[TMP…
118 ; SINK-GATHER-NEXT: [[TMP17:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 2
119 ; SINK-GATHER-NEXT: br i1 [[TMP17]], label [[PRED_SDIV_IF3:%.*]], label [[PRED_SDIV_CONTINUE4:%.…
120 ; SINK-GATHER: pred.sdiv.if3:
121 ; SINK-GATHER-NEXT: [[TMP18:%.*]] = extractelement <8 x i32> [[WIDE_MASKED_LOAD]], i32 2
122 ; SINK-GATHER-NEXT: [[TMP19:%.*]] = sdiv i32 [[TMP18]], [[X]]
123 ; SINK-GATHER-NEXT: [[TMP20:%.*]] = insertelement <8 x i32> [[TMP16]], i32 [[TMP19]], i32 2
124 ; SINK-GATHER-NEXT: br label [[PRED_SDIV_CONTINUE4]]
125 ; SINK-GATHER: pred.sdiv.continue4:
126 ; SINK-GATHER-NEXT: [[TMP21:%.*]] = phi <8 x i32> [ [[TMP16]], [[PRED_SDIV_CONTINUE2]] ], [ [[TM…
127 ; SINK-GATHER-NEXT: [[TMP22:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 3
128 ; SINK-GATHER-NEXT: br i1 [[TMP22]], label [[PRED_SDIV_IF5:%.*]], label [[PRED_SDIV_CONTINUE6:%.…
129 ; SINK-GATHER: pred.sdiv.if5:
130 ; SINK-GATHER-NEXT: [[TMP23:%.*]] = extractelement <8 x i32> [[WIDE_MASKED_LOAD]], i32 3
131 ; SINK-GATHER-NEXT: [[TMP24:%.*]] = sdiv i32 [[TMP23]], [[X]]
132 ; SINK-GATHER-NEXT: [[TMP25:%.*]] = insertelement <8 x i32> [[TMP21]], i32 [[TMP24]], i32 3
133 ; SINK-GATHER-NEXT: br label [[PRED_SDIV_CONTINUE6]]
134 ; SINK-GATHER: pred.sdiv.continue6:
135 ; SINK-GATHER-NEXT: [[TMP26:%.*]] = phi <8 x i32> [ [[TMP21]], [[PRED_SDIV_CONTINUE4]] ], [ [[TM…
136 ; SINK-GATHER-NEXT: [[TMP27:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 4
137 ; SINK-GATHER-NEXT: br i1 [[TMP27]], label [[PRED_SDIV_IF7:%.*]], label [[PRED_SDIV_CONTINUE8:%.…
138 ; SINK-GATHER: pred.sdiv.if7:
139 ; SINK-GATHER-NEXT: [[TMP28:%.*]] = extractelement <8 x i32> [[WIDE_MASKED_LOAD]], i32 4
140 ; SINK-GATHER-NEXT: [[TMP29:%.*]] = sdiv i32 [[TMP28]], [[X]]
141 ; SINK-GATHER-NEXT: [[TMP30:%.*]] = insertelement <8 x i32> [[TMP26]], i32 [[TMP29]], i32 4
142 ; SINK-GATHER-NEXT: br label [[PRED_SDIV_CONTINUE8]]
143 ; SINK-GATHER: pred.sdiv.continue8:
144 ; SINK-GATHER-NEXT: [[TMP31:%.*]] = phi <8 x i32> [ [[TMP26]], [[PRED_SDIV_CONTINUE6]] ], [ [[TM…
145 ; SINK-GATHER-NEXT: [[TMP32:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 5
146 ; SINK-GATHER-NEXT: br i1 [[TMP32]], label [[PRED_SDIV_IF9:%.*]], label [[PRED_SDIV_CONTINUE10:%…
147 ; SINK-GATHER: pred.sdiv.if9:
148 ; SINK-GATHER-NEXT: [[TMP33:%.*]] = extractelement <8 x i32> [[WIDE_MASKED_LOAD]], i32 5
149 ; SINK-GATHER-NEXT: [[TMP34:%.*]] = sdiv i32 [[TMP33]], [[X]]
150 ; SINK-GATHER-NEXT: [[TMP35:%.*]] = insertelement <8 x i32> [[TMP31]], i32 [[TMP34]], i32 5
151 ; SINK-GATHER-NEXT: br label [[PRED_SDIV_CONTINUE10]]
152 ; SINK-GATHER: pred.sdiv.continue10:
153 ; SINK-GATHER-NEXT: [[TMP36:%.*]] = phi <8 x i32> [ [[TMP31]], [[PRED_SDIV_CONTINUE8]] ], [ [[TM…
154 ; SINK-GATHER-NEXT: [[TMP37:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 6
155 ; SINK-GATHER-NEXT: br i1 [[TMP37]], label [[PRED_SDIV_IF11:%.*]], label [[PRED_SDIV_CONTINUE12:…
156 ; SINK-GATHER: pred.sdiv.if11:
157 ; SINK-GATHER-NEXT: [[TMP38:%.*]] = extractelement <8 x i32> [[WIDE_MASKED_LOAD]], i32 6
158 ; SINK-GATHER-NEXT: [[TMP39:%.*]] = sdiv i32 [[TMP38]], [[X]]
159 ; SINK-GATHER-NEXT: [[TMP40:%.*]] = insertelement <8 x i32> [[TMP36]], i32 [[TMP39]], i32 6
160 ; SINK-GATHER-NEXT: br label [[PRED_SDIV_CONTINUE12]]
161 ; SINK-GATHER: pred.sdiv.continue12:
162 ; SINK-GATHER-NEXT: [[TMP41:%.*]] = phi <8 x i32> [ [[TMP36]], [[PRED_SDIV_CONTINUE10]] ], [ [[T…
163 ; SINK-GATHER-NEXT: [[TMP42:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 7
164 ; SINK-GATHER-NEXT: br i1 [[TMP42]], label [[PRED_SDIV_IF13:%.*]], label [[PRED_SDIV_CONTINUE14]]
165 ; SINK-GATHER: pred.sdiv.if13:
166 ; SINK-GATHER-NEXT: [[TMP43:%.*]] = extractelement <8 x i32> [[WIDE_MASKED_LOAD]], i32 7
167 ; SINK-GATHER-NEXT: [[TMP44:%.*]] = sdiv i32 [[TMP43]], [[X]]
168 ; SINK-GATHER-NEXT: [[TMP45:%.*]] = insertelement <8 x i32> [[TMP41]], i32 [[TMP44]], i32 7
169 ; SINK-GATHER-NEXT: br label [[PRED_SDIV_CONTINUE14]]
170 ; SINK-GATHER: pred.sdiv.continue14:
171 ; SINK-GATHER-NEXT: [[TMP46:%.*]] = phi <8 x i32> [ [[TMP41]], [[PRED_SDIV_CONTINUE12]] ], [ [[T…
172 ; SINK-GATHER-NEXT: [[TMP47:%.*]] = add nsw <8 x i32> [[TMP46]], [[WIDE_LOAD]]
173 ; SINK-GATHER-NEXT: [[TMP48:%.*]] = xor <8 x i1> [[BROADCAST_SPLAT]], <i1 true, i1 true, i1 true…
174 ; SINK-GATHER-NEXT: [[PREDPHI:%.*]] = select <8 x i1> [[BROADCAST_SPLAT]], <8 x i32> [[TMP47]], …
175 ; SINK-GATHER-NEXT: [[TMP49]] = add <8 x i32> [[VEC_PHI]], [[PREDPHI]]
176 ; SINK-GATHER-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 8
177 ; SINK-GATHER-NEXT: [[TMP50:%.*]] = icmp eq i64 [[INDEX_NEXT]], 10000
178 ; SINK-GATHER-NEXT: br i1 [[TMP50]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.lo…
179 ; SINK-GATHER: middle.block:
180 ; SINK-GATHER-NEXT: [[TMP51:%.*]] = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> [[TMP49]])
181 ; SINK-GATHER-NEXT: [[CMP_N:%.*]] = icmp eq i64 10000, 10000
182 ; SINK-GATHER-NEXT: br i1 [[CMP_N]], label [[FOR_END:%.*]], label [[SCALAR_PH]]
183 ; SINK-GATHER: scalar.ph:
184 ; SINK-GATHER-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ 10000, [[MIDDLE_BLOCK]] ], [ 0, [[ENTRY:%.…
185 ; SINK-GATHER-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP51]], [[MIDDLE_BLOCK…
186 ; SINK-GATHER-NEXT: br label [[FOR_BODY:%.*]]
187 ; SINK-GATHER: for.body:
188 ; SINK-GATHER-NEXT: [[I:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[I_NEXT:%.*]], …
189 ; SINK-GATHER-NEXT: [[R:%.*]] = phi i32 [ [[BC_MERGE_RDX]], [[SCALAR_PH]] ], [ [[T7:%.*]], [[FOR…
190 ; SINK-GATHER-NEXT: [[T0:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[I]]
191 ; SINK-GATHER-NEXT: [[T1:%.*]] = load i32, i32* [[T0]], align 4
192 ; SINK-GATHER-NEXT: br i1 [[C]], label [[IF_THEN:%.*]], label [[FOR_INC]]
193 ; SINK-GATHER: if.then:
194 ; SINK-GATHER-NEXT: [[T2:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 [[I]]
195 ; SINK-GATHER-NEXT: [[T3:%.*]] = load i32, i32* [[T2]], align 4
196 ; SINK-GATHER-NEXT: [[T4:%.*]] = sdiv i32 [[T3]], [[X]]
197 ; SINK-GATHER-NEXT: [[T5:%.*]] = add nsw i32 [[T4]], [[T1]]
198 ; SINK-GATHER-NEXT: br label [[FOR_INC]]
199 ; SINK-GATHER: for.inc:
200 ; SINK-GATHER-NEXT: [[T6:%.*]] = phi i32 [ [[T1]], [[FOR_BODY]] ], [ [[T5]], [[IF_THEN]] ]
201 ; SINK-GATHER-NEXT: [[T7]] = add i32 [[R]], [[T6]]
202 ; SINK-GATHER-NEXT: [[I_NEXT]] = add nuw nsw i64 [[I]], 1
203 ; SINK-GATHER-NEXT: [[COND:%.*]] = icmp eq i64 [[I_NEXT]], 10000
204 ; SINK-GATHER-NEXT: br i1 [[COND]], label [[FOR_END]], label [[FOR_BODY]], !llvm.loop [[LOOP2:![…
205 ; SINK-GATHER: for.end:
206 ; SINK-GATHER-NEXT: [[T8:%.*]] = phi i32 [ [[T7]], [[FOR_INC]] ], [ [[TMP51]], [[MIDDLE_BLOCK]] ]
207 ; SINK-GATHER-NEXT: ret i32 [[T8]]
319 ; SINK-GATHER-LABEL: @scalarize_and_sink_gather(
320 ; SINK-GATHER-NEXT: entry:
321 ; SINK-GATHER-NEXT: [[SMAX:%.*]] = call i64 @llvm.smax.i64(i64 [[N:%.*]], i64 1)
322 ; SINK-GATHER-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i64 [[SMAX]], 8
323 ; SINK-GATHER-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
324 ; SINK-GATHER: vector.ph:
325 ; SINK-GATHER-NEXT: [[N_MOD_VF:%.*]] = urem i64 [[SMAX]], 8
326 ; SINK-GATHER-NEXT: [[N_VEC:%.*]] = sub i64 [[SMAX]], [[N_MOD_VF]]
327 ; SINK-GATHER-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <8 x i1> poison, i1 [[C:%.*]],…
328 ; SINK-GATHER-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <8 x i1> [[BROADCAST_SPLATINSERT]], …
329 ; SINK-GATHER-NEXT: [[BROADCAST_SPLATINSERT15:%.*]] = insertelement <8 x i32> poison, i32 [[X:%.…
330 ; SINK-GATHER-NEXT: [[BROADCAST_SPLAT16:%.*]] = shufflevector <8 x i32> [[BROADCAST_SPLATINSERT1…
331 ; SINK-GATHER-NEXT: br label [[VECTOR_BODY:%.*]]
332 ; SINK-GATHER: vector.body:
333 ; SINK-GATHER-NEXT: [[INDEX:%.*]] = phi i64 [ 0, [[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], [[PRED_U…
334 ; SINK-GATHER-NEXT: [[VEC_IND:%.*]] = phi <8 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5,…
335 ; SINK-GATHER-NEXT: [[VEC_PHI:%.*]] = phi <8 x i32> [ zeroinitializer, [[VECTOR_PH]] ], [ [[TMP6…
336 ; SINK-GATHER-NEXT: [[TMP0:%.*]] = mul <8 x i64> [[VEC_IND]], <i64 777, i64 777, i64 777, i64 77…
337 ; SINK-GATHER-NEXT: [[TMP1:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 0
338 ; SINK-GATHER-NEXT: br i1 [[TMP1]], label [[PRED_UDIV_IF:%.*]], label [[PRED_UDIV_CONTINUE:%.*]]
339 ; SINK-GATHER: pred.udiv.if:
340 ; SINK-GATHER-NEXT: [[TMP2:%.*]] = extractelement <8 x i64> [[TMP0]], i32 0
341 ; SINK-GATHER-NEXT: [[TMP3:%.*]] = getelementptr inbounds i32, i32* [[A:%.*]], i64 [[TMP2]]
342 ; SINK-GATHER-NEXT: [[TMP4:%.*]] = load i32, i32* [[TMP3]], align 4
343 ; SINK-GATHER-NEXT: [[TMP5:%.*]] = udiv i32 [[TMP4]], [[X]]
344 ; SINK-GATHER-NEXT: [[TMP6:%.*]] = insertelement <8 x i32> poison, i32 [[TMP5]], i32 0
345 ; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE]]
346 ; SINK-GATHER: pred.udiv.continue:
347 ; SINK-GATHER-NEXT: [[TMP7:%.*]] = phi i32 [ poison, [[VECTOR_BODY]] ], [ [[TMP4]], [[PRED_UDIV_…
348 ; SINK-GATHER-NEXT: [[TMP8:%.*]] = phi <8 x i32> [ poison, [[VECTOR_BODY]] ], [ [[TMP6]], [[PRED…
349 ; SINK-GATHER-NEXT: [[TMP9:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 1
350 ; SINK-GATHER-NEXT: br i1 [[TMP9]], label [[PRED_UDIV_IF1:%.*]], label [[PRED_UDIV_CONTINUE2:%.*…
351 ; SINK-GATHER: pred.udiv.if1:
352 ; SINK-GATHER-NEXT: [[TMP10:%.*]] = extractelement <8 x i64> [[TMP0]], i32 1
353 ; SINK-GATHER-NEXT: [[TMP11:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[TMP10]]
354 ; SINK-GATHER-NEXT: [[TMP12:%.*]] = load i32, i32* [[TMP11]], align 4
355 ; SINK-GATHER-NEXT: [[TMP13:%.*]] = udiv i32 [[TMP12]], [[X]]
356 ; SINK-GATHER-NEXT: [[TMP14:%.*]] = insertelement <8 x i32> [[TMP8]], i32 [[TMP13]], i32 1
357 ; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE2]]
358 ; SINK-GATHER: pred.udiv.continue2:
359 ; SINK-GATHER-NEXT: [[TMP15:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE]] ], [ [[TMP12]], [[P…
360 ; SINK-GATHER-NEXT: [[TMP16:%.*]] = phi <8 x i32> [ [[TMP8]], [[PRED_UDIV_CONTINUE]] ], [ [[TMP1…
361 ; SINK-GATHER-NEXT: [[TMP17:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 2
362 ; SINK-GATHER-NEXT: br i1 [[TMP17]], label [[PRED_UDIV_IF3:%.*]], label [[PRED_UDIV_CONTINUE4:%.…
363 ; SINK-GATHER: pred.udiv.if3:
364 ; SINK-GATHER-NEXT: [[TMP18:%.*]] = extractelement <8 x i64> [[TMP0]], i32 2
365 ; SINK-GATHER-NEXT: [[TMP19:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[TMP18]]
366 ; SINK-GATHER-NEXT: [[TMP20:%.*]] = load i32, i32* [[TMP19]], align 4
367 ; SINK-GATHER-NEXT: [[TMP21:%.*]] = udiv i32 [[TMP20]], [[X]]
368 ; SINK-GATHER-NEXT: [[TMP22:%.*]] = insertelement <8 x i32> [[TMP16]], i32 [[TMP21]], i32 2
369 ; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE4]]
370 ; SINK-GATHER: pred.udiv.continue4:
371 ; SINK-GATHER-NEXT: [[TMP23:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE2]] ], [ [[TMP20]], [[…
372 ; SINK-GATHER-NEXT: [[TMP24:%.*]] = phi <8 x i32> [ [[TMP16]], [[PRED_UDIV_CONTINUE2]] ], [ [[TM…
373 ; SINK-GATHER-NEXT: [[TMP25:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 3
374 ; SINK-GATHER-NEXT: br i1 [[TMP25]], label [[PRED_UDIV_IF5:%.*]], label [[PRED_UDIV_CONTINUE6:%.…
375 ; SINK-GATHER: pred.udiv.if5:
376 ; SINK-GATHER-NEXT: [[TMP26:%.*]] = extractelement <8 x i64> [[TMP0]], i32 3
377 ; SINK-GATHER-NEXT: [[TMP27:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[TMP26]]
378 ; SINK-GATHER-NEXT: [[TMP28:%.*]] = load i32, i32* [[TMP27]], align 4
379 ; SINK-GATHER-NEXT: [[TMP29:%.*]] = udiv i32 [[TMP28]], [[X]]
380 ; SINK-GATHER-NEXT: [[TMP30:%.*]] = insertelement <8 x i32> [[TMP24]], i32 [[TMP29]], i32 3
381 ; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE6]]
382 ; SINK-GATHER: pred.udiv.continue6:
383 ; SINK-GATHER-NEXT: [[TMP31:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE4]] ], [ [[TMP28]], [[…
384 ; SINK-GATHER-NEXT: [[TMP32:%.*]] = phi <8 x i32> [ [[TMP24]], [[PRED_UDIV_CONTINUE4]] ], [ [[TM…
385 ; SINK-GATHER-NEXT: [[TMP33:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 4
386 ; SINK-GATHER-NEXT: br i1 [[TMP33]], label [[PRED_UDIV_IF7:%.*]], label [[PRED_UDIV_CONTINUE8:%.…
387 ; SINK-GATHER: pred.udiv.if7:
388 ; SINK-GATHER-NEXT: [[TMP34:%.*]] = extractelement <8 x i64> [[TMP0]], i32 4
389 ; SINK-GATHER-NEXT: [[TMP35:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[TMP34]]
390 ; SINK-GATHER-NEXT: [[TMP36:%.*]] = load i32, i32* [[TMP35]], align 4
391 ; SINK-GATHER-NEXT: [[TMP37:%.*]] = udiv i32 [[TMP36]], [[X]]
392 ; SINK-GATHER-NEXT: [[TMP38:%.*]] = insertelement <8 x i32> [[TMP32]], i32 [[TMP37]], i32 4
393 ; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE8]]
394 ; SINK-GATHER: pred.udiv.continue8:
395 ; SINK-GATHER-NEXT: [[TMP39:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE6]] ], [ [[TMP36]], [[…
396 ; SINK-GATHER-NEXT: [[TMP40:%.*]] = phi <8 x i32> [ [[TMP32]], [[PRED_UDIV_CONTINUE6]] ], [ [[TM…
397 ; SINK-GATHER-NEXT: [[TMP41:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 5
398 ; SINK-GATHER-NEXT: br i1 [[TMP41]], label [[PRED_UDIV_IF9:%.*]], label [[PRED_UDIV_CONTINUE10:%…
399 ; SINK-GATHER: pred.udiv.if9:
400 ; SINK-GATHER-NEXT: [[TMP42:%.*]] = extractelement <8 x i64> [[TMP0]], i32 5
401 ; SINK-GATHER-NEXT: [[TMP43:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[TMP42]]
402 ; SINK-GATHER-NEXT: [[TMP44:%.*]] = load i32, i32* [[TMP43]], align 4
403 ; SINK-GATHER-NEXT: [[TMP45:%.*]] = udiv i32 [[TMP44]], [[X]]
404 ; SINK-GATHER-NEXT: [[TMP46:%.*]] = insertelement <8 x i32> [[TMP40]], i32 [[TMP45]], i32 5
405 ; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE10]]
406 ; SINK-GATHER: pred.udiv.continue10:
407 ; SINK-GATHER-NEXT: [[TMP47:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE8]] ], [ [[TMP44]], [[…
408 ; SINK-GATHER-NEXT: [[TMP48:%.*]] = phi <8 x i32> [ [[TMP40]], [[PRED_UDIV_CONTINUE8]] ], [ [[TM…
409 ; SINK-GATHER-NEXT: [[TMP49:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 6
410 ; SINK-GATHER-NEXT: br i1 [[TMP49]], label [[PRED_UDIV_IF11:%.*]], label [[PRED_UDIV_CONTINUE12:…
411 ; SINK-GATHER: pred.udiv.if11:
412 ; SINK-GATHER-NEXT: [[TMP50:%.*]] = extractelement <8 x i64> [[TMP0]], i32 6
413 ; SINK-GATHER-NEXT: [[TMP51:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[TMP50]]
414 ; SINK-GATHER-NEXT: [[TMP52:%.*]] = load i32, i32* [[TMP51]], align 4
415 ; SINK-GATHER-NEXT: [[TMP53:%.*]] = udiv i32 [[TMP52]], [[X]]
416 ; SINK-GATHER-NEXT: [[TMP54:%.*]] = insertelement <8 x i32> [[TMP48]], i32 [[TMP53]], i32 6
417 ; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE12]]
418 ; SINK-GATHER: pred.udiv.continue12:
419 ; SINK-GATHER-NEXT: [[TMP55:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE10]] ], [ [[TMP52]], […
420 ; SINK-GATHER-NEXT: [[TMP56:%.*]] = phi <8 x i32> [ [[TMP48]], [[PRED_UDIV_CONTINUE10]] ], [ [[T…
421 ; SINK-GATHER-NEXT: [[TMP57:%.*]] = extractelement <8 x i1> [[BROADCAST_SPLAT]], i32 7
422 ; SINK-GATHER-NEXT: br i1 [[TMP57]], label [[PRED_UDIV_IF13:%.*]], label [[PRED_UDIV_CONTINUE14]]
423 ; SINK-GATHER: pred.udiv.if13:
424 ; SINK-GATHER-NEXT: [[TMP58:%.*]] = extractelement <8 x i64> [[TMP0]], i32 7
425 ; SINK-GATHER-NEXT: [[TMP59:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[TMP58]]
426 ; SINK-GATHER-NEXT: [[TMP60:%.*]] = load i32, i32* [[TMP59]], align 4
427 ; SINK-GATHER-NEXT: [[TMP61:%.*]] = udiv i32 [[TMP60]], [[X]]
428 ; SINK-GATHER-NEXT: [[TMP62:%.*]] = insertelement <8 x i32> [[TMP56]], i32 [[TMP61]], i32 7
429 ; SINK-GATHER-NEXT: br label [[PRED_UDIV_CONTINUE14]]
430 ; SINK-GATHER: pred.udiv.continue14:
431 ; SINK-GATHER-NEXT: [[TMP63:%.*]] = phi i32 [ poison, [[PRED_UDIV_CONTINUE12]] ], [ [[TMP60]], […
432 ; SINK-GATHER-NEXT: [[TMP64:%.*]] = phi <8 x i32> [ [[TMP56]], [[PRED_UDIV_CONTINUE12]] ], [ [[T…
433 ; SINK-GATHER-NEXT: [[TMP65:%.*]] = xor <8 x i1> [[BROADCAST_SPLAT]], <i1 true, i1 true, i1 true…
434 ; SINK-GATHER-NEXT: [[PREDPHI:%.*]] = select <8 x i1> [[BROADCAST_SPLAT]], <8 x i32> [[TMP64]], …
435 ; SINK-GATHER-NEXT: [[TMP66]] = add <8 x i32> [[VEC_PHI]], [[PREDPHI]]
436 ; SINK-GATHER-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 8
437 ; SINK-GATHER-NEXT: [[VEC_IND_NEXT]] = add <8 x i64> [[VEC_IND]], <i64 8, i64 8, i64 8, i64 8, i…
438 ; SINK-GATHER-NEXT: [[TMP67:%.*]] = icmp eq i64 [[INDEX_NEXT]], [[N_VEC]]
439 ; SINK-GATHER-NEXT: br i1 [[TMP67]], label [[MIDDLE_BLOCK:%.*]], label [[VECTOR_BODY]], !llvm.lo…
440 ; SINK-GATHER: middle.block:
441 ; SINK-GATHER-NEXT: [[TMP68:%.*]] = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> [[TMP66]])
442 ; SINK-GATHER-NEXT: [[CMP_N:%.*]] = icmp eq i64 [[SMAX]], [[N_VEC]]
443 ; SINK-GATHER-NEXT: br i1 [[CMP_N]], label [[FOR_END:%.*]], label [[SCALAR_PH]]
444 ; SINK-GATHER: scalar.ph:
445 ; SINK-GATHER-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], [[MIDDLE_BLOCK]] ], [ 0, [[ENTR…
446 ; SINK-GATHER-NEXT: [[BC_MERGE_RDX:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[TMP68]], [[MIDDLE_BLOCK…
447 ; SINK-GATHER-NEXT: br label [[FOR_BODY:%.*]]
448 ; SINK-GATHER: for.body:
449 ; SINK-GATHER-NEXT: [[I:%.*]] = phi i64 [ [[BC_RESUME_VAL]], [[SCALAR_PH]] ], [ [[I_NEXT:%.*]], …
450 ; SINK-GATHER-NEXT: [[R:%.*]] = phi i32 [ [[BC_MERGE_RDX]], [[SCALAR_PH]] ], [ [[T6:%.*]], [[FOR…
451 ; SINK-GATHER-NEXT: [[I7:%.*]] = mul i64 [[I]], 777
452 ; SINK-GATHER-NEXT: br i1 [[C]], label [[IF_THEN:%.*]], label [[FOR_INC]]
453 ; SINK-GATHER: if.then:
454 ; SINK-GATHER-NEXT: [[T0:%.*]] = getelementptr inbounds i32, i32* [[A]], i64 [[I7]]
455 ; SINK-GATHER-NEXT: [[T2:%.*]] = load i32, i32* [[T0]], align 4
456 ; SINK-GATHER-NEXT: [[T4:%.*]] = udiv i32 [[T2]], [[X]]
457 ; SINK-GATHER-NEXT: br label [[FOR_INC]]
458 ; SINK-GATHER: for.inc:
459 ; SINK-GATHER-NEXT: [[T5:%.*]] = phi i32 [ [[X]], [[FOR_BODY]] ], [ [[T4]], [[IF_THEN]] ]
460 ; SINK-GATHER-NEXT: [[T6]] = add i32 [[R]], [[T5]]
461 ; SINK-GATHER-NEXT: [[I_NEXT]] = add nuw nsw i64 [[I]], 1
462 ; SINK-GATHER-NEXT: [[COND:%.*]] = icmp slt i64 [[I_NEXT]], [[N]]
463 ; SINK-GATHER-NEXT: br i1 [[COND]], label [[FOR_BODY]], label [[FOR_END]], !llvm.loop [[LOOP5:![…
464 ; SINK-GATHER: for.end:
465 ; SINK-GATHER-NEXT: [[T7:%.*]] = phi i32 [ [[T6]], [[FOR_INC]] ], [ [[TMP68]], [[MIDDLE_BLOCK]] ]
466 ; SINK-GATHER-NEXT: ret i32 [[T7]]