[llvm] 338c1b7 - [SLP] Constify the TreeEntry* input into getEntryCost() + setInsertPointAfterBundle(). NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu May 6 08:20:32 PDT 2021


Author: Simon Pilgrim
Date: 2021-05-06T16:20:19+01:00
New Revision: 338c1b701f23888eed67ca7e3214db175940df21

URL: https://github.com/llvm/llvm-project/commit/338c1b701f23888eed67ca7e3214db175940df21
DIFF: https://github.com/llvm/llvm-project/commit/338c1b701f23888eed67ca7e3214db175940df21.diff

LOG: [SLP] Constify the TreeEntry* input into getEntryCost() + setInsertPointAfterBundle(). NFCI.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index ccc8d7c8619b..22e090fd1d7c 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -1516,7 +1516,7 @@ class BoUpSLP {
   bool areAllUsersVectorized(Instruction *I) const;
 
   /// \returns the cost of the vectorizable entry.
-  InstructionCost getEntryCost(TreeEntry *E);
+  InstructionCost getEntryCost(const TreeEntry *E);
 
   /// This is the recursive part of buildTree.
   void buildTree_rec(ArrayRef<Value *> Roots, unsigned Depth,
@@ -1557,7 +1557,7 @@ class BoUpSLP {
 
   /// Set the Builder insert point to one after the last instruction in
   /// the bundle
-  void setInsertPointAfterBundle(TreeEntry *E);
+  void setInsertPointAfterBundle(const TreeEntry *E);
 
   /// \returns a vector from a collection of scalars in \p VL.
   Value *gather(ArrayRef<Value *> VL);
@@ -3518,7 +3518,7 @@ computeExtractCost(ArrayRef<Value *> VL, FixedVectorType *VecTy,
   return Cost;
 }
 
-InstructionCost BoUpSLP::getEntryCost(TreeEntry *E) {
+InstructionCost BoUpSLP::getEntryCost(const TreeEntry *E) {
   ArrayRef<Value*> VL = E->Scalars;
 
   Type *ScalarTy = VL[0]->getType();
@@ -4435,7 +4435,7 @@ void BoUpSLP::reorderInputsAccordingToOpcode(ArrayRef<Value *> VL,
   Right = Ops.getVL(1);
 }
 
-void BoUpSLP::setInsertPointAfterBundle(TreeEntry *E) {
+void BoUpSLP::setInsertPointAfterBundle(const TreeEntry *E) {
   // Get the basic block this bundle is in. All instructions in the bundle
   // should be in this block.
   auto *Front = E->getMainOp();


        


More information about the llvm-commits mailing list