Skip to content

Commit 6ac7780

Browse files
committed
Inline EVLPHI lookup
1 parent c487358 commit 6ac7780

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
@@ -4114,11 +4114,6 @@ class LLVM_ABI_FOR_TEST VPRegionBlock : public VPBlockBase {
41144114
return const_cast<VPRegionBlock *>(this)->getCanonicalIV();
41154115
}
41164116

4117-
VPEVLBasedIVPHIRecipe *getEVLBasedIV() {
4118-
return dyn_cast<VPEVLBasedIVPHIRecipe>(
4119-
std::next(getCanonicalIV()->getIterator()));
4120-
}
4121-
41224117
/// Return the type of the canonical IV for loop regions.
41234118
Type *getCanonicalIVType() { return getCanonicalIV()->getScalarType(); }
41244119
const Type *getCanonicalIVType() const {

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,9 @@ createScalarIVSteps(VPlan &Plan, InductionDescriptor::InductionKind Kind,
605605
VPBuilder &Builder) {
606606
VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion();
607607
VPBasicBlock *HeaderVPBB = LoopRegion->getEntryBasicBlock();
608-
VPValue *IV = LoopRegion->getCanonicalIV();
609-
if (auto *EVLIV = LoopRegion->getEVLBasedIV())
608+
VPHeaderPHIRecipe *IV = LoopRegion->getCanonicalIV();
609+
if (auto *EVLIV =
610+
dyn_cast<VPEVLBasedIVPHIRecipe>(std::next(IV->getIterator())))
610611
IV = EVLIV;
611612
VPSingleDefRecipe *BaseIV =
612613
Builder.createDerivedIV(Kind, FPBinOp, StartV, IV, Step, "offset.idx");

0 commit comments

Comments
 (0)