[llvm] 543c542 - [LV] Add some const to RecurrenceDescriptor. NFC
David Green via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 30 04:28:15 PDT 2020
Author: David Green
Date: 2020-08-30T12:27:51+01:00
New Revision: 543c5425f1d3ee1be04accd7e658decb0ba27eeb
URL: https://github.com/llvm/llvm-project/commit/543c5425f1d3ee1be04accd7e658decb0ba27eeb
DIFF: https://github.com/llvm/llvm-project/commit/543c5425f1d3ee1be04accd7e658decb0ba27eeb.diff
LOG: [LV] Add some const to RecurrenceDescriptor. NFC
Added:
Modified:
llvm/include/llvm/Analysis/IVDescriptors.h
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/IVDescriptors.h b/llvm/include/llvm/Analysis/IVDescriptors.h
index 5e66ae3014ba..241d3f2a01e5 100644
--- a/llvm/include/llvm/Analysis/IVDescriptors.h
+++ b/llvm/include/llvm/Analysis/IVDescriptors.h
@@ -183,22 +183,22 @@ class RecurrenceDescriptor {
DenseMap<Instruction *, Instruction *> &SinkAfter,
DominatorTree *DT);
- RecurrenceKind getRecurrenceKind() { return Kind; }
+ RecurrenceKind getRecurrenceKind() const { return Kind; }
- MinMaxRecurrenceKind getMinMaxRecurrenceKind() { return MinMaxKind; }
+ MinMaxRecurrenceKind getMinMaxRecurrenceKind() const { return MinMaxKind; }
- FastMathFlags getFastMathFlags() { return FMF; }
+ FastMathFlags getFastMathFlags() const { return FMF; }
- TrackingVH<Value> getRecurrenceStartValue() { return StartValue; }
+ TrackingVH<Value> getRecurrenceStartValue() const { return StartValue; }
- Instruction *getLoopExitInstr() { return LoopExitInstr; }
+ Instruction *getLoopExitInstr() const { return LoopExitInstr; }
/// Returns true if the recurrence has unsafe algebra which requires a relaxed
/// floating-point model.
- bool hasUnsafeAlgebra() { return UnsafeAlgebraInst != nullptr; }
+ bool hasUnsafeAlgebra() const { return UnsafeAlgebraInst != nullptr; }
/// Returns first unsafe algebra instruction in the PHI node's use-chain.
- Instruction *getUnsafeAlgebraInst() { return UnsafeAlgebraInst; }
+ Instruction *getUnsafeAlgebraInst() const { return UnsafeAlgebraInst; }
/// Returns true if the recurrence kind is an integer kind.
static bool isIntegerRecurrenceKind(RecurrenceKind Kind);
@@ -211,14 +211,14 @@ class RecurrenceDescriptor {
/// Returns the type of the recurrence. This type can be narrower than the
/// actual type of the Phi if the recurrence has been type-promoted.
- Type *getRecurrenceType() { return RecurrenceType; }
+ Type *getRecurrenceType() const { return RecurrenceType; }
/// Returns a reference to the instructions used for type-promoting the
/// recurrence.
- SmallPtrSet<Instruction *, 8> &getCastInsts() { return CastInsts; }
+ const SmallPtrSet<Instruction *, 8> &getCastInsts() const { return CastInsts; }
/// Returns true if all source operands of the recurrence are SExtInsts.
- bool isSigned() { return IsSigned; }
+ bool isSigned() const{ return IsSigned; }
/// Attempts to find a chain of operations from Phi to LoopExitInst that can
/// be treated as a set of reductions instructions for in-loop reductions.
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 16c2215aabe1..bf48bf6926ad 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6842,7 +6842,7 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
// detection.
for (auto &Reduction : Legal->getReductionVars()) {
RecurrenceDescriptor &RedDes = Reduction.second;
- SmallPtrSetImpl<Instruction *> &Casts = RedDes.getCastInsts();
+ const SmallPtrSetImpl<Instruction *> &Casts = RedDes.getCastInsts();
VecValuesToIgnore.insert(Casts.begin(), Casts.end());
}
// Ignore type-casting instructions we identified during induction
More information about the llvm-commits
mailing list