[llvm] r260824 - Use ArrayRef to hide SmallVector details, kill a useless vector copy along the way.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 13 08:01:13 PST 2016


Author: d0k
Date: Sat Feb 13 10:01:12 2016
New Revision: 260824

URL: http://llvm.org/viewvc/llvm-project?rev=260824&view=rev
Log:
Use ArrayRef to hide SmallVector details, kill a useless vector copy along the way.

Modified:
    llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp

Modified: llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp?rev=260824&r1=260823&r2=260824&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/SampleProfile.cpp Sat Feb 13 10:01:12 2016
@@ -139,8 +139,7 @@ protected:
   void printBlockEquivalence(raw_ostream &OS, const BasicBlock *BB);
   bool computeBlockWeights(Function &F);
   void findEquivalenceClasses(Function &F);
-  void findEquivalencesFor(BasicBlock *BB1,
-                           SmallVector<BasicBlock *, 8> Descendants,
+  void findEquivalencesFor(BasicBlock *BB1, ArrayRef<BasicBlock *> Descendants,
                            DominatorTreeBase<BasicBlock> *DomTree);
   void propagateWeights(Function &F);
   uint64_t visitEdge(Edge E, unsigned *NumUnknownEdges, Edge *UnknownEdge);
@@ -731,7 +730,7 @@ bool SampleProfileLoader::inlineHotFunct
 ///                 with blocks from \p BB1's dominator tree, then
 ///                 this is the post-dominator tree, and vice versa.
 void SampleProfileLoader::findEquivalencesFor(
-    BasicBlock *BB1, SmallVector<BasicBlock *, 8> Descendants,
+    BasicBlock *BB1, ArrayRef<BasicBlock *> Descendants,
     DominatorTreeBase<BasicBlock> *DomTree) {
   const BasicBlock *EC = EquivalenceClass[BB1];
   uint64_t Weight = BlockWeights[EC];




More information about the llvm-commits mailing list