@@ -1227,12 +1227,11 @@ Value *llvm::createFindLastIVReduction(IRBuilderBase &Builder, Value *Src,
12271227 RecurKind RdxKind, Value *Start,
12281228 Value *Sentinel) {
12291229 bool IsSigned = RecurrenceDescriptor::isSignedRecurrenceKind (RdxKind);
1230- Value *MaxRdx =
1231- Src->getType ()->isVectorTy ()
1232- ? (RecurrenceDescriptor::isFindLastIVRecurrenceKind (RdxKind)
1233- ? Builder.CreateIntMaxReduce (Src, IsSigned)
1234- : Builder.CreateIntMinReduce (Src, IsSigned))
1235- : Src;
1230+ bool IsMaxRdx = RecurrenceDescriptor::isFindLastIVRecurrenceKind (RdxKind);
1231+ Value *MaxRdx = Src->getType ()->isVectorTy ()
1232+ ? (IsMaxRdx ? Builder.CreateIntMaxReduce (Src, IsSigned)
1233+ : Builder.CreateIntMinReduce (Src, IsSigned))
1234+ : Src;
12361235 // Correct the final reduction result back to the start value if the maximum
12371236 // reduction is sentinel value.
12381237 Value *Cmp =
@@ -1328,7 +1327,7 @@ Value *llvm::createSimpleReduction(IRBuilderBase &Builder, Value *Src,
13281327 RecurKind Kind, Value *Mask, Value *EVL) {
13291328 assert (!RecurrenceDescriptor::isAnyOfRecurrenceKind (Kind) &&
13301329 !RecurrenceDescriptor::isFindIVRecurrenceKind (Kind) &&
1331- " AnyOf, FindFirstIV and FindLastIV reductions are not supported." );
1330+ " AnyOf and FindIV reductions are not supported." );
13321331 Intrinsic::ID Id = getReductionIntrinsicID (Kind);
13331332 auto VPID = VPIntrinsic::getForIntrinsic (Id);
13341333 assert (VPReductionIntrinsic::isVPReduction (VPID) &&
0 commit comments