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 {
251
251
Kind == RecurKind::SMin || Kind == RecurKind::SMax;
252
252
}
253
253
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
+
254
260
// / Returns true if the recurrence kind is a floating-point min/max kind.
255
261
static bool isFPMinMaxRecurrenceKind (RecurKind Kind) {
256
262
return Kind == RecurKind::FMin || Kind == RecurKind::FMax ||
257
- Kind == RecurKind::FMinNum || Kind == RecurKind::FMaxNum ||
258
263
Kind == RecurKind::FMinimum || Kind == RecurKind::FMaximum ||
259
- Kind == RecurKind::FMinimumNum || Kind == RecurKind::FMaximumNum;
264
+ Kind == RecurKind::FMinimumNum || Kind == RecurKind::FMaximumNum ||
265
+ isFPMinMaxNumRecurrenceKind (Kind);
260
266
}
261
267
262
268
// / 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(
4264
4264
if (any_of (OrigLoop->getHeader ()->phis (), [&](PHINode &Phi) {
4265
4265
if (!Legal->isReductionVariable (&Phi))
4266
4266
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 ()) ;
4269
4269
}))
4270
4270
return false ;
4271
4271
Original file line number Diff line number Diff line change @@ -840,8 +840,8 @@ bool VPlanTransforms::handleMaxMinNumReductions(VPlan &Plan) {
840
840
// TODO: Support multiple MaxNum/MinNum reductions and other reductions.
841
841
if (RedPhiR)
842
842
return false ;
843
- if (Cur-> getRecurrenceKind () != RecurKind::FMaxNum &&
844
- Cur->getRecurrenceKind () != RecurKind::FMinNum ) {
843
+ if (! RecurrenceDescriptor::isFPMinMaxNumRecurrenceKind (
844
+ Cur->getRecurrenceKind ()) ) {
845
845
HasUnsupportedPhi = true ;
846
846
continue ;
847
847
}
@@ -861,10 +861,9 @@ bool VPlanTransforms::handleMaxMinNumReductions(VPlan &Plan) {
861
861
if (!MinMaxOp)
862
862
return false ;
863
863
864
- RecurKind RedPhiRK = RedPhiR-> getRecurrenceKind ();
865
- assert ((RedPhiRK == RecurKind::FMaxNum || RedPhiRK == RecurKind::FMinNum ) &&
864
+ assert ( RecurrenceDescriptor::isFPMinMaxNumRecurrenceKind (
865
+ RedPhiR-> getRecurrenceKind () ) &&
866
866
" unsupported reduction" );
867
- (void )RedPhiRK;
868
867
869
868
// / Check if the vector loop of \p Plan can early exit and restart
870
869
// / execution of last vector iteration in the scalar loop. This requires all
You can’t perform that action at this time.
0 commit comments