@@ -3122,17 +3122,6 @@ InstructionCost VPInterleaveRecipe::computeCost(ElementCount VF,
3122
3122
VectorTy, std::nullopt , CostKind, 0 );
3123
3123
}
3124
3124
3125
- void VPCanonicalIVPHIRecipe::execute (VPTransformState &State) {
3126
- Value *Start = getStartValue ()->getLiveInIRValue ();
3127
- PHINode *Phi = PHINode::Create (Start->getType (), 2 , " index" );
3128
- Phi->insertBefore (State.CFG .PrevBB ->getFirstInsertionPt ());
3129
-
3130
- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3131
- Phi->addIncoming (Start, VectorPH);
3132
- Phi->setDebugLoc (getDebugLoc ());
3133
- State.set (this , Phi, /* IsScalar*/ true );
3134
- }
3135
-
3136
3125
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
3137
3126
void VPCanonicalIVPHIRecipe::print (raw_ostream &O, const Twine &Indent,
3138
3127
VPSlotTracker &SlotTracker) const {
@@ -3174,8 +3163,6 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
3174
3163
assert (!onlyScalarsGenerated (State.VF .isScalable ()) &&
3175
3164
" Recipe should have been replaced" );
3176
3165
3177
- auto *IVR = getParent ()->getPlan ()->getCanonicalIV ();
3178
- PHINode *CanonicalIV = cast<PHINode>(State.get (IVR, /* IsScalar*/ true ));
3179
3166
unsigned CurrentPart = getUnrollPart (*this );
3180
3167
3181
3168
// Build a pointer phi
@@ -3185,6 +3172,12 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
3185
3172
BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3186
3173
PHINode *NewPointerPhi = nullptr ;
3187
3174
if (CurrentPart == 0 ) {
3175
+ auto *IVR = cast<VPHeaderPHIRecipe>(&getParent ()
3176
+ ->getPlan ()
3177
+ ->getVectorLoopRegion ()
3178
+ ->getEntryBasicBlock ()
3179
+ ->front ());
3180
+ PHINode *CanonicalIV = cast<PHINode>(State.get (IVR, /* IsScalar*/ true ));
3188
3181
NewPointerPhi = PHINode::Create (ScStValueType, 2 , " pointer.phi" ,
3189
3182
CanonicalIV->getIterator ());
3190
3183
NewPointerPhi->addIncoming (ScalarStartValue, VectorPH);
@@ -3495,20 +3488,30 @@ void VPActiveLaneMaskPHIRecipe::print(raw_ostream &O, const Twine &Indent,
3495
3488
}
3496
3489
#endif
3497
3490
3498
- void VPEVLBasedIVPHIRecipe::execute (VPTransformState &State) {
3491
+ #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
3492
+ void VPEVLBasedIVPHIRecipe::print (raw_ostream &O, const Twine &Indent,
3493
+ VPSlotTracker &SlotTracker) const {
3494
+ O << Indent << " EXPLICIT-VECTOR-LENGTH-BASED-IV-PHI " ;
3495
+
3496
+ printAsOperand (O, SlotTracker);
3497
+ O << " = phi " ;
3498
+ printOperands (O, SlotTracker);
3499
+ }
3500
+ #endif
3501
+
3502
+ void VPScalarPHIRecipe::execute (VPTransformState &State) {
3499
3503
BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3500
3504
Value *Start = State.get (getOperand (0 ), VPLane (0 ));
3501
- PHINode *Phi = State.Builder .CreatePHI (Start->getType (), 2 , " evl.based.iv " );
3505
+ PHINode *Phi = State.Builder .CreatePHI (Start->getType (), 2 , Name );
3502
3506
Phi->addIncoming (Start, VectorPH);
3503
3507
Phi->setDebugLoc (getDebugLoc ());
3504
3508
State.set (this , Phi, /* IsScalar=*/ true );
3505
3509
}
3506
3510
3507
3511
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
3508
- void VPEVLBasedIVPHIRecipe::print (raw_ostream &O, const Twine &Indent,
3509
- VPSlotTracker &SlotTracker) const {
3510
- O << Indent << " EXPLICIT-VECTOR-LENGTH-BASED-IV-PHI " ;
3511
-
3512
+ void VPScalarPHIRecipe::print (raw_ostream &O, const Twine &Indent,
3513
+ VPSlotTracker &SlotTracker) const {
3514
+ O << Indent << " SCALAR-PHI" ;
3512
3515
printAsOperand (O, SlotTracker);
3513
3516
O << " = phi " ;
3514
3517
printOperands (O, SlotTracker);
0 commit comments