@@ -1013,38 +1013,38 @@ void VPlan::execute(VPTransformState *State) {
1013
1013
cast<VPBasicBlock>(Header->getPredecessors ()[1 ]);
1014
1014
BasicBlock *VectorLatchBB = State->CFG .VPBB2IRBB [LatchVPBB];
1015
1015
1016
- if (isa<VPWidenInductionRecipe>(&R)) {
1017
- PHINode *Phi = nullptr ;
1018
- if (isa<VPWidenIntOrFpInductionRecipe>(&R)) {
1019
- Phi = cast<PHINode>(State->get (R.getVPSingleValue ()));
1020
- } else {
1021
- auto *WidenPhi = cast<VPWidenPointerInductionRecipe>(&R);
1022
- assert (!WidenPhi->onlyScalarsGenerated (State->VF .isScalable ()) &&
1023
- " recipe generating only scalars should have been replaced" );
1024
- auto *GEP = cast<GetElementPtrInst>(State->get (WidenPhi));
1025
- Phi = cast<PHINode>(GEP->getPointerOperand ());
1016
+ if (isa<VPWidenInductionRecipe>(&R)) {
1017
+ PHINode *Phi = nullptr ;
1018
+ if (isa<VPWidenIntOrFpInductionRecipe>(&R)) {
1019
+ Phi = cast<PHINode>(State->get (R.getVPSingleValue ()));
1020
+ } else {
1021
+ auto *WidenPhi = cast<VPWidenPointerInductionRecipe>(&R);
1022
+ assert (!WidenPhi->onlyScalarsGenerated (State->VF .isScalable ()) &&
1023
+ " recipe generating only scalars should have been replaced" );
1024
+ auto *GEP = cast<GetElementPtrInst>(State->get (WidenPhi));
1025
+ Phi = cast<PHINode>(GEP->getPointerOperand ());
1026
+ }
1027
+
1028
+ Phi->setIncomingBlock (1 , VectorLatchBB);
1029
+
1030
+ // Move the last step to the end of the latch block. This ensures
1031
+ // consistent placement of all induction updates.
1032
+ Instruction *Inc = cast<Instruction>(Phi->getIncomingValue (1 ));
1033
+ Inc->moveBefore (VectorLatchBB->getTerminator ()->getPrevNode ());
1034
+
1035
+ // Use the steps for the last part as backedge value for the induction.
1036
+ if (auto *IV = dyn_cast<VPWidenIntOrFpInductionRecipe>(&R))
1037
+ Inc->setOperand (0 , State->get (IV->getLastUnrolledPartOperand ()));
1038
+ continue ;
1026
1039
}
1027
1040
1028
- Phi->setIncomingBlock (1 , VectorLatchBB);
1029
-
1030
- // Move the last step to the end of the latch block. This ensures
1031
- // consistent placement of all induction updates.
1032
- Instruction *Inc = cast<Instruction>(Phi->getIncomingValue (1 ));
1033
- Inc->moveBefore (VectorLatchBB->getTerminator ()->getPrevNode ());
1034
-
1035
- // Use the steps for the last part as backedge value for the induction.
1036
- if (auto *IV = dyn_cast<VPWidenIntOrFpInductionRecipe>(&R))
1037
- Inc->setOperand (0 , State->get (IV->getLastUnrolledPartOperand ()));
1038
- continue ;
1039
- }
1040
-
1041
- auto *PhiR = cast<VPHeaderPHIRecipe>(&R);
1042
- bool NeedsScalar = isa<VPScalarPHIRecipe>(PhiR) ||
1043
- (isa<VPReductionPHIRecipe>(PhiR) &&
1044
- cast<VPReductionPHIRecipe>(PhiR)->isInLoop ());
1045
- Value *Phi = State->get (PhiR, NeedsScalar);
1046
- Value *Val = State->get (PhiR->getBackedgeValue (), NeedsScalar);
1047
- cast<PHINode>(Phi)->addIncoming (Val, VectorLatchBB);
1041
+ auto *PhiR = cast<VPHeaderPHIRecipe>(&R);
1042
+ bool NeedsScalar = isa<VPScalarPHIRecipe>(PhiR) ||
1043
+ (isa<VPReductionPHIRecipe>(PhiR) &&
1044
+ cast<VPReductionPHIRecipe>(PhiR)->isInLoop ());
1045
+ Value *Phi = State->get (PhiR, NeedsScalar);
1046
+ Value *Val = State->get (PhiR->getBackedgeValue (), NeedsScalar);
1047
+ cast<PHINode>(Phi)->addIncoming (Val, VectorLatchBB);
1048
1048
}
1049
1049
}
1050
1050
}
@@ -1412,7 +1412,6 @@ void VPlanIngredient::print(raw_ostream &O) const {
1412
1412
1413
1413
#endif
1414
1414
1415
-
1416
1415
bool VPValue::isDefinedOutsideLoopRegions () const {
1417
1416
auto *DefR = getDefiningRecipe ();
1418
1417
if (!DefR)
0 commit comments