summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-17 04:30:46 +0000
committerDan Gohman <gohman@apple.com>2008-12-17 04:30:46 +0000
commitce70fe2e25a33290c7401df7b98ba1e63ad7855a (patch)
tree9a631f80acda83522bd9acc04c8817d0d023e699 /llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
parent2a16bbe394491d97482411921570cc9650e955db (diff)
downloadbcm5719-llvm-ce70fe2e25a33290c7401df7b98ba1e63ad7855a.tar.gz
bcm5719-llvm-ce70fe2e25a33290c7401df7b98ba1e63ad7855a.zip
Double the amount of memory reserved for SUnits. This is a
temporary workaround for an obscure bug. When node cloning is used, it is possible that more SUnits will be created, and if the SUnits std::vector has to reallocate, it will invalidate all the graph edges. llvm-svn: 61122
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
index 08d6702fc81..4b6469b5d06 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
@@ -71,7 +71,9 @@ void ScheduleDAGSDNodes::BuildSchedUnits() {
// Reserve entries in the vector for each of the SUnits we are creating. This
// ensure that reallocation of the vector won't happen, so SUnit*'s won't get
// invalidated.
- SUnits.reserve(DAG->allnodes_size());
+ // FIXME: Multiply by 2 because we may clone nodes during scheduling.
+ // This is a temporary workaround.
+ SUnits.reserve(DAG->allnodes_size() * 2);
// During scheduling, the NodeId field of SDNode is used to map SDNodes
// to their associated SUnits by holding SUnits table indices. A value
OpenPOWER on IntegriCloud