@@ -3101,17 +3101,6 @@ InstructionCost VPInterleaveRecipe::computeCost(ElementCount VF,
31013101 VectorTy, std::nullopt , CostKind, 0 );
31023102}
31033103
3104- void VPCanonicalIVPHIRecipe::execute (VPTransformState &State) {
3105- Value *Start = getStartValue ()->getLiveInIRValue ();
3106- PHINode *Phi = PHINode::Create (Start->getType (), 2 , " index" );
3107- Phi->insertBefore (State.CFG .PrevBB ->getFirstInsertionPt ());
3108-
3109- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3110- Phi->addIncoming (Start, VectorPH);
3111- Phi->setDebugLoc (getDebugLoc ());
3112- State.set (this , Phi, /* IsScalar*/ true );
3113- }
3114-
31153104#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
31163105void VPCanonicalIVPHIRecipe::print (raw_ostream &O, const Twine &Indent,
31173106 VPSlotTracker &SlotTracker) const {
@@ -3153,8 +3142,6 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
31533142 assert (!onlyScalarsGenerated (State.VF .isScalable ()) &&
31543143 " Recipe should have been replaced" );
31553144
3156- auto *IVR = getParent ()->getPlan ()->getCanonicalIV ();
3157- PHINode *CanonicalIV = cast<PHINode>(State.get (IVR, /* IsScalar*/ true ));
31583145 unsigned CurrentPart = getUnrollPart (*this );
31593146
31603147 // Build a pointer phi
@@ -3164,6 +3151,12 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
31643151 BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
31653152 PHINode *NewPointerPhi = nullptr ;
31663153 if (CurrentPart == 0 ) {
3154+ auto *IVR = cast<VPHeaderPHIRecipe>(&getParent ()
3155+ ->getPlan ()
3156+ ->getVectorLoopRegion ()
3157+ ->getEntryBasicBlock ()
3158+ ->front ());
3159+ PHINode *CanonicalIV = cast<PHINode>(State.get (IVR, /* IsScalar*/ true ));
31673160 NewPointerPhi = PHINode::Create (ScStValueType, 2 , " pointer.phi" ,
31683161 CanonicalIV->getIterator ());
31693162 NewPointerPhi->addIncoming (ScalarStartValue, VectorPH);
@@ -3477,20 +3470,30 @@ void VPActiveLaneMaskPHIRecipe::print(raw_ostream &O, const Twine &Indent,
34773470}
34783471#endif
34793472
3480- void VPEVLBasedIVPHIRecipe::execute (VPTransformState &State) {
3473+ #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
3474+ void VPEVLBasedIVPHIRecipe::print (raw_ostream &O, const Twine &Indent,
3475+ VPSlotTracker &SlotTracker) const {
3476+ O << Indent << " EXPLICIT-VECTOR-LENGTH-BASED-IV-PHI " ;
3477+
3478+ printAsOperand (O, SlotTracker);
3479+ O << " = phi " ;
3480+ printOperands (O, SlotTracker);
3481+ }
3482+ #endif
3483+
3484+ void VPScalarPHIRecipe::execute (VPTransformState &State) {
34813485 BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
34823486 Value *Start = State.get (getOperand (0 ), VPLane (0 ));
3483- PHINode *Phi = State.Builder .CreatePHI (Start->getType (), 2 , " evl.based.iv " );
3487+ PHINode *Phi = State.Builder .CreatePHI (Start->getType (), 2 , Name );
34843488 Phi->addIncoming (Start, VectorPH);
34853489 Phi->setDebugLoc (getDebugLoc ());
34863490 State.set (this , Phi, /* IsScalar=*/ true );
34873491}
34883492
34893493#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
3490- void VPEVLBasedIVPHIRecipe::print (raw_ostream &O, const Twine &Indent,
3491- VPSlotTracker &SlotTracker) const {
3492- O << Indent << " EXPLICIT-VECTOR-LENGTH-BASED-IV-PHI " ;
3493-
3494+ void VPScalarPHIRecipe::print (raw_ostream &O, const Twine &Indent,
3495+ VPSlotTracker &SlotTracker) const {
3496+ O << Indent << " SCALAR-PHI" ;
34943497 printAsOperand (O, SlotTracker);
34953498 O << " = phi " ;
34963499 printOperands (O, SlotTracker);
0 commit comments