forked from OSchip/llvm-project
[LV] Mark a few more cost-model members as const (NFC).
This commit is contained in:
parent
581b429f7d
commit
8c6c357897
|
@ -1446,27 +1446,27 @@ public:
|
|||
|
||||
/// Returns true if the target machine supports masked store operation
|
||||
/// for the given \p DataType and kind of access to \p Ptr.
|
||||
bool isLegalMaskedStore(Type *DataType, Value *Ptr, Align Alignment) {
|
||||
bool isLegalMaskedStore(Type *DataType, Value *Ptr, Align Alignment) const {
|
||||
return Legal->isConsecutivePtr(Ptr) &&
|
||||
TTI.isLegalMaskedStore(DataType, Alignment);
|
||||
}
|
||||
|
||||
/// Returns true if the target machine supports masked load operation
|
||||
/// for the given \p DataType and kind of access to \p Ptr.
|
||||
bool isLegalMaskedLoad(Type *DataType, Value *Ptr, Align Alignment) {
|
||||
bool isLegalMaskedLoad(Type *DataType, Value *Ptr, Align Alignment) const {
|
||||
return Legal->isConsecutivePtr(Ptr) &&
|
||||
TTI.isLegalMaskedLoad(DataType, Alignment);
|
||||
}
|
||||
|
||||
/// Returns true if the target machine supports masked scatter operation
|
||||
/// for the given \p DataType.
|
||||
bool isLegalMaskedScatter(Type *DataType, Align Alignment) {
|
||||
bool isLegalMaskedScatter(Type *DataType, Align Alignment) const {
|
||||
return TTI.isLegalMaskedScatter(DataType, Alignment);
|
||||
}
|
||||
|
||||
/// Returns true if the target machine supports masked gather operation
|
||||
/// for the given \p DataType.
|
||||
bool isLegalMaskedGather(Type *DataType, Align Alignment) {
|
||||
bool isLegalMaskedGather(Type *DataType, Align Alignment) const {
|
||||
return TTI.isLegalMaskedGather(DataType, Alignment);
|
||||
}
|
||||
|
||||
|
@ -1497,8 +1497,9 @@ public:
|
|||
/// instructions that may divide by zero.
|
||||
/// If a non-zero VF has been calculated, we check if I will be scalarized
|
||||
/// predication for that VF.
|
||||
bool isScalarWithPredication(Instruction *I,
|
||||
ElementCount VF = ElementCount::getFixed(1));
|
||||
bool
|
||||
isScalarWithPredication(Instruction *I,
|
||||
ElementCount VF = ElementCount::getFixed(1)) const;
|
||||
|
||||
// Returns true if \p I is an instruction that will be predicated either
|
||||
// through scalar predication or masked load/store or masked gather/scatter.
|
||||
|
@ -1558,7 +1559,7 @@ public:
|
|||
/// Returns true if all loop blocks should be masked to fold tail loop.
|
||||
bool foldTailByMasking() const { return FoldTailByMasking; }
|
||||
|
||||
bool blockNeedsPredication(BasicBlock *BB) {
|
||||
bool blockNeedsPredication(BasicBlock *BB) const {
|
||||
return foldTailByMasking() || Legal->blockNeedsPredication(BB);
|
||||
}
|
||||
|
||||
|
@ -5198,8 +5199,8 @@ void LoopVectorizationCostModel::collectLoopScalars(ElementCount VF) {
|
|||
Scalars[VF].insert(Worklist.begin(), Worklist.end());
|
||||
}
|
||||
|
||||
bool LoopVectorizationCostModel::isScalarWithPredication(Instruction *I,
|
||||
ElementCount VF) {
|
||||
bool LoopVectorizationCostModel::isScalarWithPredication(
|
||||
Instruction *I, ElementCount VF) const {
|
||||
if (!blockNeedsPredication(I->getParent()))
|
||||
return false;
|
||||
switch(I->getOpcode()) {
|
||||
|
|
Loading…
Reference in New Issue