diff options
author | Dan Gohman <gohman@apple.com> | 2008-12-03 19:37:34 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-12-03 19:37:34 +0000 |
commit | 434a3ca8e919a01b794eed7feb6fd9d147206cbd (patch) | |
tree | 0672697a412b4289a1d12502987f7b05431781b2 /llvm/lib | |
parent | 5d84f685a89014559066f7806b49eb39b96c957e (diff) | |
download | bcm5719-llvm-434a3ca8e919a01b794eed7feb6fd9d147206cbd.tar.gz bcm5719-llvm-434a3ca8e919a01b794eed7feb6fd9d147206cbd.zip |
Don't charge the full latency for anti and output dependencies. This is
an area where eventually it would be good to use target-dependent
information.
llvm-svn: 60498
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/PostRASchedulerList.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp index 73caea96b2e..f3aef575f07 100644 --- a/llvm/lib/CodeGen/PostRASchedulerList.cpp +++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp @@ -160,9 +160,12 @@ bool SchedulePostRATDList::BreakAntiDependencies() { for (SUnit::pred_iterator P = SU->Preds.begin(), PE = SU->Preds.end(); P != PE; ++P) { SUnit *PredSU = P->Dep; - unsigned PredLatency = PredSU->CycleBound + PredSU->Latency; - if (SU->CycleBound < PredLatency) { - SU->CycleBound = PredLatency; + // This assumes that there's no delay for reusing registers. + unsigned PredLatency = (P->isCtrl && P->Reg != 0) ? 1 : PredSU->Latency; + unsigned PredTotalLatency = PredSU->CycleBound + PredLatency; + if (SU->CycleBound < PredTotalLatency || + (SU->CycleBound == PredTotalLatency && !P->isAntiDep)) { + SU->CycleBound = PredTotalLatency; CriticalPath[*I] = &*P; } } |