Skip to content

Commit f4e52c5

Browse files
committed
Inline EVLPHI lookup
1 parent 9f1c2e3 commit f4e52c5

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4118,11 +4118,6 @@ class LLVM_ABI_FOR_TEST VPRegionBlock : public VPBlockBase {
41184118
return const_cast<VPRegionBlock *>(this)->getCanonicalIV();
41194119
}
41204120

4121-
VPEVLBasedIVPHIRecipe *getEVLBasedIV() {
4122-
return dyn_cast<VPEVLBasedIVPHIRecipe>(
4123-
std::next(getCanonicalIV()->getIterator()));
4124-
}
4125-
41264121
/// Return the type of the canonical IV for loop regions.
41274122
Type *getCanonicalIVType() { return getCanonicalIV()->getScalarType(); }
41284123
const Type *getCanonicalIVType() const {

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,9 @@ createScalarIVSteps(VPlan &Plan, InductionDescriptor::InductionKind Kind,
610610
VPBuilder &Builder) {
611611
VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion();
612612
VPBasicBlock *HeaderVPBB = LoopRegion->getEntryBasicBlock();
613-
VPValue *IV = LoopRegion->getCanonicalIV();
614-
if (auto *EVLIV = LoopRegion->getEVLBasedIV())
613+
VPHeaderPHIRecipe *IV = LoopRegion->getCanonicalIV();
614+
if (auto *EVLIV =
615+
dyn_cast<VPEVLBasedIVPHIRecipe>(std::next(IV->getIterator())))
615616
IV = EVLIV;
616617
VPSingleDefRecipe *BaseIV =
617618
Builder.createDerivedIV(Kind, FPBinOp, StartV, IV, Step, "offset.idx");

0 commit comments

Comments
 (0)