Skip to content

Commit 68b6b66

Browse files
committed
Update vplan test to include preheader, remove references to old recipes, remove stray .
1 parent 5457030 commit 68b6b66

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,8 +1761,7 @@ class VPWidenInductionRecipe : public VPHeaderPHIRecipe {
17611761

17621762
/// A recipe for handling phi nodes of integer and floating-point inductions,
17631763
/// producing their vector values. This won't execute any LLVM IR and will get
1764-
/// expanded later into VPWidenIntOrFpInitialRecipe, VPWidenIntOrFpPHIRecipe and
1765-
/// VPWidenIntOrFpBackedgeRecipe.
1764+
/// expanded later into several other recipes in convertToConcreteRecipes.
17661765
class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
17671766
TruncInst *Trunc;
17681767

@@ -1949,7 +1948,7 @@ class VPWidenPHIRecipe : public VPSingleDefRecipe {
19491948

19501949
public:
19511950
/// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start and
1952-
/// debug location \p DL..
1951+
/// debug location \p DL.
19531952
VPWidenPHIRecipe(Instruction *Phi, VPValue *Start = nullptr, DebugLoc DL = {},
19541953
const Twine &Name = "vec.phi")
19551954
: VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi, DL),

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

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,28 @@ define void @iv_expand(ptr %p, i64 %n) {
8888
; CHECK-NEXT: }
8989
; CHECK-NEXT: Successor(s): middle.block
9090
; CHECK: VPlan 'Final VPlan for VF={8},UF={1}'
91-
; CHECK: <x1> vector loop: {
91+
; CHECK: ir-bb<vector.ph>:
92+
; CHECK-NEXT: IR %n.mod.vf = urem i64 %n, 8
93+
; CHECK-NEXT: IR %n.vec = sub i64 %n, %n.mod.vf
94+
; CHECK-NEXT: EMIT vp<[[STEP_VECTOR:%.+]]> = step-vector ir<0>
95+
; CHECK-NEXT: EMIT vp<[[MUL:%.+]]> = mul vp<[[STEP_VECTOR]]>, ir<1>
96+
; CHECK-NEXT: EMIT vp<[[INDUCTION:%.+]]> = add ir<0>, vp<[[MUL]]>
97+
; CHECK-NEXT: EMIT vp<[[INC:%.+]]> = mul ir<1>, ir<8>
98+
; CHECK-NEXT: Successor(s): vector loop
99+
; CHECK-EMPTY:
100+
; CHECK-NEXT: <x1> vector loop: {
92101
; CHECK-NEXT: vector.body:
93-
; CHECK-NEXT: SCALAR-PHI vp<%3> = phi ir<0>, vp<%index.next>
94-
; CHECK-NEXT: WIDEN-PHI ir<%i> = phi vp<%induction>, vp<%vec.ind.next>
95-
; CHECK-NEXT: vp<%4> = SCALAR-STEPS vp<%3>, ir<1>
96-
; CHECK-NEXT: CLONE ir<%q> = getelementptr ir<%p>, vp<%4>
97-
; CHECK-NEXT: vp<%5> = vector-pointer ir<%q>
98-
; CHECK-NEXT: WIDEN ir<%x> = load vp<%5>
102+
; CHECK-NEXT: SCALAR-PHI vp<[[SCALAR_PHI:%.+]]> = phi ir<0>, vp<%index.next>
103+
; CHECK-NEXT: WIDEN-PHI ir<%i> = phi vp<[[INDUCTION]]>, vp<%vec.ind.next>
104+
; CHECK-NEXT: vp<[[SCALAR_STEPS:%.+]]> = SCALAR-STEPS vp<[[SCALAR_PHI]]>, ir<1>
105+
; CHECK-NEXT: CLONE ir<%q> = getelementptr ir<%p>, vp<[[SCALAR_STEPS]]>
106+
; CHECK-NEXT: vp<[[VEC_PTR_1:%.+]]> = vector-pointer ir<%q>
107+
; CHECK-NEXT: WIDEN ir<%x> = load vp<[[VEC_PTR_1]]>
99108
; CHECK-NEXT: WIDEN ir<%y> = add ir<%x>, ir<%i>
100-
; CHECK-NEXT: vp<%6> = vector-pointer ir<%q>
101-
; CHECK-NEXT: WIDEN store vp<%6>, ir<%y>
102-
; CHECK-NEXT: EMIT vp<%index.next> = add nuw vp<%3>, ir<8>
103-
; CHECK-NEXT: EMIT vp<%vec.ind.next> = add ir<%i>, vp<%2>
109+
; CHECK-NEXT: vp<[[VEC_PTR_2:%.+]]> = vector-pointer ir<%q>
110+
; CHECK-NEXT: WIDEN store vp<[[VEC_PTR_2]]>, ir<%y>
111+
; CHECK-NEXT: EMIT vp<%index.next> = add nuw vp<[[SCALAR_PHI]]>, ir<8>
112+
; CHECK-NEXT: EMIT vp<%vec.ind.next> = add ir<%i>, vp<[[INC]]>
104113
; CHECK-NEXT: EMIT branch-on-count vp<%index.next>, ir<%n.vec>
105114
; CHECK-NEXT: No successors
106115
; CHECK-NEXT: }

0 commit comments

Comments
 (0)