aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PostRASchedulerList.cpp
diff options
context:
space:
mode:
authorDavid Goodwin <david_goodwin@apple.com>2009-10-26 22:31:16 +0000
committerDavid Goodwin <david_goodwin@apple.com>2009-10-26 22:31:16 +0000
commite056d1077ef9888dd7b294672cf14057152dcc84 (patch)
tree3be50d27f684125983022149c3f24d96832ee60e /llvm/lib/CodeGen/PostRASchedulerList.cpp
parent34e38afa962383a9551fae2a2555c299da44fdce (diff)
downloadllvm-e056d1077ef9888dd7b294672cf14057152dcc84.zip
llvm-e056d1077ef9888dd7b294672cf14057152dcc84.tar.gz
llvm-e056d1077ef9888dd7b294672cf14057152dcc84.tar.bz2
Allow the aggressive anti-dep breaker to process the same region multiple times. This is necessary because new anti-dependencies are exposed when "current" ones are broken.
llvm-svn: 85166
Diffstat (limited to 'llvm/lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r--llvm/lib/CodeGen/PostRASchedulerList.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp
index 8fe2087..c3cae8a 100644
--- a/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -40,6 +40,7 @@
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtarget.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
@@ -315,16 +316,20 @@ void SchedulePostRATDList::StartBlock(MachineBasicBlock *BB) {
/// Schedule - Schedule the instruction range using list scheduling.
///
void SchedulePostRATDList::Schedule() {
- DEBUG(errs() << "********** List Scheduling **********\n");
-
// Build the scheduling graph.
BuildSchedGraph(AA);
if (AntiDepBreak != NULL) {
- unsigned Broken =
- AntiDepBreak->BreakAntiDependencies(SUnits, Begin, InsertPos,
- InsertPosIndex);
- if (Broken > 0) {
+ for (unsigned i = 0, Trials = AntiDepBreak->GetMaxTrials();
+ i < Trials; ++i) {
+ DEBUG(errs() << "********** Break Anti-Deps, Trial " <<
+ i << " **********\n");
+ unsigned Broken =
+ AntiDepBreak->BreakAntiDependencies(SUnits, Begin, InsertPos,
+ InsertPosIndex);
+ if (Broken == 0)
+ break;
+
// We made changes. Update the dependency graph.
// Theoretically we could update the graph in place:
// When a live range is changed to use a different register, remove
@@ -340,6 +345,8 @@ void SchedulePostRATDList::Schedule() {
}
}
+ DEBUG(errs() << "********** List Scheduling **********\n");
+
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
SUnits[su].dumpAll(this));