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