diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-05 10:37:38 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-05-05 10:37:38 +0000 |
commit | 5b05f20a3a538a6f87f67220a1eea77d14175597 (patch) | |
tree | 4fd6bf6e4030cf3f9dccbe6151c42fedd3a2540f /llvm/lib/Transforms/Vectorize | |
parent | 0f89b76b84776aa98266073d36bdeb4e117c3a6d (diff) | |
download | bcm5719-llvm-5b05f20a3a538a6f87f67220a1eea77d14175597.tar.gz bcm5719-llvm-5b05f20a3a538a6f87f67220a1eea77d14175597.zip |
[SLPVectorizer] Make getSpillCost() const. NFCI.
Ideally getTreeCost() should be const as well but non-const Type creation would need to be addressed first.
llvm-svn: 359975
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index e45787f1aa7..56176e586a5 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -524,7 +524,7 @@ public: /// \returns the cost incurred by unwanted spills and fills, caused by /// holding live values over call sites. - int getSpillCost(); + int getSpillCost() const; /// \returns the vectorization cost of the subtree that starts at \p VL. /// A negative number means that this is profitable. @@ -1305,6 +1305,13 @@ private: return nullptr; } + const TreeEntry *getTreeEntry(Value *V) const { + auto I = ScalarToTreeEntry.find(V); + if (I != ScalarToTreeEntry.end()) + return &VectorizableTree[I->second]; + return nullptr; + } + /// Maps a specific scalar to its tree entry. SmallDenseMap<Value*, int> ScalarToTreeEntry; @@ -3066,7 +3073,7 @@ bool BoUpSLP::isTreeTinyAndNotFullyVectorizable() const { return true; } -int BoUpSLP::getSpillCost() { +int BoUpSLP::getSpillCost() const { // Walk from the bottom of the tree to the top, tracking which values are // live. When we see a call instruction that is not part of our tree, // query TTI to see if there is a cost to keeping values live over it |