summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ScheduleDAGEmit.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-09 22:54:47 +0000
committerDan Gohman <gohman@apple.com>2008-12-09 22:54:47 +0000
commit2d170896ee45030a5de0aa150c6629945f367e29 (patch)
tree4a821901cfb637e4532b278062611b2ad7f07e93 /llvm/lib/CodeGen/ScheduleDAGEmit.cpp
parent0318b56f0ea438611d211a98319347ddc5c0d82d (diff)
downloadbcm5719-llvm-2d170896ee45030a5de0aa150c6629945f367e29.tar.gz
bcm5719-llvm-2d170896ee45030a5de0aa150c6629945f367e29.zip
Rewrite the SDep class, and simplify some of the related code.
The Cost field is removed. It was only being used in a very limited way, to indicate when the scheduler should attempt to protect a live register, and it isn't really needed to do that. If we ever want the scheduler to start inserting copies in non-prohibitive situations, we'll have to rethink some things anyway. A Latency field is added. Instead of giving each node a single fixed latency, each edge can have its own latency. This will eventually be used to model various micro-architecture properties more accurately. The PointerIntPair class and an internal union are now used, which reduce the overall size. llvm-svn: 60806
Diffstat (limited to 'llvm/lib/CodeGen/ScheduleDAGEmit.cpp')
-rw-r--r--llvm/lib/CodeGen/ScheduleDAGEmit.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGEmit.cpp b/llvm/lib/CodeGen/ScheduleDAGEmit.cpp
index ce3283dc3df..d10d670d346 100644
--- a/llvm/lib/CodeGen/ScheduleDAGEmit.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGEmit.cpp
@@ -40,31 +40,31 @@ void ScheduleDAG::EmitCrossRCCopy(SUnit *SU,
DenseMap<SUnit*, unsigned> &VRBaseMap) {
for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
I != E; ++I) {
- if (I->isCtrl) continue; // ignore chain preds
- if (I->Dep->CopyDstRC) {
+ if (I->isCtrl()) continue; // ignore chain preds
+ if (I->getSUnit()->CopyDstRC) {
// Copy to physical register.
- DenseMap<SUnit*, unsigned>::iterator VRI = VRBaseMap.find(I->Dep);
+ DenseMap<SUnit*, unsigned>::iterator VRI = VRBaseMap.find(I->getSUnit());
assert(VRI != VRBaseMap.end() && "Node emitted out of order - late");
// Find the destination physical register.
unsigned Reg = 0;
for (SUnit::const_succ_iterator II = SU->Succs.begin(),
EE = SU->Succs.end(); II != EE; ++II) {
- if (I->Reg) {
- Reg = I->Reg;
+ if (I->getReg()) {
+ Reg = I->getReg();
break;
}
}
- assert(I->Reg && "Unknown physical register!");
+ assert(I->getReg() && "Unknown physical register!");
TII->copyRegToReg(*BB, BB->end(), Reg, VRI->second,
SU->CopyDstRC, SU->CopySrcRC);
} else {
// Copy from physical register.
- assert(I->Reg && "Unknown physical register!");
+ assert(I->getReg() && "Unknown physical register!");
unsigned VRBase = MRI.createVirtualRegister(SU->CopyDstRC);
bool isNew = VRBaseMap.insert(std::make_pair(SU, VRBase)).second;
isNew = isNew; // Silence compiler warning.
assert(isNew && "Node emitted out of order - early");
- TII->copyRegToReg(*BB, BB->end(), VRBase, I->Reg,
+ TII->copyRegToReg(*BB, BB->end(), VRBase, I->getReg(),
SU->CopyDstRC, SU->CopySrcRC);
}
break;
OpenPOWER on IntegriCloud