forked from OSchip/llvm-project
[VPlan] Remove VPWidenPHIRecipe constructor without start value (NFC).
This was suggested as a separate cleanup in recent reviews.
This commit is contained in:
parent
eb6b2efe4e
commit
7305798049
|
@ -4612,7 +4612,7 @@ void InnerLoopVectorizer::widenPHIInstruction(Instruction *PN,
|
|||
Type *PhiType = II.getStep()->getType();
|
||||
|
||||
// Build a pointer phi
|
||||
Value *ScalarStartValue = II.getStartValue();
|
||||
Value *ScalarStartValue = PhiR->getStartValue()->getLiveInIRValue();
|
||||
Type *ScStValueType = ScalarStartValue->getType();
|
||||
PHINode *NewPointerPhi =
|
||||
PHINode::Create(ScStValueType, 2, "pointer.phi", Induction);
|
||||
|
@ -8874,11 +8874,14 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
|
|||
Phi->getIncomingValueForBlock(OrigLoop->getLoopLatch())));
|
||||
PhisToFix.push_back(PhiRecipe);
|
||||
} else {
|
||||
// TODO: record start and backedge value for remaining pointer induction
|
||||
// phis.
|
||||
// TODO: record backedge value for remaining pointer induction phis.
|
||||
assert(Phi->getType()->isPointerTy() &&
|
||||
"only pointer phis should be handled here");
|
||||
PhiRecipe = new VPWidenPHIRecipe(Phi);
|
||||
assert(Legal->getInductionVars().count(Phi) &&
|
||||
"Not an induction variable");
|
||||
InductionDescriptor II = Legal->getInductionVars().lookup(Phi);
|
||||
VPValue *Start = Plan->getOrAddVPValue(II.getStartValue());
|
||||
PhiRecipe = new VPWidenPHIRecipe(Phi, Start);
|
||||
}
|
||||
|
||||
return toVPRecipeResult(PhiRecipe);
|
||||
|
|
|
@ -1118,13 +1118,11 @@ class VPWidenPHIRecipe : public VPHeaderPHIRecipe {
|
|||
SmallVector<VPBasicBlock *, 2> IncomingBlocks;
|
||||
|
||||
public:
|
||||
/// Create a VPWidenPHIRecipe for \p Phi
|
||||
VPWidenPHIRecipe(PHINode *Phi)
|
||||
: VPHeaderPHIRecipe(VPVWidenPHISC, VPWidenPHISC, Phi) {}
|
||||
|
||||
/// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start.
|
||||
VPWidenPHIRecipe(PHINode *Phi, VPValue &Start) : VPWidenPHIRecipe(Phi) {
|
||||
addOperand(&Start);
|
||||
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr)
|
||||
: VPHeaderPHIRecipe(VPVWidenPHISC, VPWidenPHISC, Phi) {
|
||||
if (Start)
|
||||
addOperand(Start);
|
||||
}
|
||||
|
||||
~VPWidenPHIRecipe() override = default;
|
||||
|
|
Loading…
Reference in New Issue