Don't set SUnit::hasPhysRegDefs to true unless the defs are

actually have uses, which reflects the way it's used.

llvm-svn: 67540
This commit is contained in:
Dan Gohman 2009-03-23 17:39:36 +00:00
parent 5030e5eabe
commit f477262e69
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}