Skip to content

Commit dbdd4f3

Browse files
committed
!fixup merge conditions, add VPlan printing, use for FP
1 parent 7ed9803 commit dbdd4f3

12 files changed

+64
-47
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,6 @@ void VPlan::prepareToExecute(Value *TripCountV, Value *VectorTripCountV,
932932
if (VF.getNumUsers()) {
933933
RuntimeVF = createStepForVF(Builder, TripCountV->getType(), State.VF, 1);
934934
VF.setUnderlyingValue(RuntimeVF);
935-
}
936-
if (RuntimeVF) {
937935
VFxUF.setUnderlyingValue(
938936
State.UF > 1 ? Builder.CreateMul(
939937
VF.getLiveInIRValue(),
@@ -1105,6 +1103,12 @@ InstructionCost VPlan::cost(ElementCount VF, VPCostContext &Ctx) {
11051103
void VPlan::printLiveIns(raw_ostream &O) const {
11061104
VPSlotTracker SlotTracker(this);
11071105

1106+
if (VF.getNumUsers() > 0) {
1107+
O << "\nLive-in ";
1108+
VF.printAsOperand(O, SlotTracker);
1109+
O << " = VF";
1110+
}
1111+
11081112
if (VFxUF.getNumUsers() > 0) {
11091113
O << "\nLive-in ";
11101114
VFxUF.printAsOperand(O, SlotTracker);
@@ -1560,6 +1564,8 @@ void VPSlotTracker::assignName(const VPValue *V) {
15601564
}
15611565

15621566
void VPSlotTracker::assignNames(const VPlan &Plan) {
1567+
if (Plan.VF.getNumUsers() > 0)
1568+
assignName(&Plan.VF);
15631569
if (Plan.VFxUF.getNumUsers() > 0)
15641570
assignName(&Plan.VFxUF);
15651571
assignName(&Plan.VectorTripCount);

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,9 @@ class VPWidenIntOrFpInductionRecipe : public VPHeaderPHIRecipe {
18231823
VPValue *getStepValue() { return getOperand(1); }
18241824
const VPValue *getStepValue() const { return getOperand(1); }
18251825

1826+
VPValue *getVFValue() { return getOperand(2); }
1827+
const VPValue *getVFValue() const { return getOperand(2); }
1828+
18261829
/// Returns the first defined value as TruncInst, if it is one or nullptr
18271830
/// otherwise.
18281831
TruncInst *getTruncInst() { return Trunc; }

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,14 +1243,6 @@ static Constant *getSignedIntOrFpConstant(Type *Ty, int64_t C) {
12431243
: ConstantFP::get(Ty, C);
12441244
}
12451245

1246-
static Value *getRuntimeVFAsFloat(IRBuilderBase &B, Type *FTy,
1247-
ElementCount VF) {
1248-
assert(FTy->isFloatingPointTy() && "Expected floating point type!");
1249-
Type *IntTy = IntegerType::get(FTy->getContext(), FTy->getScalarSizeInBits());
1250-
Value *RuntimeVF = getRuntimeVF(B, IntTy, VF);
1251-
return B.CreateUIToFP(RuntimeVF, FTy);
1252-
}
1253-
12541246
void VPWidenIntOrFpInductionRecipe::execute(VPTransformState &State) {
12551247
assert(!State.Instance && "Int or FP induction being replicated.");
12561248

@@ -1308,9 +1300,9 @@ void VPWidenIntOrFpInductionRecipe::execute(VPTransformState &State) {
13081300
// Multiply the vectorization factor by the step using integer or
13091301
// floating-point arithmetic as appropriate.
13101302
Type *StepType = Step->getType();
1311-
Value *RuntimeVF = State.get(getOperand(2), {0, 0});
1303+
Value *RuntimeVF = State.get(getVFValue(), {0, 0});
13121304
if (Step->getType()->isFloatingPointTy())
1313-
RuntimeVF = getRuntimeVFAsFloat(Builder, StepType, State.VF);
1305+
RuntimeVF = Builder.CreateUIToFP(RuntimeVF, StepType);
13141306
else
13151307
RuntimeVF = Builder.CreateZExtOrTrunc(RuntimeVF, StepType);
13161308
Value *Mul = Builder.CreateBinOp(MulOp, Step, RuntimeVF);
@@ -1366,6 +1358,9 @@ void VPWidenIntOrFpInductionRecipe::print(raw_ostream &O, const Twine &Indent,
13661358

13671359
O << ", ";
13681360
getStepValue()->printAsOperand(O, SlotTracker);
1361+
1362+
O << ", ";
1363+
getVFValue()->printAsOperand(O, SlotTracker);
13691364
}
13701365
#endif
13711366

llvm/test/Transforms/LoopVectorize/AArch64/sve-inductions-unusual-types.ll

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ define void @induction_i7(ptr %dst) #0 {
2525
; CHECK-NEXT: [[TMP8:%.*]] = add <vscale x 2 x i7> [[TMP7]], zeroinitializer
2626
; CHECK-NEXT: [[TMP9:%.*]] = mul <vscale x 2 x i7> [[TMP8]], shufflevector (<vscale x 2 x i7> insertelement (<vscale x 2 x i7> poison, i7 1, i64 0), <vscale x 2 x i7> poison, <vscale x 2 x i32> zeroinitializer)
2727
; CHECK-NEXT: [[INDUCTION:%.*]] = add <vscale x 2 x i7> zeroinitializer, [[TMP9]]
28-
; CHECK-NEXT: [[TMP10:%.*]] = call i7 @llvm.vscale.i7()
29-
; CHECK-NEXT: [[TMP11:%.*]] = mul i7 [[TMP10]], 2
28+
; CHECK-NEXT: [[TMP11:%.*]] = trunc i64 [[TMP40]] to i7
3029
; CHECK-NEXT: [[TMP12:%.*]] = mul i7 1, [[TMP11]]
3130
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 2 x i7> poison, i7 [[TMP12]], i64 0
3231
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 2 x i7> [[DOTSPLATINSERT]], <vscale x 2 x i7> poison, <vscale x 2 x i32> zeroinitializer
@@ -100,8 +99,7 @@ define void @induction_i3_zext(ptr %dst) #0 {
10099
; CHECK-NEXT: [[TMP8:%.*]] = add <vscale x 2 x i3> [[TMP7]], zeroinitializer
101100
; CHECK-NEXT: [[TMP9:%.*]] = mul <vscale x 2 x i3> [[TMP8]], shufflevector (<vscale x 2 x i3> insertelement (<vscale x 2 x i3> poison, i3 1, i64 0), <vscale x 2 x i3> poison, <vscale x 2 x i32> zeroinitializer)
102101
; CHECK-NEXT: [[INDUCTION:%.*]] = add <vscale x 2 x i3> zeroinitializer, [[TMP9]]
103-
; CHECK-NEXT: [[TMP10:%.*]] = call i3 @llvm.vscale.i3()
104-
; CHECK-NEXT: [[TMP11:%.*]] = mul i3 [[TMP10]], 2
102+
; CHECK-NEXT: [[TMP11:%.*]] = trunc i64 [[TMP40]] to i3
105103
; CHECK-NEXT: [[TMP12:%.*]] = mul i3 1, [[TMP11]]
106104
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 2 x i3> poison, i3 [[TMP12]], i64 0
107105
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 2 x i3> [[DOTSPLATINSERT]], <vscale x 2 x i3> poison, <vscale x 2 x i32> zeroinitializer

llvm/test/Transforms/LoopVectorize/PowerPC/vplan-force-tail-with-evl.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) {
1010
; CHECK-LABEL: VPlan 'Initial VPlan for VF={2,4},UF>=1' {
11+
; CHECK-NEXT: Live-in vp<[[VF:%.+]]> = VF
1112
; CHECK-NEXT: Live-in vp<[[VFxUF:%.+]]> = VF * UF
1213
; CHECK-NEXT: Live-in vp<[[VTC:%.+]]> = vector-trip-count
1314
; CHECK-NEXT: Live-in vp<[[BTC:%.+]]> = backedge-taken count
@@ -19,7 +20,7 @@ define void @foo(ptr noalias %a, ptr noalias %b, ptr noalias %c, i64 %N) {
1920
; CHECK-NEXT: <x1> vector loop: {
2021
; CHECK-NEXT: vector.body:
2122
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_INC:%.*]]>
22-
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>
23+
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>, vp<[[VF]]>
2324
; CHECK-NEXT: EMIT vp<[[CMP:%.+]]> = icmp ule ir<%iv>, vp<[[BTC]]>
2425
; CHECK-NEXT: Successor(s): pred.store
2526
; CHECK-EMPTY:

llvm/test/Transforms/LoopVectorize/RISCV/vectorize-force-tail-with-evl-cond-reduction.ll

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,7 @@ define i32 @step_cond_add(ptr %a, i64 %n, i32 %start) {
513513
; NO-VP-OUTLOOP-NEXT: [[TMP13:%.*]] = add <vscale x 4 x i32> [[TMP12]], zeroinitializer
514514
; NO-VP-OUTLOOP-NEXT: [[TMP14:%.*]] = mul <vscale x 4 x i32> [[TMP13]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 1, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
515515
; NO-VP-OUTLOOP-NEXT: [[INDUCTION:%.*]] = add <vscale x 4 x i32> zeroinitializer, [[TMP14]]
516-
; NO-VP-OUTLOOP-NEXT: [[TMP15:%.*]] = call i32 @llvm.vscale.i32()
517-
; NO-VP-OUTLOOP-NEXT: [[TMP16:%.*]] = mul i32 [[TMP15]], 4
516+
; NO-VP-OUTLOOP-NEXT: [[TMP16:%.*]] = trunc i64 [[TMP10]] to i32
518517
; NO-VP-OUTLOOP-NEXT: [[TMP17:%.*]] = mul i32 1, [[TMP16]]
519518
; NO-VP-OUTLOOP-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP17]], i64 0
520519
; NO-VP-OUTLOOP-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
@@ -576,8 +575,7 @@ define i32 @step_cond_add(ptr %a, i64 %n, i32 %start) {
576575
; NO-VP-INLOOP-NEXT: [[TMP7:%.*]] = add <vscale x 4 x i32> [[TMP6]], zeroinitializer
577576
; NO-VP-INLOOP-NEXT: [[TMP8:%.*]] = mul <vscale x 4 x i32> [[TMP7]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 1, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
578577
; NO-VP-INLOOP-NEXT: [[INDUCTION:%.*]] = add <vscale x 4 x i32> zeroinitializer, [[TMP8]]
579-
; NO-VP-INLOOP-NEXT: [[TMP9:%.*]] = call i32 @llvm.vscale.i32()
580-
; NO-VP-INLOOP-NEXT: [[TMP10:%.*]] = mul i32 [[TMP9]], 4
578+
; NO-VP-INLOOP-NEXT: [[TMP10:%.*]] = trunc i64 [[TMP5]] to i32
581579
; NO-VP-INLOOP-NEXT: [[TMP11:%.*]] = mul i32 1, [[TMP10]]
582580
; NO-VP-INLOOP-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP11]], i64 0
583581
; NO-VP-INLOOP-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
@@ -709,8 +707,7 @@ define i32 @step_cond_add_pred(ptr %a, i64 %n, i32 %start) {
709707
; NO-VP-OUTLOOP-NEXT: [[TMP13:%.*]] = add <vscale x 4 x i32> [[TMP12]], zeroinitializer
710708
; NO-VP-OUTLOOP-NEXT: [[TMP14:%.*]] = mul <vscale x 4 x i32> [[TMP13]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 1, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
711709
; NO-VP-OUTLOOP-NEXT: [[INDUCTION:%.*]] = add <vscale x 4 x i32> zeroinitializer, [[TMP14]]
712-
; NO-VP-OUTLOOP-NEXT: [[TMP15:%.*]] = call i32 @llvm.vscale.i32()
713-
; NO-VP-OUTLOOP-NEXT: [[TMP16:%.*]] = mul i32 [[TMP15]], 4
710+
; NO-VP-OUTLOOP-NEXT: [[TMP16:%.*]] = trunc i64 [[TMP10]] to i32
714711
; NO-VP-OUTLOOP-NEXT: [[TMP17:%.*]] = mul i32 1, [[TMP16]]
715712
; NO-VP-OUTLOOP-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP17]], i64 0
716713
; NO-VP-OUTLOOP-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
@@ -777,8 +774,7 @@ define i32 @step_cond_add_pred(ptr %a, i64 %n, i32 %start) {
777774
; NO-VP-INLOOP-NEXT: [[TMP7:%.*]] = add <vscale x 4 x i32> [[TMP6]], zeroinitializer
778775
; NO-VP-INLOOP-NEXT: [[TMP8:%.*]] = mul <vscale x 4 x i32> [[TMP7]], shufflevector (<vscale x 4 x i32> insertelement (<vscale x 4 x i32> poison, i32 1, i64 0), <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer)
779776
; NO-VP-INLOOP-NEXT: [[INDUCTION:%.*]] = add <vscale x 4 x i32> zeroinitializer, [[TMP8]]
780-
; NO-VP-INLOOP-NEXT: [[TMP9:%.*]] = call i32 @llvm.vscale.i32()
781-
; NO-VP-INLOOP-NEXT: [[TMP10:%.*]] = mul i32 [[TMP9]], 4
777+
; NO-VP-INLOOP-NEXT: [[TMP10:%.*]] = trunc i64 [[TMP5]] to i32
782778
; NO-VP-INLOOP-NEXT: [[TMP11:%.*]] = mul i32 1, [[TMP10]]
783779
; NO-VP-INLOOP-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[TMP11]], i64 0
784780
; NO-VP-INLOOP-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[DOTSPLATINSERT]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer

llvm/test/Transforms/LoopVectorize/first-order-recurrence-sink-replicate-region.ll

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
99
define void @sink_replicate_region_1(i32 %x, ptr %ptr, ptr noalias %dst) optsize {
1010
; CHECK-LABEL: sink_replicate_region_1
1111
; CHECK: VPlan 'Initial VPlan for VF={2},UF>=1' {
12+
; CHECK-NEXT: Live-in vp<[[VF:%.+]]> = VF
1213
; CHECK-NEXT: Live-in vp<[[VFxUF:%.+]]> = VF * UF
1314
; CHECK-NEXT: Live-in vp<[[VEC_TC:%.+]]> = vector-trip-count
1415
; CHECK-NEXT: Live-in vp<[[BTC:%.+]]> = backedge-taken count
@@ -21,7 +22,7 @@ define void @sink_replicate_region_1(i32 %x, ptr %ptr, ptr noalias %dst) optsize
2122
; CHECK-NEXT: vector.body:
2223
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION
2324
; CHECK-NEXT: FIRST-ORDER-RECURRENCE-PHI ir<%0> = phi ir<0>, ir<%conv>
24-
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>
25+
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>, vp<[[VF]]>
2526
; CHECK-NEXT: vp<[[STEPS:%.]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
2627
; CHECK-NEXT: EMIT vp<[[MASK:%.+]]> = icmp ule ir<%iv>, vp<[[BTC]]>
2728
; CHECK-NEXT: Successor(s): pred.load
@@ -111,6 +112,7 @@ exit:
111112
define void @sink_replicate_region_2(i32 %x, i8 %y, ptr %ptr) optsize {
112113
; CHECK-LABEL: sink_replicate_region_2
113114
; CHECK: VPlan 'Initial VPlan for VF={2},UF>=1' {
115+
; CHECK-NEXT: Live-in vp<[[VF:%.+]]> = VF
114116
; CHECK-NEXT: Live-in vp<[[VFxUF:%.+]]> = VF * UF
115117
; CHECK-NEXT: Live-in vp<[[VEC_TC:%.+]]> = vector-trip-count
116118
; CHECK-NEXT: Live-in vp<[[BTC:%.+]]> = backedge-taken count
@@ -123,7 +125,7 @@ define void @sink_replicate_region_2(i32 %x, i8 %y, ptr %ptr) optsize {
123125
; CHECK-NEXT: vector.body:
124126
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION
125127
; CHECK-NEXT: FIRST-ORDER-RECURRENCE-PHI ir<%recur> = phi ir<0>, ir<%recur.next>
126-
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>
128+
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>, vp<[[VF]]>
127129
; CHECK-NEXT: EMIT vp<[[MASK:%.+]]> = icmp ule ir<%iv>, vp<[[BTC]]>
128130
; CHECK-NEXT: WIDEN-CAST ir<%recur.next> = sext ir<%y> to i32
129131
; CHECK-NEXT: EMIT vp<[[SPLICE:%.+]]> = first-order splice ir<%recur>, ir<%recur.next>
@@ -278,6 +280,7 @@ exit:
278280
define void @sink_replicate_region_4_requires_split_at_end_of_block(i32 %x, ptr %ptr, ptr noalias %dst) optsize {
279281
; CHECK-LABEL: sink_replicate_region_4_requires_split_at_end_of_block
280282
; CHECK: VPlan 'Initial VPlan for VF={2},UF>=1' {
283+
; CHECK-NEXT: Live-in vp<[[VF:%.+]]> = VF
281284
; CHECK-NEXT: Live-in vp<[[VFxUF:%.+]]> = VF * UF
282285
; CHECK-NEXT: Live-in vp<[[VEC_TC:%.+]]> = vector-trip-count
283286
; CHECK-NEXT: Live-in vp<[[BTC:%.+]]> = backedge-taken count
@@ -290,7 +293,7 @@ define void @sink_replicate_region_4_requires_split_at_end_of_block(i32 %x, ptr
290293
; CHECK-NEXT: vector.body:
291294
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION
292295
; CHECK-NEXT: FIRST-ORDER-RECURRENCE-PHI ir<%0> = phi ir<0>, ir<%conv>
293-
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>
296+
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>, vp<[[VF]]>
294297
; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
295298
; CHECK-NEXT: EMIT vp<[[MASK:%.+]]> = icmp ule ir<%iv>, vp<[[BTC]]>
296299
; CHECK-NEXT: REPLICATE ir<%gep> = getelementptr ir<%ptr>, vp<[[STEPS]]>
@@ -388,6 +391,7 @@ exit:
388391
define void @sink_replicate_region_after_replicate_region(ptr %ptr, ptr noalias %dst.2, i32 %x, i8 %y) optsize {
389392
; CHECK-LABEL: sink_replicate_region_after_replicate_region
390393
; CHECK: VPlan 'Initial VPlan for VF={2},UF>=1' {
394+
; CHECK-NEXT: Live-in vp<[[VF:%.+]]> = VF
391395
; CHECK-NEXT: Live-in vp<[[VFxUF:%.+]]> = VF * UF
392396
; CHECK-NEXT: Live-in vp<[[VEC_TC:%.+]]> = vector-trip-count
393397
; CHECK-NEXT: Live-in vp<[[BTC:%.+]]> = backedge-taken count

llvm/test/Transforms/LoopVectorize/icmp-uniforms.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ for.end:
3737
; Check for crash exposed by D76992.
3838
; CHECK-LABEL: 'test'
3939
; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
40+
; CHECK-NEXT: Live-in vp<[[VF:%.+]]> = VF
4041
; CHECK-NEXT: Live-in vp<[[VFxUF:%.+]]> = VF * UF
4142
; CHECK-NEXT: Live-in vp<[[VEC_TC:%.+]]> = vector-trip-count
4243
; CHECK-NEXT: Live-in vp<[[BTC:%.+]]> = backedge-taken count
@@ -48,7 +49,7 @@ for.end:
4849
; CHECK-NEXT: <x1> vector loop: {
4950
; CHECK-NEXT: vector.body:
5051
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION
51-
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>
52+
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next, ir<1>, vp<[[VF]]
5253
; CHECK-NEXT: EMIT vp<[[COND:%.+]]> = icmp ule ir<%iv>, vp<[[BTC]]>
5354
; CHECK-NEXT: WIDEN ir<%cond0> = icmp ult ir<%iv>, ir<13>
5455
; CHECK-NEXT: WIDEN-SELECT ir<%s> = select ir<%cond0>, ir<10>, ir<20>

llvm/test/Transforms/LoopVectorize/scalable-inductions.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,7 @@ define void @add_unique_indf32(ptr noalias nocapture %a, i64 %n) {
271271
; CHECK-NEXT: [[TMP8:%.*]] = uitofp <vscale x 4 x i32> [[TMP7]] to <vscale x 4 x float>
272272
; CHECK-NEXT: [[TMP9:%.*]] = fmul <vscale x 4 x float> [[TMP8]], shufflevector (<vscale x 4 x float> insertelement (<vscale x 4 x float> poison, float 2.000000e+00, i64 0), <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer)
273273
; CHECK-NEXT: [[INDUCTION:%.*]] = fadd <vscale x 4 x float> [[TMP9]], zeroinitializer
274-
; CHECK-NEXT: [[TMP10:%.*]] = call i32 @llvm.vscale.i32()
275-
; CHECK-NEXT: [[TMP11:%.*]] = shl i32 [[TMP10]], 2
276-
; CHECK-NEXT: [[TMP12:%.*]] = uitofp i32 [[TMP11]] to float
274+
; CHECK-NEXT: [[TMP12:%.*]] = uitofp i64 [[TMP6]] to float
277275
; CHECK-NEXT: [[TMP13:%.*]] = fmul float [[TMP12]], 2.000000e+00
278276
; CHECK-NEXT: [[DOTSPLATINSERT:%.*]] = insertelement <vscale x 4 x float> poison, float [[TMP13]], i64 0
279277
; CHECK-NEXT: [[DOTSPLAT:%.*]] = shufflevector <vscale x 4 x float> [[DOTSPLATINSERT]], <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer

llvm/test/Transforms/LoopVectorize/vplan-iv-transforms.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
define void @iv_no_binary_op_in_descriptor(i1 %c, ptr %dst) {
55
; CHECK-LABEL: LV: Checking a loop in 'iv_no_binary_op_in_descriptor'
66
; CHECK: VPlan 'Initial VPlan for VF={8},UF>=1' {
7+
; CHECK-NEXT: Live-in vp<[[VF:%.+]]> = VF
78
; CHECK-NEXT: Live-in vp<[[VFxUF:%.+]]> = VF * UF
89
; CHECK-NEXT: Live-in vp<[[VEC_TC:%.+]]> = vector-trip-count
910
; CHECK-NEXT: Live-in ir<1000> = original trip-count
@@ -14,7 +15,7 @@ define void @iv_no_binary_op_in_descriptor(i1 %c, ptr %dst) {
1415
; CHECK-NEXT: <x1> vector loop: {
1516
; CHECK-NEXT: vector.body:
1617
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION
17-
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next.p, ir<1>
18+
; CHECK-NEXT: WIDEN-INDUCTION %iv = phi 0, %iv.next.p, ir<1>, vp<[[VF]]>
1819
; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>
1920
; CHECK-NEXT: CLONE ir<%gep> = getelementptr inbounds ir<%dst>, vp<[[STEPS:%.+]]>
2021
; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%gep>

0 commit comments

Comments
 (0)