summaryrefslogtreecommitdiff
path: root/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
commite10deca33e74a7c70ab585f78eee3fb52937f668 (patch)
tree040756b08ba58b1bd3d181e4fee5cb2d662925ec /lib/CodeGen/PostRASchedulerList.cpp
parent06d4033a354115904e9df23608f9a7cd543d5dbc (diff)
downloadllvm-e10deca33e74a7c70ab585f78eee3fb52937f668.tar.gz
llvm-e10deca33e74a7c70ab585f78eee3fb52937f668.tar.bz2
llvm-e10deca33e74a7c70ab585f78eee3fb52937f668.tar.xz
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r--lib/CodeGen/PostRASchedulerList.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/CodeGen/PostRASchedulerList.cpp b/lib/CodeGen/PostRASchedulerList.cpp
index 8fe20876bc..c3cae8a4be 100644
--- a/lib/CodeGen/PostRASchedulerList.cpp
+++ b/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));