@@ -8675,16 +8675,6 @@ VPRecipeBuilder::tryToWidenHistogram(const HistogramInfo *HI,
8675
8675
HI->Store ->getDebugLoc ());
8676
8676
}
8677
8677
8678
- void VPRecipeBuilder::fixHeaderPhis () {
8679
- BasicBlock *OrigLatch = OrigLoop->getLoopLatch ();
8680
- for (VPHeaderPHIRecipe *R : PhisToFix) {
8681
- auto *PN = cast<PHINode>(R->getUnderlyingValue ());
8682
- VPRecipeBase *IncR =
8683
- getRecipe (cast<Instruction>(PN->getIncomingValueForBlock (OrigLatch)));
8684
- R->addOperand (IncR->getVPSingleValue ());
8685
- }
8686
- }
8687
-
8688
8678
VPReplicateRecipe *
8689
8679
VPRecipeBuilder::handleReplication (Instruction *I, ArrayRef<VPValue *> Operands,
8690
8680
VFRange &Range) {
@@ -8870,6 +8860,7 @@ VPRecipeBase *VPRecipeBuilder::tryToCreateWidenRecipe(
8870
8860
if (Phi->getParent () != OrigLoop->getHeader ())
8871
8861
return tryToBlend (Phi, Operands);
8872
8862
8863
+ assert (Operands.size () == 2 && " Must have 2 operands for header phis" );
8873
8864
if ((Recipe = tryToOptimizeInductionPHI (Phi, Operands, Range)))
8874
8865
return Recipe;
8875
8866
@@ -8897,8 +8888,8 @@ VPRecipeBase *VPRecipeBuilder::tryToCreateWidenRecipe(
8897
8888
// directly, enabling more efficient codegen.
8898
8889
PhiRecipe = new VPFirstOrderRecurrencePHIRecipe (Phi, *StartV);
8899
8890
}
8900
-
8901
- PhisToFix. push_back ( PhiRecipe);
8891
+ // Add backedge value.
8892
+ PhiRecipe-> addOperand (Operands[ 1 ] );
8902
8893
return PhiRecipe;
8903
8894
}
8904
8895
@@ -9500,7 +9491,6 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
9500
9491
!Plan->getVectorLoopRegion ()->getEntryBasicBlock ()->empty () &&
9501
9492
" entry block must be set to a VPRegionBlock having a non-empty entry "
9502
9493
" VPBasicBlock" );
9503
- RecipeBuilder.fixHeaderPhis ();
9504
9494
9505
9495
// Update wide induction increments to use the same step as the corresponding
9506
9496
// wide induction. This enables detecting induction increments directly in
0 commit comments