summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-09-28 22:32:30 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-09-28 22:32:30 +0000
commita5e595d23a21b98a925fd578799aecd35c8a3fe3 (patch)
treec1ee27205d0e2f65d4eae3e9eaa5915350c025b3 /llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
parent8017506d9cf9b8c9fcab6f5d125cb991a36ba4e6 (diff)
downloadbcm5719-llvm-a5e595d23a21b98a925fd578799aecd35c8a3fe3.tar.gz
bcm5719-llvm-a5e595d23a21b98a925fd578799aecd35c8a3fe3.zip
If two instructions are both two-address code, favors (schedule closer to
terminator) the one that has a CopyToReg use. This fixes 2006-05-11-InstrSched.ll with -new-cc-modeling-scheme. llvm-svn: 42453
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 4fdf6a86731..d90accda627 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -63,7 +63,7 @@ SUnit *ScheduleDAG::Clone(SUnit *Old) {
SU->Latency = Old->Latency;
SU->isTwoAddress = Old->isTwoAddress;
SU->isCommutable = Old->isCommutable;
- SU->hasImplicitDefs = Old->hasImplicitDefs;
+ SU->hasPhysRegDefs = Old->hasPhysRegDefs;
SUnitMap[Old->Node].push_back(SU);
return SU;
}
@@ -167,8 +167,6 @@ void ScheduleDAG::BuildSchedUnits() {
if (MainNode->isTargetOpcode()) {
unsigned Opc = MainNode->getTargetOpcode();
const TargetInstrDescriptor &TID = TII->get(Opc);
- if (TID.ImplicitDefs)
- SU->hasImplicitDefs = true;
for (unsigned i = 0; i != TID.numOperands; ++i) {
if (TID.getOperandConstraint(i, TOI::TIED_TO) != -1) {
SU->isTwoAddress = true;
@@ -185,8 +183,10 @@ void ScheduleDAG::BuildSchedUnits() {
for (unsigned n = 0, e = SU->FlaggedNodes.size(); n != e; ++n) {
SDNode *N = SU->FlaggedNodes[n];
- if (N->isTargetOpcode() && TII->getImplicitDefs(N->getTargetOpcode()))
- SU->hasImplicitDefs = true;
+ if (N->isTargetOpcode() &&
+ TII->getImplicitDefs(N->getTargetOpcode()) &&
+ CountResults(N) > (unsigned)TII->getNumDefs(N->getTargetOpcode()))
+ SU->hasPhysRegDefs = true;
for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
SDNode *OpN = N->getOperand(i).Val;
OpenPOWER on IntegriCloud