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();
|
Type *PhiType = II.getStep()->getType();
|
||||||
|
|
||||||
// Build a pointer phi
|
// Build a pointer phi
|
||||||
Value *ScalarStartValue = II.getStartValue();
|
Value *ScalarStartValue = PhiR->getStartValue()->getLiveInIRValue();
|
||||||
Type *ScStValueType = ScalarStartValue->getType();
|
Type *ScStValueType = ScalarStartValue->getType();
|
||||||
PHINode *NewPointerPhi =
|
PHINode *NewPointerPhi =
|
||||||
PHINode::Create(ScStValueType, 2, "pointer.phi", Induction);
|
PHINode::Create(ScStValueType, 2, "pointer.phi", Induction);
|
||||||
|
@ -8874,11 +8874,14 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
|
||||||
Phi->getIncomingValueForBlock(OrigLoop->getLoopLatch())));
|
Phi->getIncomingValueForBlock(OrigLoop->getLoopLatch())));
|
||||||
PhisToFix.push_back(PhiRecipe);
|
PhisToFix.push_back(PhiRecipe);
|
||||||
} else {
|
} else {
|
||||||
// TODO: record start and backedge value for remaining pointer induction
|
// TODO: record backedge value for remaining pointer induction phis.
|
||||||
// phis.
|
|
||||||
assert(Phi->getType()->isPointerTy() &&
|
assert(Phi->getType()->isPointerTy() &&
|
||||||
"only pointer phis should be handled here");
|
"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);
|
return toVPRecipeResult(PhiRecipe);
|
||||||
|
|
|
@ -1118,13 +1118,11 @@ class VPWidenPHIRecipe : public VPHeaderPHIRecipe {
|
||||||
SmallVector<VPBasicBlock *, 2> IncomingBlocks;
|
SmallVector<VPBasicBlock *, 2> IncomingBlocks;
|
||||||
|
|
||||||
public:
|
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.
|
/// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start.
|
||||||
VPWidenPHIRecipe(PHINode *Phi, VPValue &Start) : VPWidenPHIRecipe(Phi) {
|
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr)
|
||||||
addOperand(&Start);
|
: VPHeaderPHIRecipe(VPVWidenPHISC, VPWidenPHISC, Phi) {
|
||||||
|
if (Start)
|
||||||
|
addOperand(Start);
|
||||||
}
|
}
|
||||||
|
|
||||||
~VPWidenPHIRecipe() override = default;
|
~VPWidenPHIRecipe() override = default;
|
||||||
|
|
Loading…
Reference in New Issue