Index: lib/CodeGen/MachineScheduler.cpp =================================================================== --- lib/CodeGen/MachineScheduler.cpp +++ lib/CodeGen/MachineScheduler.cpp @@ -762,10 +762,6 @@ SmallVector TopRoots, BotRoots; findRootsAndBiasEdges(TopRoots, BotRoots); - // Initialize the strategy before modifying the DAG. - // This may initialize a DFSResult to be used for queue priority. - SchedImpl->initialize(this); - DEBUG( if (EntrySU.getInstr() != nullptr) EntrySU.dumpAll(this); @@ -776,6 +772,10 @@ ); if (ViewMISchedDAGs) viewGraph(); + // Initialize the strategy before modifying the DAG. + // This may initialize a DFSResult to be used for queue priority. + SchedImpl->initialize(this); + // Initialize ready queues now that the DAG and priority data are finalized. initQueues(TopRoots, BotRoots);