aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2021-06-11 10:19:37 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2021-06-11 10:24:14 +0100
commit5e6bfb661e8b51b440eda04d0be0c9a00b8713e9 (patch)
tree4d89c7a111b4f83b4a7de6227408af4ec46481e2 /llvm/lib/Transforms/Utils/LoopUtils.cpp
parentd789ed11ea01b30a69e8cd9612ebd336398ef3ec (diff)
downloadllvm-5e6bfb661e8b51b440eda04d0be0c9a00b8713e9.zip
llvm-5e6bfb661e8b51b440eda04d0be0c9a00b8713e9.tar.gz
llvm-5e6bfb661e8b51b440eda04d0be0c9a00b8713e9.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 95ae7db..f78ddd0 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -1000,7 +1000,8 @@ Value *llvm::createSimpleTargetReduction(IRBuilderBase &Builder,
Value *llvm::createTargetReduction(IRBuilderBase &B,
const TargetTransformInfo *TTI,
- RecurrenceDescriptor &Desc, Value *Src) {
+ const RecurrenceDescriptor &Desc,
+ Value *Src) {
// TODO: Support in-order reductions based on the recurrence descriptor.
// All ops in the reduction inherit fast-math-flags from the recurrence
// descriptor.
@@ -1010,8 +1011,8 @@ Value *llvm::createTargetReduction(IRBuilderBase &B,
}
Value *llvm::createOrderedReduction(IRBuilderBase &B,
- RecurrenceDescriptor &Desc, Value *Src,
- Value *Start) {
+ const RecurrenceDescriptor &Desc,
+ Value *Src, Value *Start) {
assert(Desc.getRecurrenceKind() == RecurKind::FAdd &&
"Unexpected reduction kind");
assert(Src->getType()->isVectorTy() && "Expected a vector type");