@@ -8580,37 +8580,28 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
8580
8580
return toVPRecipeResult (Recipe);
8581
8581
8582
8582
VPHeaderPHIRecipe *PhiRecipe = nullptr ;
8583
- if (Legal->isReductionVariable (Phi) || Legal->isFirstOrderRecurrence (Phi)) {
8584
- VPValue *StartV = Operands[0 ];
8585
- if (Legal->isReductionVariable (Phi)) {
8586
- const RecurrenceDescriptor &RdxDesc =
8587
- Legal->getReductionVars ().find (Phi)->second ;
8588
- assert (RdxDesc.getRecurrenceStartValue () ==
8589
- Phi->getIncomingValueForBlock (OrigLoop->getLoopPreheader ()));
8590
- PhiRecipe = new VPReductionPHIRecipe (Phi, RdxDesc, *StartV,
8591
- CM.isInLoopReduction (Phi),
8592
- CM.useOrderedReductions (RdxDesc));
8593
- } else {
8594
- PhiRecipe = new VPFirstOrderRecurrencePHIRecipe (Phi, *StartV);
8595
- }
8583
+ assert ((Legal->isReductionVariable (Phi) ||
8584
+ Legal->isFirstOrderRecurrence (Phi)) &&
8585
+ " can only widen reductions and first-order recurrences here" );
8586
+ VPValue *StartV = Operands[0 ];
8587
+ if (Legal->isReductionVariable (Phi)) {
8588
+ const RecurrenceDescriptor &RdxDesc =
8589
+ Legal->getReductionVars ().find (Phi)->second ;
8590
+ assert (RdxDesc.getRecurrenceStartValue () ==
8591
+ Phi->getIncomingValueForBlock (OrigLoop->getLoopPreheader ()));
8592
+ PhiRecipe = new VPReductionPHIRecipe (Phi, RdxDesc, *StartV,
8593
+ CM.isInLoopReduction (Phi),
8594
+ CM.useOrderedReductions (RdxDesc));
8595
+ } else {
8596
+ PhiRecipe = new VPFirstOrderRecurrencePHIRecipe (Phi, *StartV);
8597
+ }
8596
8598
8597
8599
// Record the incoming value from the backedge, so we can add the incoming
8598
8600
// value from the backedge after all recipes have been created.
8599
8601
recordRecipeOf (cast<Instruction>(
8600
8602
Phi->getIncomingValueForBlock (OrigLoop->getLoopLatch ())));
8601
8603
PhisToFix.push_back (PhiRecipe);
8602
- } else {
8603
- // TODO: record backedge value for remaining pointer induction phis.
8604
- assert (Phi->getType ()->isPointerTy () &&
8605
- " only pointer phis should be handled here" );
8606
- assert (Legal->getInductionVars ().count (Phi) &&
8607
- " Not an induction variable" );
8608
- InductionDescriptor II = Legal->getInductionVars ().lookup (Phi);
8609
- VPValue *Start = Plan->getOrAddVPValue (II.getStartValue ());
8610
- PhiRecipe = new VPWidenPHIRecipe (Phi, Start);
8611
- }
8612
-
8613
- return toVPRecipeResult (PhiRecipe);
8604
+ return toVPRecipeResult (PhiRecipe);
8614
8605
}
8615
8606
8616
8607
if (isa<TruncInst>(Instr) &&
0 commit comments