@@ -9445,6 +9445,7 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9445
9445
continue ;
9446
9446
9447
9447
const RecurrenceDescriptor &RdxDesc = PhiR->getRecurrenceDescriptor ();
9448
+ Type *PhiTy = PhiR->getOperand (0 )->getLiveInIRValue ()->getType ();
9448
9449
// If tail is folded by masking, introduce selects between the phi
9449
9450
// and the users outside the vector region of each reduction, at the
9450
9451
// beginning of the dedicated latch block.
@@ -9456,7 +9457,6 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9456
9457
if (!PhiR->isInLoop () && CM.foldTailByMasking () &&
9457
9458
!isa<VPPartialReductionRecipe>(OrigExitingVPV->getDefiningRecipe ())) {
9458
9459
VPValue *Cond = RecipeBuilder.getBlockInMask (PhiR->getParent ());
9459
- Type *PhiTy = PhiR->getOperand (0 )->getLiveInIRValue ()->getType ();
9460
9460
std::optional<FastMathFlags> FMFs =
9461
9461
PhiTy->isFloatingPointTy ()
9462
9462
? std::make_optional (RdxDesc.getFastMathFlags ())
@@ -9477,7 +9477,6 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
9477
9477
// If the vector reduction can be performed in a smaller type, we truncate
9478
9478
// then extend the loop exit value to enable InstCombine to evaluate the
9479
9479
// entire expression in the smaller type.
9480
- Type *PhiTy = PhiR->getStartValue ()->getLiveInIRValue ()->getType ();
9481
9480
if (MinVF.isVector () && PhiTy != RdxDesc.getRecurrenceType () &&
9482
9481
!RecurrenceDescriptor::isAnyOfRecurrenceKind (
9483
9482
RdxDesc.getRecurrenceKind ())) {
0 commit comments