Skip to content

Conversation

@fhahn
Copy link
Contributor

@fhahn fhahn commented Dec 17, 2025

This patch adds VPValue sub-classes for the different cases we currently have:

  • VPLiveIn: A live-in VPValue that wraps an underlying IR value
  • VPSymbolicValue: A symbolic VPValue not tied to an underlying value, e.g. the vector trip count or VF VPValues
  • VPDefValue: A VPValue defined by a VPDef.

This has multiple benefits:

  • clearer constructors for each kind of VPValue
  • limited scope: for example allows moving VPDef member to VPDefValue, reducing size of other VPValues.
  • stricter type checking for member variables (e.g. using VPLiveIn in the Value -> live-in map in VPlan, or using VPSymbolicValue for symbolic member VPValues)

There probably are additional opportunities for cleanups as follow-ups.

This patch adds VPValue sub-classes for the different cases we currently have: * VPLiveIn: A live-in VPValue that wraps an underlying IR value * VPSymbolicValue: A symbolic VPValue not tied to an underlying value, e.g. the vector trip count or VF VPValues * VPDefValue: A VPValue defined by a VPDef. This has multiple benefits: * clearer constructors for each kind of VPValue * limited scope: for example allows moving VPDef member to VPDefValue, reducing size of other VPValues. * stricter type checking for member variables (e.g. using VPLiveIn in the Value -> live-in map in VPlan, or using VPSymbolicValue for symbolic member VPValues) There probably are additional opportunities for cleanups as follow-ups.
@llvmbot
Copy link
Member

llvmbot commented Dec 17, 2025

@llvm/pr-subscribers-vectorizers

@llvm/pr-subscribers-llvm-transforms

Author: Florian Hahn (fhahn)

Changes

This patch adds VPValue sub-classes for the different cases we currently have:

  • VPLiveIn: A live-in VPValue that wraps an underlying IR value
  • VPSymbolicValue: A symbolic VPValue not tied to an underlying value, e.g. the vector trip count or VF VPValues
  • VPDefValue: A VPValue defined by a VPDef.

This has multiple benefits:

  • clearer constructors for each kind of VPValue
  • limited scope: for example allows moving VPDef member to VPDefValue, reducing size of other VPValues.
  • stricter type checking for member variables (e.g. using VPLiveIn in the Value -> live-in map in VPlan, or using VPSymbolicValue for symbolic member VPValues)

There probably are additional opportunities for cleanups as follow-ups.


Patch is 50.23 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/172758.diff

