@@ -3101,17 +3101,6 @@ InstructionCost VPInterleaveRecipe::computeCost(ElementCount VF,
3101
3101
VectorTy, std::nullopt, CostKind, 0 );
3102
3102
}
3103
3103
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
-
3115
3104
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
3116
3105
void VPCanonicalIVPHIRecipe::print (raw_ostream &O, const Twine &Indent,
3117
3106
VPSlotTracker &SlotTracker) const {
@@ -3153,8 +3142,6 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
3153
3142
assert (!onlyScalarsGenerated (State.VF .isScalable ()) &&
3154
3143
" Recipe should have been replaced" );
3155
3144
3156
- auto *IVR = getParent ()->getPlan ()->getCanonicalIV ();
3157
- PHINode *CanonicalIV = cast<PHINode>(State.get (IVR, /* IsScalar*/ true ));
3158
3145
unsigned CurrentPart = getUnrollPart (*this );
3159
3146
3160
3147
// Build a pointer phi
@@ -3164,6 +3151,12 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
3164
3151
BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3165
3152
PHINode *NewPointerPhi = nullptr ;
3166
3153
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 ));
3167
3160
NewPointerPhi = PHINode::Create (ScStValueType, 2 , " pointer.phi" ,
3168
3161
CanonicalIV->getIterator ());
3169
3162
NewPointerPhi->addIncoming (ScalarStartValue, VectorPH);
@@ -3477,20 +3470,30 @@ void VPActiveLaneMaskPHIRecipe::print(raw_ostream &O, const Twine &Indent,
3477
3470
}
3478
3471
#endif
3479
3472
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) {
3481
3485
BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3482
3486
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 );
3484
3488
Phi->addIncoming (Start, VectorPH);
3485
3489
Phi->setDebugLoc (getDebugLoc ());
3486
3490
State.set (this , Phi, /* IsScalar=*/ true );
3487
3491
}
3488
3492
3489
3493
#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" ;
3494
3497
printAsOperand (O, SlotTracker);
3495
3498
O << " = phi " ;
3496
3499
printOperands (O, SlotTracker);
0 commit comments