summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-23 17:39:36 +0000
committerDan Gohman <gohman@apple.com>2009-03-23 17:39:36 +0000
commitf477262e69ce9ed268c45272c8c2f0fdd59713fe (patch)
treebb8aaa71a83f43d276dffab3a202ca0a8fe3108f /llvm/lib/CodeGen
parent5030e5eabe6a0a925758af0f38242b5ac186f5ac (diff)
downloadbcm5719-llvm-f477262e69ce9ed268c45272c8c2f0fdd59713fe.tar.gz
bcm5719-llvm-f477262e69ce9ed268c45272c8c2f0fdd59713fe.zip
Don't set SUnit::hasPhysRegDefs to true unless the defs are
actually have uses, which reflects the way it's used. llvm-svn: 67540
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
index 303f8cc6a61..7aa15bcc686 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
@@ -175,7 +175,10 @@ void ScheduleDAGSDNodes::AddSchedEdges() {
if (N->isMachineOpcode() &&
TII->get(N->getMachineOpcode()).getImplicitDefs()) {
SU->hasPhysRegClobbers = true;
- if (CountResults(N) > TII->get(N->getMachineOpcode()).getNumDefs())
+ unsigned NumUsed = CountResults(N);
+ while (NumUsed != 0 && !N->hasAnyUseOfValue(NumUsed - 1))
+ --NumUsed; // Skip over unused values at the end.
+ if (NumUsed > TII->get(N->getMachineOpcode()).getNumDefs())
SU->hasPhysRegDefs = true;
}
OpenPOWER on IntegriCloud