@@ -9222,87 +9222,6 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9222
9222
VPlanTransforms::clearReductionWrapFlags (*Plan);
9223
9223
}
9224
9224
9225
- void VPWidenPointerInductionRecipe::execute (VPTransformState &State) {
9226
- assert (IndDesc.getKind () == InductionDescriptor::IK_PtrInduction &&
9227
- " Not a pointer induction according to InductionDescriptor!" );
9228
- assert (cast<PHINode>(getUnderlyingInstr ())->getType ()->isPointerTy () &&
9229
- " Unexpected type." );
9230
- assert (!onlyScalarsGenerated (State.VF .isScalable ()) &&
9231
- " Recipe should have been replaced" );
9232
-
9233
- auto *IVR = getParent ()->getPlan ()->getCanonicalIV ();
9234
- PHINode *CanonicalIV = cast<PHINode>(State.get (IVR, 0 , /* IsScalar*/ true ));
9235
- unsigned CurrentPart = 0 ;
9236
- if (getNumOperands () == 5 )
9237
- CurrentPart =
9238
- cast<ConstantInt>(getOperand (4 )->getLiveInIRValue ())->getZExtValue ();
9239
- Type *PhiType = IndDesc.getStep ()->getType ();
9240
-
9241
- // Build a pointer phi
9242
- Value *ScalarStartValue = getStartValue ()->getLiveInIRValue ();
9243
- Type *ScStValueType = ScalarStartValue->getType ();
9244
- PHINode *NewPointerPhi = nullptr ;
9245
-
9246
- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
9247
- if (getNumOperands () == 5 ) {
9248
- auto *GEP = cast<GetElementPtrInst>(State.get (getOperand (3 ), 0 ));
9249
- NewPointerPhi = cast<PHINode>(GEP->getPointerOperand ());
9250
- } else {
9251
- NewPointerPhi =
9252
- PHINode::Create (ScStValueType, 2 , " pointer.phi" , CanonicalIV);
9253
- NewPointerPhi->addIncoming (ScalarStartValue, VectorPH);
9254
- }
9255
-
9256
- // A pointer induction, performed by using a gep
9257
- BasicBlock::iterator InductionLoc = State.Builder .GetInsertPoint ();
9258
- unsigned UF = getNumOperands () == 2
9259
- ? 1
9260
- : cast<ConstantInt>(getOperand (2 )->getLiveInIRValue ())
9261
- ->getZExtValue ();
9262
-
9263
- Value *ScalarStepValue = State.get (getOperand (1 ), VPIteration (0 , 0 ));
9264
- Value *RuntimeVF = getRuntimeVF (State.Builder , PhiType, State.VF );
9265
- Value *NumUnrolledElems =
9266
- State.Builder .CreateMul (RuntimeVF, ConstantInt::get (PhiType, UF));
9267
- // Add induction update using an incorrect block temporarily. The phi node
9268
- // will be fixed after VPlan execution. Note that at this point the latch
9269
- // block cannot be used, as it does not exist yet.
9270
- // TODO: Model increment value in VPlan, by turning the recipe into a
9271
- // multi-def and a subclass of VPHeaderPHIRecipe.
9272
- if (getNumOperands () != 5 ) {
9273
- Value *InductionGEP = GetElementPtrInst::Create (
9274
- State.Builder .getInt8Ty (), NewPointerPhi,
9275
- State.Builder .CreateMul (ScalarStepValue, NumUnrolledElems), " ptr.ind" ,
9276
- InductionLoc);
9277
-
9278
- NewPointerPhi->addIncoming (InductionGEP, VectorPH);
9279
- }
9280
-
9281
- // Create UF many actual address geps that use the pointer
9282
- // phi as base and a vectorized version of the step value
9283
- // (<step*0, ..., step*N>) as offset.
9284
- for (unsigned Part = 0 ; Part < State.UF ; ++Part) {
9285
- Type *VecPhiType = VectorType::get (PhiType, State.VF );
9286
- Value *StartOffsetScalar = State.Builder .CreateMul (
9287
- RuntimeVF, ConstantInt::get (PhiType, CurrentPart));
9288
- Value *StartOffset =
9289
- State.Builder .CreateVectorSplat (State.VF , StartOffsetScalar);
9290
- // Create a vector of consecutive numbers from zero to VF.
9291
- StartOffset = State.Builder .CreateAdd (
9292
- StartOffset, State.Builder .CreateStepVector (VecPhiType));
9293
-
9294
- assert (ScalarStepValue == State.get (getOperand (1 ), VPIteration (Part, 0 )) &&
9295
- " scalar step must be the same across all parts" );
9296
- Value *GEP = State.Builder .CreateGEP (
9297
- State.Builder .getInt8Ty (), NewPointerPhi,
9298
- State.Builder .CreateMul (
9299
- StartOffset,
9300
- State.Builder .CreateVectorSplat (State.VF , ScalarStepValue),
9301
- " vector.gep" ));
9302
- State.set (this , GEP, Part);
9303
- }
9304
- }
9305
-
9306
9225
void VPDerivedIVRecipe::execute (VPTransformState &State) {
9307
9226
assert (!State.Instance && " VPDerivedIVRecipe being replicated." );
9308
9227
0 commit comments