From 338c1b701f23888eed67ca7e3214db175940df21 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 6 May 2021 16:19:36 +0100 Subject: [PATCH] [SLP] Constify the TreeEntry* input into getEntryCost() + setInsertPointAfterBundle(). NFCI. --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index ccc8d7c..22e090f 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -1516,7 +1516,7 @@ private: 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 Roots, unsigned Depth, @@ -1557,7 +1557,7 @@ private: /// 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 VL); @@ -3518,7 +3518,7 @@ computeExtractCost(ArrayRef VL, FixedVectorType *VecTy, return Cost; } -InstructionCost BoUpSLP::getEntryCost(TreeEntry *E) { +InstructionCost BoUpSLP::getEntryCost(const TreeEntry *E) { ArrayRef VL = E->Scalars; Type *ScalarTy = VL[0]->getType(); @@ -4435,7 +4435,7 @@ void BoUpSLP::reorderInputsAccordingToOpcode(ArrayRef 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(); -- 2.7.4