summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ScheduleDAG.cpp
diff options
context:
space:
mode:
authorDavid Goodwin <david_goodwin@apple.com>2009-11-03 20:57:50 +0000
committerDavid Goodwin <david_goodwin@apple.com>2009-11-03 20:57:50 +0000
commit4de099d8ca651e00fa5fac22bace4f4dba2d0292 (patch)
tree0a1c30be2310b064e895f5c841350c72773580a9 /lib/CodeGen/ScheduleDAG.cpp
parentabf67ef548c257526d2f5f71521ddc8420784ac1 (diff)
downloadllvm-4de099d8ca651e00fa5fac22bace4f4dba2d0292.tar.gz
llvm-4de099d8ca651e00fa5fac22bace4f4dba2d0292.tar.bz2
llvm-4de099d8ca651e00fa5fac22bace4f4dba2d0292.tar.xz
Do a scheduling pass ignoring anti-dependencies to identify candidate registers that should be renamed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ScheduleDAG.cpp')
-rw-r--r--lib/CodeGen/ScheduleDAG.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/CodeGen/ScheduleDAG.cpp b/lib/CodeGen/ScheduleDAG.cpp
index 5a59862090..1363a92fed 100644
--- a/lib/CodeGen/ScheduleDAG.cpp
+++ b/lib/CodeGen/ScheduleDAG.cpp
@@ -183,8 +183,8 @@ void SUnit::setHeightDirty() {
/// setDepthToAtLeast - Update this node's successors to reflect the
/// fact that this node's depth just increased.
///
-void SUnit::setDepthToAtLeast(unsigned NewDepth) {
- if (NewDepth <= getDepth())
+void SUnit::setDepthToAtLeast(unsigned NewDepth, bool IgnoreAntiDep) {
+ if (NewDepth <= getDepth(IgnoreAntiDep))
return;
setDepthDirty();
Depth = NewDepth;
@@ -194,8 +194,8 @@ void SUnit::setDepthToAtLeast(unsigned NewDepth) {
/// setHeightToAtLeast - Update this node's predecessors to reflect the
/// fact that this node's height just increased.
///
-void SUnit::setHeightToAtLeast(unsigned NewHeight) {
- if (NewHeight <= getHeight())
+void SUnit::setHeightToAtLeast(unsigned NewHeight, bool IgnoreAntiDep) {
+ if (NewHeight <= getHeight(IgnoreAntiDep))
return;
setHeightDirty();
Height = NewHeight;
@@ -204,7 +204,7 @@ void SUnit::setHeightToAtLeast(unsigned NewHeight) {
/// ComputeDepth - Calculate the maximal path from the node to the exit.
///
-void SUnit::ComputeDepth() {
+void SUnit::ComputeDepth(bool IgnoreAntiDep) {
SmallVector<SUnit*, 8> WorkList;
WorkList.push_back(this);
do {
@@ -214,6 +214,7 @@ void SUnit::ComputeDepth() {
unsigned MaxPredDepth = 0;
for (SUnit::const_pred_iterator I = Cur->Preds.begin(),
E = Cur->Preds.end(); I != E; ++I) {
+ if (IgnoreAntiDep && (I->getKind() == SDep::Anti)) continue;
SUnit *PredSU = I->getSUnit();
if (PredSU->isDepthCurrent)
MaxPredDepth = std::max(MaxPredDepth,
@@ -237,7 +238,7 @@ void SUnit::ComputeDepth() {
/// ComputeHeight - Calculate the maximal path from the node to the entry.
///
-void SUnit::ComputeHeight() {
+void SUnit::ComputeHeight(bool IgnoreAntiDep) {
SmallVector<SUnit*, 8> WorkList;
WorkList.push_back(this);
do {
@@ -247,6 +248,7 @@ void SUnit::ComputeHeight() {
unsigned MaxSuccHeight = 0;
for (SUnit::const_succ_iterator I = Cur->Succs.begin(),
E = Cur->Succs.end(); I != E; ++I) {
+ if (IgnoreAntiDep && (I->getKind() == SDep::Anti)) continue;
SUnit *SuccSU = I->getSUnit();
if (SuccSU->isHeightCurrent)
MaxSuccHeight = std::max(MaxSuccHeight,
@@ -346,7 +348,7 @@ void ScheduleDAG::VerifySchedule(bool isBottomUp) {
AnyNotSched = true;
}
if (SUnits[i].isScheduled &&
- (isBottomUp ? SUnits[i].getHeight() : SUnits[i].getHeight()) >
+ (isBottomUp ? SUnits[i].getHeight() : SUnits[i].getDepth()) >
unsigned(INT_MAX)) {
if (!AnyNotSched)
errs() << "*** Scheduling failed! ***\n";