From ad6758286adb61f8fe86955f0261debb5bfccb10 Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Wed, 19 Apr 2017 15:12:44 +0000 Subject: [PATCH] [RDF] Switch NodeList to SmallVector from std::vector 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Target/Hexagon/RDFGraph.h b/lib/Target/Hexagon/RDFGraph.h index d5faca4cd6f..52f390356b2 100644 --- a/lib/Target/Hexagon/RDFGraph.h +++ b/lib/Target/Hexagon/RDFGraph.h @@ -508,7 +508,8 @@ namespace rdf { static_assert(sizeof(NodeBase) <= NodeAllocator::NodeMemSize, "NodeBase must be at most NodeAllocator::NodeMemSize bytes"); - typedef std::vector> NodeList; +// typedef std::vector> NodeList; + typedef SmallVector,4> NodeList; typedef std::set NodeSet; struct RefNode : public NodeBase { -- 2.50.1