From: Dan Gohman Date: Wed, 17 Dec 2008 04:30:46 +0000 (+0000) Subject: Double the amount of memory reserved for SUnits. This is a X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=89b64bd7e5032292adc308da0d867979734da8c1;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61122 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp index 08d6702fc81..4b6469b5d06 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ b/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