aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-03 19:37:34 +0000
committerDan Gohman <gohman@apple.com>2008-12-03 19:37:34 +0000
commite561751e98b63908c6a3a68ed5dbc0703f3369b9 (patch)
treeb679dbf56370bf6951ec1d76a23af82563bef908 /lib/CodeGen
parentf94a3273617e7f28518e871516a24ddc272bb1e8 (diff)
downloadexternal_llvm-e561751e98b63908c6a3a68ed5dbc0703f3369b9.tar.gz
external_llvm-e561751e98b63908c6a3a68ed5dbc0703f3369b9.tar.bz2
external_llvm-e561751e98b63908c6a3a68ed5dbc0703f3369b9.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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/PostRASchedulerList.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp
index 73caea96b2..f3aef575f0 100644
--- a/lib/CodeGen/PostRASchedulerList.cpp
+++ b/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;
}
}