]> granicus.if.org Git - llvm/commitdiff
[RDF] Switch NodeList to SmallVector from std::vector
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 19 Apr 2017 15:12:44 +0000 (15:12 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 19 Apr 2017 15:12:44 +0000 (15:12 +0000)
The list has a single element 75+% of the time, reservation of 4 elements
is sufficient in 95% of cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300705 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/RDFGraph.h

index d5faca4cd6f4b5be0321e25055a5076e637fa210..52f390356b265c9764c24dd56302af77155cdef0 100644 (file)
@@ -508,7 +508,8 @@ namespace rdf {
   static_assert(sizeof(NodeBase) <= NodeAllocator::NodeMemSize,
         "NodeBase must be at most NodeAllocator::NodeMemSize bytes");
 
-  typedef std::vector<NodeAddr<NodeBase*>> NodeList;
+//  typedef std::vector<NodeAddr<NodeBase*>> NodeList;
+  typedef SmallVector<NodeAddr<NodeBase*>,4> NodeList;
   typedef std::set<NodeId> NodeSet;
 
   struct RefNode : public NodeBase {