aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commit8cccf0ef0ced7f4d75ca574b596036a9b6cd4315 (patch)
treef4320254eda5b94ffed22421f4aa5ceb2fbc8179 /lib
parenta5c8ae233ebaef270b8fa96565ca7bf4fdcb3e15 (diff)
downloadexternal_llvm-8cccf0ef0ced7f4d75ca574b596036a9b6cd4315.zip
external_llvm-8cccf0ef0ced7f4d75ca574b596036a9b6cd4315.tar.gz
external_llvm-8cccf0ef0ced7f4d75ca574b596036a9b6cd4315.tar.bz2
Don't set SUnit::hasPhysRegDefs to true unless the defs are
actually have uses, which reflects the way it's used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
index 303f8cc..7aa15bc 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ b/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;
}