summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-03-08 19:35:47 +0000
committerEric Christopher <echristo@apple.com>2011-03-08 19:35:47 +0000
commit29449448b0f0420dfcf52e278fc01adbf1690d70 (patch)
treefb727fe43b7083b57e6179c3efdc22573b963285 /lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
parent4cdcb362891e3f945171df822174768b392986ed (diff)
downloadllvm-29449448b0f0420dfcf52e278fc01adbf1690d70.tar.gz
llvm-29449448b0f0420dfcf52e278fc01adbf1690d70.tar.bz2
llvm-29449448b0f0420dfcf52e278fc01adbf1690d70.tar.xz
Fix some latent bugs if the nodes are unschedulable. We'd gotten away
with this before since none of the register tracking or nightly tests had unschedulable nodes. This should probably be refixed with a special default Node that just returns some "don't touch me" values. Fixes PR9427 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
index 67005d7e63..b762af5ca9 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
@@ -446,6 +446,10 @@ void ScheduleDAGSDNodes::BuildSchedGraph(AliasAnalysis *AA) {
// Initialize NumNodeDefs for the current Node's opcode.
void ScheduleDAGSDNodes::RegDefIter::InitNodeNumDefs() {
+ // Check for phys reg copy.
+ if (!Node)
+ return;
+
if (!Node->isMachineOpcode()) {
if (Node->getOpcode() == ISD::CopyFromReg)
NodeNumDefs = 1;