11 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+21-16)
  • (modified) llvm/lib/Transforms/Vectorize/VPlan.cpp (+41-28)
  • (modified) llvm/lib/Transforms/Vectorize/VPlan.h (+45-43)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp (+10-9)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h (+9-14)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp (+25-19)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp (+19-16)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp (+1-1)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanUtils.cpp (+4-4)
  • (modified) llvm/lib/Transforms/Vectorize/VPlanValue.h (+61-38)
  • (modified) llvm/unittests/Transforms/Vectorize/VPlanTest.cpp (+2-2)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index f8ee1484fb2ef..459553dc1134b 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -4073,9 +4073,11 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks( } else { auto *WidenCall = dyn_cast<VPWidenCallRecipe>(R); Function *CalledFn = - WidenCall ? WidenCall->getCalledScalarFunction() - : cast<Function>(R->getOperand(R->getNumOperands() - 1) - ->getLiveInIRValue()); + WidenCall + ? WidenCall->getCalledScalarFunction() + : cast<Function>( + cast<VPLiveIn>(R->getOperand(R->getNumOperands() - 1)) + ->getValue()); Name = CalledFn->getName(); } OS << " call to " << Name; @@ -4276,7 +4278,8 @@ VectorizationFactor LoopVectorizationPlanner::selectVectorizationFactor() { } case VPInstruction::ActiveLaneMask: { unsigned Multiplier = - cast<ConstantInt>(VPI->getOperand(2)->getLiveInIRValue()) + cast<ConstantInt>( + cast<VPLiveIn>(VPI->getOperand(2))->getValue()) ->getZExtValue(); C += VPI->cost(VF * Multiplier, CostCtx); break; @@ -7281,7 +7284,7 @@ static Value *getStartValueFromReductionResult(VPInstruction *RdxResult) { "RdxResult must be ComputeFindIVResult"); VPValue *StartVPV = RdxResult->getOperand(1); match(StartVPV, m_Freeze(m_VPValue(StartVPV))); - return StartVPV->getLiveInIRValue(); + return cast<VPLiveIn>(StartVPV)->getValue(); } // If \p EpiResumePhiR is resume VPPhi for a reduction when vectorizing the @@ -7315,7 +7318,7 @@ static void fixReductionScalarResumeWhenVectorizingEpilog( MainResumeValue = EpiRedHeaderPhi->getStartValue()->getUnderlyingValue(); if (RecurrenceDescriptor::isAnyOfRecurrenceKind(Kind)) { [[maybe_unused]] Value *StartV = - EpiRedResult->getOperand(1)->getLiveInIRValue(); + cast<VPLiveIn>(EpiRedResult->getOperand(1))->getValue(); auto *Cmp = cast<ICmpInst>(MainResumeValue); assert(Cmp->getPredicate() == CmpInst::ICMP_NE && "AnyOf expected to start with ICMP_NE"); @@ -7325,7 +7328,7 @@ static void fixReductionScalarResumeWhenVectorizingEpilog( MainResumeValue = Cmp->getOperand(0); } else if (RecurrenceDescriptor::isFindIVRecurrenceKind(Kind)) { Value *StartV = getStartValueFromReductionResult(EpiRedResult); - Value *SentinelV = EpiRedResult->getOperand(2)->getLiveInIRValue(); + Value *SentinelV = cast<VPLiveIn>(EpiRedResult->getOperand(2))->getValue(); using namespace llvm::PatternMatch; Value *Cmp, *OrigResumeV, *CmpOp; [[maybe_unused]] bool IsExpectedPattern = @@ -7419,9 +7422,10 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan( // making any changes to the CFG. DenseMap<const SCEV *, Value *> ExpandedSCEVs = VPlanTransforms::expandSCEVs(BestVPlan, *PSE.getSE()); - if (!ILV.getTripCount()) - ILV.setTripCount(BestVPlan.getTripCount()->getLiveInIRValue()); - else + if (!ILV.getTripCount()) { + // After expandSCEVs, TripCount is always a VPLiveIn. + ILV.setTripCount(cast<VPLiveIn>(BestVPlan.getTripCount())->getValue()); + } else assert(VectorizingEpilogue && "should only re-use the existing trip " "count during epilogue vectorization"); @@ -9057,8 +9061,8 @@ void VPDerivedIVRecipe::execute(VPTransformState &State) { Value *Step = State.get(getStepValue(), VPLane(0)); Value *Index = State.get(getOperand(1), VPLane(0)); Value *DerivedIV = emitTransformedIndex( - State.Builder, Index, getStartValue()->getLiveInIRValue(), Step, Kind, - cast_if_present<BinaryOperator>(FPBinOp)); + State.Builder, Index, cast<VPLiveIn>(getStartValue())->getValue(), Step, + Kind, cast_if_present<BinaryOperator>(FPBinOp)); DerivedIV->setName(Name); State.set(this, DerivedIV, VPLane(0)); } @@ -9406,7 +9410,8 @@ static void preparePlanForMainVectorLoop(VPlan &MainPlan, VPlan &EpiPlan) { if (!VPI || VPI->getOpcode() != VPInstruction::ComputeFindIVResult) continue; VPValue *OrigStart = VPI->getOperand(1); - if (isGuaranteedNotToBeUndefOrPoison(OrigStart->getLiveInIRValue())) + if (isGuaranteedNotToBeUndefOrPoison( + cast<VPLiveIn>(OrigStart)->getValue())) continue; VPInstruction *Freeze = Builder.createNaryOp(Instruction::Freeze, {OrigStart}, {}, "fr"); @@ -9529,7 +9534,7 @@ static SmallVector<Instruction *> preparePlanForEpilogueVectorLoop( ->getIncomingValueForBlock(L->getLoopPreheader()); RecurKind RK = ReductionPhi->getRecurrenceKind(); if (RecurrenceDescriptor::isAnyOfRecurrenceKind(RK)) { - Value *StartV = RdxResult->getOperand(1)->getLiveInIRValue(); + Value *StartV = cast<VPLiveIn>(RdxResult->getOperand(1))->getValue(); // VPReductionPHIRecipes for AnyOf reductions expect a boolean as // start value; compare the final value from the main vector loop // to the start value. @@ -9554,7 +9559,7 @@ static SmallVector<Instruction *> preparePlanForEpilogueVectorLoop( Value *Cmp = Builder.CreateICmpEQ(ResumeV, ToFrozen[StartV]); if (auto *I = dyn_cast<Instruction>(Cmp)) InstsToMove.push_back(I); - Value *Sentinel = RdxResult->getOperand(2)->getLiveInIRValue(); + Value *Sentinel = cast<VPLiveIn>(RdxResult->getOperand(2))->getValue(); ResumeV = Builder.CreateSelect(Cmp, Sentinel, ResumeV); if (auto *I = dyn_cast<Instruction>(ResumeV)) InstsToMove.push_back(I); @@ -9592,7 +9597,7 @@ static SmallVector<Instruction *> preparePlanForEpilogueVectorLoop( auto *VPI = dyn_cast<VPInstruction>(&R); if (VPI && VPI->getOpcode() == Instruction::Freeze) { VPI->replaceAllUsesWith(Plan.getOrAddLiveIn( - ToFrozen.lookup(VPI->getOperand(0)->getLiveInIRValue()))); + ToFrozen.lookup(cast<VPLiveIn>(VPI->getOperand(0))->getValue()))); continue; } diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp index 59550d9237e8f..7d6c694d10db9 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp @@ -78,6 +78,8 @@ raw_ostream &llvm::operator<<(raw_ostream &OS, const VPRecipeBase &R) { } #endif +Type *VPLiveIn::getType() const { return getUnderlyingValue()->getType(); } + Value *VPLane::getAsRuntimeExpr(IRBuilderBase &Builder, const ElementCount &VF) const { switch (LaneKind) { @@ -92,15 +94,10 @@ Value *VPLane::getAsRuntimeExpr(IRBuilderBase &Builder, } VPValue::VPValue(const unsigned char SC, Value *UV, VPDef *Def) - : SubclassID(SC), UnderlyingVal(UV), Def(Def) { - if (Def) - Def->addDefinedValue(this); -} + : SubclassID(SC), UnderlyingVal(UV) {} VPValue::~VPValue() { assert(Users.empty() && "trying to delete a VPValue with remaining users"); - if (VPDef *Def = getDefiningRecipe()) - Def->removeDefinedValue(this); } #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) @@ -129,11 +126,29 @@ void VPDef::dump() const { #endif VPRecipeBase *VPValue::getDefiningRecipe() { - return cast_or_null<VPRecipeBase>(Def); + auto *Def = dyn_cast<VPDefValue>(this); + if (!Def) + return nullptr; + return cast<VPRecipeBase>(Def->Def); } const VPRecipeBase *VPValue::getDefiningRecipe() const { - return cast_or_null<VPRecipeBase>(Def); + auto *Def = dyn_cast<VPDefValue>(this); + if (!Def) + return nullptr; + return cast<VPRecipeBase>(Def->Def); +} + +VPDefValue::VPDefValue(VPDef *Def, Value *UV) + : VPValue(VPVDefValueSC, UV, nullptr), Def(Def) { + assert(Def && "VPDefValue requires a defining recipe"); + Def->addDefinedValue(this); +} + +VPDefValue::~VPDefValue() { + assert(Users.empty() && "trying to delete a VPValue with remaining users"); + if (Def) + Def->removeDefinedValue(this); } // Get the top-most entry block of \p Start. This is the entry block of the @@ -229,8 +244,8 @@ VPTransformState::VPTransformState(const TargetTransformInfo *TTI, CurrentParentLoop(CurrentParentLoop), TypeAnalysis(*Plan), VPDT(*Plan) {} Value *VPTransformState::get(const VPValue *Def, const VPLane &Lane) { - if (Def->isLiveIn()) - return Def->getLiveInIRValue(); + if (isa<VPLiveIn, VPSymbolicValue>(Def)) + return Def->getUnderlyingValue(); if (hasScalarValue(Def, Lane)) return Data.VPV2Scalars[Def][Lane.mapToCacheIndex(VF)]; @@ -262,8 +277,8 @@ Value *VPTransformState::get(const VPValue *Def, const VPLane &Lane) { Value *VPTransformState::get(const VPValue *Def, bool NeedsScalar) { if (NeedsScalar) { - assert((VF.isScalar() || Def->isLiveIn() || hasVectorValue(Def) || - !vputils::onlyFirstLaneUsed(Def) || + assert((VF.isScalar() || isa<VPLiveIn, VPSymbolicValue>(Def) || + hasVectorValue(Def) || !vputils::onlyFirstLaneUsed(Def) || (hasScalarValue(Def, VPLane(0)) && Data.VPV2Scalars[Def].size() == 1)) && "Trying to access a single scalar per part but has multiple scalars " @@ -284,8 +299,8 @@ Value *VPTransformState::get(const VPValue *Def, bool NeedsScalar) { }; if (!hasScalarValue(Def, {0})) { - assert(Def->isLiveIn() && "expected a live-in"); - Value *IRV = Def->getLiveInIRValue(); + assert((isa<VPLiveIn, VPSymbolicValue>(Def)) && "expected a live-in"); + Value *IRV = Def->getUnderlyingValue(); Value *B = GetBroadcastInstrs(IRV); set(Def, B); return B; @@ -865,7 +880,7 @@ VPlan::VPlan(Loop *L) { } VPlan::~VPlan() { - VPValue DummyValue; + VPSymbolicValue DummyValue; for (auto *VPB : CreatedBlocks) { if (auto *VPBB = dyn_cast<VPBasicBlock>(VPB)) { @@ -1052,7 +1067,7 @@ void VPlan::printLiveIns(raw_ostream &O) const { O << "\n"; if (TripCount) { - if (TripCount->isLiveIn()) + if (isa<VPLiveIn>(TripCount)) O << "Live-in "; TripCount->printAsOperand(O, SlotTracker); O << " = original trip-count"; @@ -1168,20 +1183,18 @@ VPlan *VPlan::duplicate() { // Create VPlan, clone live-ins and remap operands in the cloned blocks. auto *NewPlan = new VPlan(cast<VPBasicBlock>(NewEntry), NewScalarHeader); DenseMap<VPValue *, VPValue *> Old2NewVPValues; - for (VPValue *OldLiveIn : getLiveIns()) { - Old2NewVPValues[OldLiveIn] = - NewPlan->getOrAddLiveIn(OldLiveIn->getLiveInIRValue()); + for (VPLiveIn *OldLiveIn : getLiveIns()) { + Old2NewVPValues[OldLiveIn] = NewPlan->getOrAddLiveIn(OldLiveIn->getValue()); } Old2NewVPValues[&VectorTripCount] = &NewPlan->VectorTripCount; Old2NewVPValues[&VF] = &NewPlan->VF; Old2NewVPValues[&VFxUF] = &NewPlan->VFxUF; if (BackedgeTakenCount) { - NewPlan->BackedgeTakenCount = new VPValue(); + NewPlan->BackedgeTakenCount = new VPSymbolicValue(); Old2NewVPValues[BackedgeTakenCount] = NewPlan->BackedgeTakenCount; } - if (TripCount && TripCount->isLiveIn()) - Old2NewVPValues[TripCount] = - NewPlan->getOrAddLiveIn(TripCount->getLiveInIRValue()); + if (auto *LI = dyn_cast_or_null<VPLiveIn>(TripCount)) + Old2NewVPValues[LI] = NewPlan->getOrAddLiveIn(LI->getValue()); // else NewTripCount will be created and inserted into Old2NewVPValues when // TripCount is cloned. In any case NewPlan->TripCount is updated below. @@ -1449,7 +1462,7 @@ void VPSlotTracker::assignName(const VPValue *V) { const auto &[A, _] = VPValue2Name.try_emplace(V, BaseName); // Integer or FP constants with different types will result in he same string // due to stripping types. - if (V->isLiveIn() && isa<ConstantInt, ConstantFP>(UV)) + if (isa<VPLiveIn>(V) && isa<ConstantInt, ConstantFP>(UV)) return; // If it is already used by C > 0 other VPValues, increase the version counter @@ -1726,10 +1739,10 @@ bool llvm::canConstantBeExtended(const APInt *C, Type *NarrowType, TargetTransformInfo::OperandValueInfo VPCostContext::getOperandInfo(VPValue *V) const { - if (!V->isLiveIn()) - return {}; + if (auto *LI = dyn_cast<VPLiveIn>(V)) + return TTI::getOperandInfo(LI->getValue()); - return TTI::getOperandInfo(V->getLiveInIRValue()); + return {}; } InstructionCost VPCostContext::getScalarizationOverhead( @@ -1757,7 +1770,7 @@ InstructionCost VPCostContext::getScalarizationOverhead( SmallPtrSet<const VPValue *, 4> UniqueOperands; SmallVector<Type *> Tys; for (auto *Op : Operands) { - if (Op->isLiveIn() || + if (isa<VPLiveIn>(Op) || (!AlwaysIncludeReplicatingR && isa<VPReplicateRecipe, VPPredInstPHIRecipe>(Op)) || (isa<VPReplicateRecipe>(Op) && diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index d043ec41ec1ca..6379c4ab21e31 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -528,15 +528,15 @@ class LLVM_ABI_FOR_TEST VPRecipeBase /// VPSingleDef is a base class for recipes for modeling a sequence of one or /// more output IR that define a single result VPValue. /// Note that VPRecipeBase must be inherited from before VPValue. -class VPSingleDefRecipe : public VPRecipeBase, public VPValue { +class VPSingleDefRecipe : public VPRecipeBase, public VPDefValue { public: VPSingleDefRecipe(const unsigned char SC, ArrayRef<VPValue *> Operands, DebugLoc DL = DebugLoc::getUnknown()) - : VPRecipeBase(SC, Operands, DL), VPValue(this) {} + : VPRecipeBase(SC, Operands, DL), VPDefValue(this) {} VPSingleDefRecipe(const unsigned char SC, ArrayRef<VPValue *> Operands, Value *UV, DebugLoc DL = DebugLoc::getUnknown()) - : VPRecipeBase(SC, Operands, DL), VPValue(this, UV) {} + : VPRecipeBase(SC, Operands, DL), VPDefValue(this, UV) {} static inline bool classof(const VPRecipeBase *R) { switch (R->getVPDefID()) { @@ -1715,9 +1715,9 @@ class LLVM_ABI_FOR_TEST VPWidenCallRecipe : public VPRecipeWithIRFlags, : VPRecipeWithIRFlags(VPDef::VPWidenCallSC, CallArguments, Flags, DL), VPIRMetadata(Metadata), Variant(Variant) { setUnderlyingValue(UV); - assert( - isa<Function>(getOperand(getNumOperands() - 1)->getLiveInIRValue()) && - "last operand must be the called function"); + assert(isa<Function>( + cast<VPLiveIn>(getOperand(getNumOperands() - 1))->getValue()) && + "last operand must be the called function"); } ~VPWidenCallRecipe() override = default; @@ -1737,7 +1737,8 @@ class LLVM_ABI_FOR_TEST VPWidenCallRecipe : public VPRecipeWithIRFlags, VPCostContext &Ctx) const override; Function *getCalledScalarFunction() const { - return cast<Function>(getOperand(getNumOperands() - 1)->getLiveInIRValue()); + return cast<Function>( + cast<VPLiveIn>(getOperand(getNumOperands() - 1))->getValue()); } operand_range args() { return drop_end(operands()); } @@ -2264,7 +2265,7 @@ class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe, /// Returns the scalar type of the induction. Type *getScalarType() const { return Trunc ? Trunc->getType() - : getStartValue()->getLiveInIRValue()->getType(); + : cast<VPLiveIn>(getStartValue())->getValue()->getType(); } /// Returns the VPValue representing the value of this induction at @@ -2628,7 +2629,7 @@ class LLVM_ABI_FOR_TEST VPInterleaveBase : public VPRecipeBase, if (Instruction *Inst = IG->getMember(I)) { if (Inst->getType()->isVoidTy()) continue; - new VPValue(Inst, this); + new VPDefValue(this, Inst); } for (auto *SV : StoredValues) @@ -3132,7 +3133,8 @@ class VPExpressionRecipe : public VPSingleDefRecipe { assert(Red->getRecurrenceKind() == RecurKind::Add && "Expected an add reduction"); assert(getNumOperands() >= 3 && "Expected at least three operands"); - [[maybe_unused]] auto *SubConst = dyn_cast<ConstantInt>(getOperand(2)->getLiveInIRValue()); + [[maybe_unused]] auto *SubConst = + dyn_cast<ConstantInt>(cast<VPLiveIn>(getOperand(2))->getValue()); assert(SubConst && SubConst->getValue() == 0 && Sub->getOpcode() == Instruction::Sub && "Expected a negating sub"); } @@ -3350,13 +3352,13 @@ class LLVM_ABI_FOR_TEST VPWidenMemoryRecipe : public VPRecipeBase, /// A recipe for widening load operations, using the address to load from and an /// optional mask. struct LLVM_ABI_FOR_TEST VPWidenLoadRecipe final : public VPWidenMemoryRecipe, - public VPValue { + public VPDefValue { VPWidenLoadRecipe(LoadInst &Load, VPValue *Addr, VPValue *Mask, bool Consecutive, bool Reverse, const VPIRMetadata &Metadata, DebugLoc DL) : VPWidenMemoryRecipe(VPDef::VPWidenLoadSC, Load, {Addr}, Consecutive, Reverse, Metadata, DL), - VPValue(this, &Load) { + VPDefValue(this, &Load) { setMask(Mask); } @@ -3391,13 +3393,14 @@ struct LLVM_ABI_FOR_TEST VPWidenLoadRecipe final : public VPWidenMemoryRecipe, /// A recipe for widening load operations with vector-predication intrinsics, /// using the address to load from, the explicit vector length and an optional /// mask. -struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue { +struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, + public VPDefValue { VPWidenLoadEVLRecipe(VPWidenLoadRecipe &L, VPValue *Addr, VPValue &EVL, VPValue *Mask) : VPWidenMemoryRecipe(VPDef::VPWidenLoadEVLSC, L.getIngredient(), {Addr, &EVL}, L.isConsecutive(), L.isReverse(), L, L.getDebugLoc()), - VPValue(this, &getIngredient()) { + VPDefValue(this, &getIngredient()) { setMask(Mask); } @@ -3582,7 +3585,7 @@ class VPCanonicalIVPHIRecipe : public VPHeaderPHIRecipe { /// Returns the scalar type of the induction. Type *getScalarType() const { - return getStartValue()->getLiveInIRValue()->getType(); + return cast<VPLiveIn>(getStartValue())->getValue()->getType(); } /// Returns true if the recipe only uses the first lane of operand \p Op. @@ -3773,7 +3776,7 @@ class VPDerivedIVRecipe : public VPSingleDefRecipe { } Type *getScalarType() const { - return getStartValue()->getLiveInIRValue()->getType(); + return cast<VPLiveIn>(getStartValue())->getValue()->getType(); } VPValue *getStartValue() const { return getOperand(0); } @@ -4330,20 +4333,20 @@ class VPlan { /// Represents the backedge taken count of the original loop, for folding /// the tail. It equals TripCount - 1. - VPValue *BackedgeTakenCount = nullptr; + VPSymbolicValue *BackedgeTakenCount = nullptr; /// Represents the vector trip count. - VPValue VectorTripCount; + VPSymbolicValue VectorTripCount; /// Represents the vectorization factor of the loop. - VPValue VF; + VPSymbolicValue VF; /// Represents the loop-invariant VF * UF of the vector loop region. - VPValue VFxUF; + VPSymbolicValue VFxUF; /// Contains all the external definitions created for this VPlan, as a mapping - /// from IR Values to VPValues. - SmallMapVector<Value *, VPValue *, 16> LiveIns; + /// from IR Values to VPLiveIns. + SmallMapVector<Value *, VPLiveIn *, 16> LiveIns; /// Blocks allocated and owned by the VPlan. They will be deleted once the /// VPlan is destroyed. @@ -4469,7 +4472,7 @@ class VPlan { /// The backedge taken count of the original loop. VPValue *getOrCreateBackedgeTakenCount() { if (!BackedgeTakenCount) - BackedgeTakenCount = new VPValue(); + BackedgeTakenCount = new VPSymbolicValue(); return BackedgeTakenCount; } VPValue *getBackedgeTakenCount() const { return BackedgeTakenCount; } @@ -4538,43 +4541,42 @@ class VPlan { /// Gets the live... [truncated] 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment