[llvm] 034503e - [LV] NFC: Remove redundant isLegalMasked(Gather|Scatter) functions.

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 2 06:10:31 PDT 2021


Author: Sander de Smalen
Date: 2021-06-02T14:09:07+01:00
New Revision: 034503e9d2d66ab75679ab5d2ee0848f4de3cac7

URL: https://github.com/llvm/llvm-project/commit/034503e9d2d66ab75679ab5d2ee0848f4de3cac7
DIFF: https://github.com/llvm/llvm-project/commit/034503e9d2d66ab75679ab5d2ee0848f4de3cac7.diff

LOG: [LV] NFC: Remove redundant isLegalMasked(Gather|Scatter) functions.

This NFC change follows from conversation in D102437, where it was discussed
to remove these functions as a separate patch.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 4066e56e2032..21d3385e3862 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<LoadInst>(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:


        


More information about the llvm-commits mailing list