aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2010-12-24 06:46:50 +0000
committerAndrew Trick <atrick@apple.com>2010-12-24 06:46:50 +0000
commit24312230ada6f4cfa8776351dafb12eea8a81b33 (patch)
treedaa8843ad53e08e8cf7e46310294ba6e6bd22bd3 /lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
parent398abb4a9aef6da6118c31b6563ec68d1766b913 (diff)
downloadexternal_llvm-24312230ada6f4cfa8776351dafb12eea8a81b33.zip
external_llvm-24312230ada6f4cfa8776351dafb12eea8a81b33.tar.gz
external_llvm-24312230ada6f4cfa8776351dafb12eea8a81b33.tar.bz2
Fix a few cases where the scheduler is not checking for phys reg copies. The scheduling node may have a NULL DAG node, yuck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122544 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index c93ef4d..d636804 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -435,6 +435,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() &&
@@ -645,13 +652,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) {