X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FSelectionDAG%2FScheduleDAGRRList.cpp;h=a51595f1b06385cf37ac641dff805d4bf3720b83;hb=a75ce9f5d2236d93c117e861e60e6f3f748c9555;hp=c93ef4dd46721d4aef8d07be83f2e6115e78981d;hpb=2da8bc8a5f7705ac131184cd247f48500da0d74e;p=oota-llvm.git diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index c93ef4dd467..a51595f1b06 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -348,7 +348,10 @@ void ScheduleDAGRRList::ReleasePredecessors(SUnit *SU) { /// Check to see if any of the pending instructions are ready to issue. If /// so, add them to the available queue. void ScheduleDAGRRList::ReleasePending() { - assert(!EnableSchedCycles && "requires --enable-sched-cycles" ); + if (!EnableSchedCycles) { + assert(PendingQueue.empty() && "pending instrs not allowed in this mode"); + return; + } // If the available queue is empty, it is safe to reset MinAvailableCycle. if (AvailableQueue->empty()) @@ -435,6 +438,13 @@ void ScheduleDAGRRList::AdvancePastStalls(SUnit *SU) { /// Record this SUnit in the HazardRecognizer. /// Does not update CurCycle. void ScheduleDAGRRList::EmitNode(SUnit *SU) { + if (!EnableSchedCycles || HazardRec->getMaxLookAhead() == 0) + return; + + // Check for phys reg copy. + if (!SU->getNode()) + return; + switch (SU->getNode()->getOpcode()) { default: assert(SU->getNode()->isMachineOpcode() && @@ -627,8 +637,7 @@ void ScheduleDAGRRList::BacktrackBottomUp(SUnit *SU, SUnit *BtSU) { RestoreHazardCheckerBottomUp(); - if (EnableSchedCycles) - ReleasePending(); + ReleasePending(); ++NumBacktracks; } @@ -645,13 +654,13 @@ static bool isOperandOf(const SUnit *SU, SDNode *N) { /// CopyAndMoveSuccessors - Clone the specified node and move its scheduled /// successors to the newly created node. SUnit *ScheduleDAGRRList::CopyAndMoveSuccessors(SUnit *SU) { - if (SU->getNode()->getGluedNode()) - return NULL; - SDNode *N = SU->getNode(); if (!N) return NULL; + if (SU->getNode()->getGluedNode()) + return NULL; + SUnit *NewSU; bool TryUnfold = false; for (unsigned i = 0, e = N->getNumValues(); i != e; ++i) {