File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -251,12 +251,18 @@ class RecurrenceDescriptor {
251251 Kind == RecurKind::SMin || Kind == RecurKind::SMax;
252252 }
253253
254+ // / Returns true if the recurrence kind is a floating-point minnum/maxnum
255+ // / kind.
256+ static bool isFPMinMaxNumRecurrenceKind (RecurKind Kind) {
257+ return Kind == RecurKind::FMinNum || Kind == RecurKind::FMaxNum;
258+ }
259+
254260 // / Returns true if the recurrence kind is a floating-point min/max kind.
255261 static bool isFPMinMaxRecurrenceKind (RecurKind Kind) {
256262 return Kind == RecurKind::FMin || Kind == RecurKind::FMax ||
257- Kind == RecurKind::FMinNum || Kind == RecurKind::FMaxNum ||
258263 Kind == RecurKind::FMinimum || Kind == RecurKind::FMaximum ||
259- Kind == RecurKind::FMinimumNum || Kind == RecurKind::FMaximumNum;
264+ Kind == RecurKind::FMinimumNum || Kind == RecurKind::FMaximumNum ||
265+ isFPMinMaxNumRecurrenceKind (Kind);
260266 }
261267
262268 // / Returns true if the recurrence kind is any min/max kind.
Original file line number Diff line number Diff line change @@ -4264,8 +4264,8 @@ bool LoopVectorizationPlanner::isCandidateForEpilogueVectorization(
42644264 if (any_of (OrigLoop->getHeader ()->phis (), [&](PHINode &Phi) {
42654265 if (!Legal->isReductionVariable (&Phi))
42664266 return Legal->isFixedOrderRecurrence (&Phi);
4267- RecurKind RK = Legal-> getRecurrenceDescriptor (&Phi). getRecurrenceKind ();
4268- return RK == RecurKind::FMinNum || RK == RecurKind::FMaxNum ;
4267+ return RecurrenceDescriptor::isFPMinMaxNumRecurrenceKind (
4268+ Legal-> getRecurrenceDescriptor (&Phi). getRecurrenceKind ()) ;
42694269 }))
42704270 return false ;
42714271
Original file line number Diff line number Diff line change @@ -840,8 +840,8 @@ bool VPlanTransforms::handleMaxMinNumReductions(VPlan &Plan) {
840840 // TODO: Support multiple MaxNum/MinNum reductions and other reductions.
841841 if (RedPhiR)
842842 return false ;
843- if (Cur-> getRecurrenceKind () != RecurKind::FMaxNum &&
844- Cur->getRecurrenceKind () != RecurKind::FMinNum ) {
843+ if (! RecurrenceDescriptor::isFPMinMaxNumRecurrenceKind (
844+ Cur->getRecurrenceKind ()) ) {
845845 HasUnsupportedPhi = true ;
846846 continue ;
847847 }
@@ -861,10 +861,9 @@ bool VPlanTransforms::handleMaxMinNumReductions(VPlan &Plan) {
861861 if (!MinMaxOp)
862862 return false ;
863863
864- RecurKind RedPhiRK = RedPhiR-> getRecurrenceKind ();
865- assert ((RedPhiRK == RecurKind::FMaxNum || RedPhiRK == RecurKind::FMinNum ) &&
864+ assert ( RecurrenceDescriptor::isFPMinMaxNumRecurrenceKind (
865+ RedPhiR-> getRecurrenceKind () ) &&
866866 " unsupported reduction" );
867- (void )RedPhiRK;
868867
869868 // / Check if the vector loop of \p Plan can early exit and restart
870869 // / execution of last vector iteration in the scalar loop. This requires all
You can’t perform that action at this time.
0 commit comments