[Analysis] Pass RecurrenceDescriptor as const reference. NFCI.

We were passing the RecurrenceDescriptor by value to most of the reduction analysis methods, despite it being rather bulky with TrackingVH members (that can be costly to copy). In all these cases we're only using the RecurrenceDescriptor for rather basic purposes (access to types/kinds etc.).

Differential Revision: https://reviews.llvm.org/D104029
This commit is contained in:
Simon Pilgrim
2021-06-11 10:19:37 +01:00
parent d789ed11ea
commit 5e6bfb661e
10 changed files with 25 additions and 23 deletions

View File

@@ -921,7 +921,7 @@ bool LoopVectorizationLegality::canVectorizeFPMath(
// have the isOrdered flag set, which indicates that we can move the
// reduction operations in-loop.
return (all_of(getReductionVars(), [&](auto &Reduction) -> bool {
RecurrenceDescriptor RdxDesc = Reduction.second;
const RecurrenceDescriptor &RdxDesc = Reduction.second;
return !RdxDesc.hasExactFPMath() || RdxDesc.isOrdered();
}));
}