summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
diff options
context:
space:
mode:
authorPreston Gurd <preston.gurd@intel.com>2013-01-25 15:18:54 +0000
committerPreston Gurd <preston.gurd@intel.com>2013-01-25 15:18:54 +0000
commit0959bb707dd0ab28da18f98cd9da60b36be87d7b (patch)
treeb8537dabadbf1030cc097627995c776866a86eda /llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
parente8f83dbbd895493b7e8bbf2d7624103a1cb6ad6c (diff)
downloadbcm5719-llvm-0959bb707dd0ab28da18f98cd9da60b36be87d7b.tar.gz
bcm5719-llvm-0959bb707dd0ab28da18f98cd9da60b36be87d7b.zip
This patch aims to reduce compile time in LegalizeTypes by using SmallDenseMap,
with an initial number of elements, instead of DenseMap, which has zero initial elements, in order to avoid the copying of elements when the size changes and to avoid allocating space every time LegalizeTypes is run. This patch will not affect the memory footprint, because DenseMap will increase the element size to 64 when the first element is added. Patch by Wan Xiaofei. llvm-svn: 173448
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
index 3989295ff59..5d547ed2253 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
@@ -40,7 +40,7 @@ class VectorLegalizer {
/// LegalizedNodes - For nodes that are of legal width, and that have more
/// than one use, this map indicates what regularized operand to use. This
/// allows us to avoid legalizing the same thing more than once.
- DenseMap<SDValue, SDValue> LegalizedNodes;
+ SmallDenseMap<SDValue, SDValue, 64> LegalizedNodes;
// Adds a node to the translation cache
void AddLegalizedOperand(SDValue From, SDValue To) {
OpenPOWER on IntegriCloud