diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 4066e56e2032c..21d3385e3862a 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1476,18 +1476,6 @@ class LoopVectorizationCostModel { 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) 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) const { - return TTI.isLegalMaskedGather(DataType, Alignment); - } - /// Returns true if the target machine can represent \p V as a masked gather /// or scatter operation. bool isLegalGatherOrScatter(Value *V) { @@ -1497,8 +1485,8 @@ class LoopVectorizationCostModel { return false; auto *Ty = getLoadStoreType(V); Align Align = getLoadStoreAlignment(V); - return (LI && isLegalMaskedGather(Ty, Align)) || - (SI && isLegalMaskedScatter(Ty, Align)); + return (LI && TTI.isLegalMaskedGather(Ty, Align)) || + (SI && TTI.isLegalMaskedScatter(Ty, Align)); } /// Returns true if the target machine supports all of the reduction @@ -5347,9 +5335,9 @@ bool LoopVectorizationCostModel::isScalarWithPredication(Instruction *I) const { auto *Ty = getLoadStoreType(I); const Align Alignment = getLoadStoreAlignment(I); return isa(I) ? !(isLegalMaskedLoad(Ty, Ptr, Alignment) || - isLegalMaskedGather(Ty, Alignment)) + TTI.isLegalMaskedGather(Ty, Alignment)) : !(isLegalMaskedStore(Ty, Ptr, Alignment) || - isLegalMaskedScatter(Ty, Alignment)); + TTI.isLegalMaskedScatter(Ty, Alignment)); } case Instruction::UDiv: case Instruction::SDiv: