[llvm-commits] [llvm] r59782 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/ScheduleDAG.cpp lib/CodeGen/ScheduleDAGPrinter.cpp lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Dan Gohman
gohman at apple.com
Thu Nov 20 18:18:57 PST 2008
Author: djg
Date: Thu Nov 20 20:18:56 2008
New Revision: 59782
URL: http://llvm.org/viewvc/llvm-project?rev=59782&view=rev
Log:
Rename SDep's isSpecial to isArtificial, to make this field a little
less mysterious.
Modified:
llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
llvm/trunk/lib/CodeGen/ScheduleDAG.cpp
llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=59782&r1=59781&r2=59782&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Thu Nov 20 20:18:56 2008
@@ -42,12 +42,14 @@
/// cost of the depdenency, etc.
struct SDep {
SUnit *Dep; // Dependent - either a predecessor or a successor.
- unsigned Reg; // If non-zero, this dep is a phy register dependency.
+ unsigned Reg; // If non-zero, this dep is a physreg dependency.
int Cost; // Cost of the dependency.
bool isCtrl : 1; // True iff it's a control dependency.
- bool isSpecial : 1; // True iff it's a special ctrl dep added during sched.
- SDep(SUnit *d, unsigned r, int t, bool c, bool s)
- : Dep(d), Reg(r), Cost(t), isCtrl(c), isSpecial(s) {}
+ bool isArtificial : 1; // True iff it's an artificial ctrl dep added
+ // during sched that may be safely deleted if
+ // necessary.
+ SDep(SUnit *d, unsigned r, int t, bool c, bool a)
+ : Dep(d), Reg(r), Cost(t), isCtrl(c), isArtificial(a) {}
};
/// SUnit - Scheduling unit. This is a node in the scheduling DAG.
@@ -139,14 +141,14 @@
/// addPred - This adds the specified node as a pred of the current node if
/// not already. This returns true if this is a new pred.
- bool addPred(SUnit *N, bool isCtrl, bool isSpecial,
+ bool addPred(SUnit *N, bool isCtrl, bool isArtificial,
unsigned PhyReg = 0, int Cost = 1) {
for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i)
if (Preds[i].Dep == N &&
- Preds[i].isCtrl == isCtrl && Preds[i].isSpecial == isSpecial)
+ Preds[i].isCtrl == isCtrl && Preds[i].isArtificial == isArtificial)
return false;
- Preds.push_back(SDep(N, PhyReg, Cost, isCtrl, isSpecial));
- N->Succs.push_back(SDep(this, PhyReg, Cost, isCtrl, isSpecial));
+ Preds.push_back(SDep(N, PhyReg, Cost, isCtrl, isArtificial));
+ N->Succs.push_back(SDep(this, PhyReg, Cost, isCtrl, isArtificial));
if (!isCtrl) {
++NumPreds;
++N->NumSuccs;
@@ -158,15 +160,15 @@
return true;
}
- bool removePred(SUnit *N, bool isCtrl, bool isSpecial) {
+ bool removePred(SUnit *N, bool isCtrl, bool isArtificial) {
for (SmallVector<SDep, 4>::iterator I = Preds.begin(), E = Preds.end();
I != E; ++I)
- if (I->Dep == N && I->isCtrl == isCtrl && I->isSpecial == isSpecial) {
+ if (I->Dep == N && I->isCtrl == isCtrl && I->isArtificial == isArtificial) {
bool FoundSucc = false;
for (SmallVector<SDep, 4>::iterator II = N->Succs.begin(),
EE = N->Succs.end(); II != EE; ++II)
if (II->Dep == this &&
- II->isCtrl == isCtrl && II->isSpecial == isSpecial) {
+ II->isCtrl == isCtrl && II->isArtificial == isArtificial) {
FoundSucc = true;
N->Succs.erase(II);
break;
@@ -373,7 +375,7 @@
unsigned getOperand() const { return Operand; }
const SUnit *getNode() const { return Node; }
bool isCtrlDep() const { return Node->Preds[Operand].isCtrl; }
- bool isSpecialDep() const { return Node->Preds[Operand].isSpecial; }
+ bool isArtificialDep() const { return Node->Preds[Operand].isArtificial; }
};
template <> struct GraphTraits<SUnit*> {
Modified: llvm/trunk/lib/CodeGen/ScheduleDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAG.cpp?rev=59782&r1=59781&r2=59782&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScheduleDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScheduleDAG.cpp Thu Nov 20 20:18:56 2008
@@ -188,7 +188,7 @@
else
cerr << " val #";
cerr << I->Dep << " - SU(" << I->Dep->NodeNum << ")";
- if (I->isSpecial)
+ if (I->isArtificial)
cerr << " *";
cerr << "\n";
}
@@ -202,7 +202,7 @@
else
cerr << " val #";
cerr << I->Dep << " - SU(" << I->Dep->NodeNum << ")";
- if (I->isSpecial)
+ if (I->isArtificial)
cerr << " *";
cerr << "\n";
}
Modified: llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp?rev=59782&r1=59781&r2=59782&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScheduleDAGPrinter.cpp Thu Nov 20 20:18:56 2008
@@ -50,7 +50,7 @@
/// edge, override this method.
template<typename EdgeIter>
static std::string getEdgeAttributes(const void *Node, EdgeIter EI) {
- if (EI.isSpecialDep())
+ if (EI.isArtificialDep())
return "color=cyan,style=dashed";
if (EI.isCtrlDep())
return "color=blue,style=dashed";
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp?rev=59782&r1=59781&r2=59782&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp Thu Nov 20 20:18:56 2008
@@ -80,12 +80,12 @@
/// AddPred - This adds the specified node X as a predecessor of
/// the current node Y if not already.
/// This returns true if this is a new predecessor.
- bool AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isSpecial,
+ bool AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isArtificial,
unsigned PhyReg = 0, int Cost = 1);
/// RemovePred - This removes the specified node N from the predecessors of
/// the current node M.
- bool RemovePred(SUnit *M, SUnit *N, bool isCtrl, bool isSpecial);
+ bool RemovePred(SUnit *M, SUnit *N, bool isCtrl, bool isArtificial);
private:
void ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain);
@@ -189,16 +189,16 @@
}
/// AddPred - adds an edge from SUnit X to SUnit Y.
-bool ScheduleDAGFast::AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isSpecial,
- unsigned PhyReg, int Cost) {
- return Y->addPred(X, isCtrl, isSpecial, PhyReg, Cost);
+bool ScheduleDAGFast::AddPred(SUnit *Y, SUnit *X, bool isCtrl,
+ bool isArtificial, unsigned PhyReg, int Cost) {
+ return Y->addPred(X, isCtrl, isArtificial, PhyReg, Cost);
}
/// RemovePred - This removes the specified node N from the predecessors of
/// the current node M.
bool ScheduleDAGFast::RemovePred(SUnit *M, SUnit *N,
- bool isCtrl, bool isSpecial) {
- return M->removePred(N, isCtrl, isSpecial);
+ bool isCtrl, bool isArtificial) {
+ return M->removePred(N, isCtrl, isArtificial);
}
/// CopyAndMoveSuccessors - Clone the specified node and move its scheduled
@@ -295,10 +295,10 @@
I != E; ++I) {
if (I->isCtrl)
ChainSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
- I->isCtrl, I->isSpecial));
+ I->isCtrl, I->isArtificial));
else
NodeSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
- I->isCtrl, I->isSpecial));
+ I->isCtrl, I->isArtificial));
}
if (ChainPred) {
@@ -308,29 +308,29 @@
}
for (unsigned i = 0, e = LoadPreds.size(); i != e; ++i) {
SDep *Pred = &LoadPreds[i];
- RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isSpecial);
+ RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isArtificial);
if (isNewLoad) {
- AddPred(LoadSU, Pred->Dep, Pred->isCtrl, Pred->isSpecial,
+ AddPred(LoadSU, Pred->Dep, Pred->isCtrl, Pred->isArtificial,
Pred->Reg, Pred->Cost);
}
}
for (unsigned i = 0, e = NodePreds.size(); i != e; ++i) {
SDep *Pred = &NodePreds[i];
- RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isSpecial);
- AddPred(NewSU, Pred->Dep, Pred->isCtrl, Pred->isSpecial,
+ RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isArtificial);
+ AddPred(NewSU, Pred->Dep, Pred->isCtrl, Pred->isArtificial,
Pred->Reg, Pred->Cost);
}
for (unsigned i = 0, e = NodeSuccs.size(); i != e; ++i) {
SDep *Succ = &NodeSuccs[i];
- RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isSpecial);
- AddPred(Succ->Dep, NewSU, Succ->isCtrl, Succ->isSpecial,
+ RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isArtificial);
+ AddPred(Succ->Dep, NewSU, Succ->isCtrl, Succ->isArtificial,
Succ->Reg, Succ->Cost);
}
for (unsigned i = 0, e = ChainSuccs.size(); i != e; ++i) {
SDep *Succ = &ChainSuccs[i];
- RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isSpecial);
+ RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isArtificial);
if (isNewLoad) {
- AddPred(Succ->Dep, LoadSU, Succ->isCtrl, Succ->isSpecial,
+ AddPred(Succ->Dep, LoadSU, Succ->isCtrl, Succ->isArtificial,
Succ->Reg, Succ->Cost);
}
}
@@ -353,7 +353,7 @@
// New SUnit has the exact same predecessors.
for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
I != E; ++I)
- if (!I->isSpecial) {
+ if (!I->isArtificial) {
AddPred(NewSU, I->Dep, I->isCtrl, false, I->Reg, I->Cost);
NewSU->Depth = std::max(NewSU->Depth, I->Dep->Depth+1);
}
@@ -363,7 +363,7 @@
SmallVector<std::pair<SUnit*, bool>, 4> DelDeps;
for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
I != E; ++I) {
- if (I->isSpecial)
+ if (I->isArtificial)
continue;
if (I->Dep->isScheduled) {
NewSU->Height = std::max(NewSU->Height, I->Dep->Height+1);
@@ -400,7 +400,7 @@
SmallVector<std::pair<SUnit*, bool>, 4> DelDeps;
for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
I != E; ++I) {
- if (I->isSpecial)
+ if (I->isArtificial)
continue;
if (I->Dep->isScheduled) {
AddPred(I->Dep, CopyToSU, I->isCtrl, false, I->Reg, I->Cost);
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=59782&r1=59781&r2=59782&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Thu Nov 20 20:18:56 2008
@@ -94,12 +94,12 @@
/// the current node Y if not already.
/// This returns true if this is a new predecessor.
/// Updates the topological ordering if required.
- bool AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isSpecial,
+ bool AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isArtificial,
unsigned PhyReg = 0, int Cost = 1);
/// RemovePred - This removes the specified node N from the predecessors of
/// the current node M. Updates the topological ordering if required.
- bool RemovePred(SUnit *M, SUnit *N, bool isCtrl, bool isSpecial);
+ bool RemovePred(SUnit *M, SUnit *N, bool isCtrl, bool isArtificial);
private:
void ReleasePred(SUnit *SU, SUnit *PredSU, bool isChain);
@@ -482,8 +482,8 @@
/// AddPred - adds an edge from SUnit X to SUnit Y.
/// Updates the topological ordering if required.
-bool ScheduleDAGRRList::AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isSpecial,
- unsigned PhyReg, int Cost) {
+bool ScheduleDAGRRList::AddPred(SUnit *Y, SUnit *X, bool isCtrl,
+ bool isArtificial, unsigned PhyReg, int Cost) {
int UpperBound, LowerBound;
LowerBound = Node2Index[Y->NodeNum];
UpperBound = Node2Index[X->NodeNum];
@@ -498,15 +498,15 @@
Shift(Visited, LowerBound, UpperBound);
}
// Now really insert the edge.
- return Y->addPred(X, isCtrl, isSpecial, PhyReg, Cost);
+ return Y->addPred(X, isCtrl, isArtificial, PhyReg, Cost);
}
/// RemovePred - This removes the specified node N from the predecessors of
/// the current node M. Updates the topological ordering if required.
bool ScheduleDAGRRList::RemovePred(SUnit *M, SUnit *N,
- bool isCtrl, bool isSpecial) {
+ bool isCtrl, bool isArtificial) {
// InitDAGTopologicalSorting();
- return M->removePred(N, isCtrl, isSpecial);
+ return M->removePred(N, isCtrl, isArtificial);
}
/// DFS - Make a DFS traversal to mark all nodes reachable from SU and mark
@@ -696,10 +696,10 @@
I != E; ++I) {
if (I->isCtrl)
ChainSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
- I->isCtrl, I->isSpecial));
+ I->isCtrl, I->isArtificial));
else
NodeSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
- I->isCtrl, I->isSpecial));
+ I->isCtrl, I->isArtificial));
}
if (ChainPred) {
@@ -709,29 +709,29 @@
}
for (unsigned i = 0, e = LoadPreds.size(); i != e; ++i) {
SDep *Pred = &LoadPreds[i];
- RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isSpecial);
+ RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isArtificial);
if (isNewLoad) {
- AddPred(LoadSU, Pred->Dep, Pred->isCtrl, Pred->isSpecial,
+ AddPred(LoadSU, Pred->Dep, Pred->isCtrl, Pred->isArtificial,
Pred->Reg, Pred->Cost);
}
}
for (unsigned i = 0, e = NodePreds.size(); i != e; ++i) {
SDep *Pred = &NodePreds[i];
- RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isSpecial);
- AddPred(NewSU, Pred->Dep, Pred->isCtrl, Pred->isSpecial,
+ RemovePred(SU, Pred->Dep, Pred->isCtrl, Pred->isArtificial);
+ AddPred(NewSU, Pred->Dep, Pred->isCtrl, Pred->isArtificial,
Pred->Reg, Pred->Cost);
}
for (unsigned i = 0, e = NodeSuccs.size(); i != e; ++i) {
SDep *Succ = &NodeSuccs[i];
- RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isSpecial);
- AddPred(Succ->Dep, NewSU, Succ->isCtrl, Succ->isSpecial,
+ RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isArtificial);
+ AddPred(Succ->Dep, NewSU, Succ->isCtrl, Succ->isArtificial,
Succ->Reg, Succ->Cost);
}
for (unsigned i = 0, e = ChainSuccs.size(); i != e; ++i) {
SDep *Succ = &ChainSuccs[i];
- RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isSpecial);
+ RemovePred(Succ->Dep, SU, Succ->isCtrl, Succ->isArtificial);
if (isNewLoad) {
- AddPred(Succ->Dep, LoadSU, Succ->isCtrl, Succ->isSpecial,
+ AddPred(Succ->Dep, LoadSU, Succ->isCtrl, Succ->isArtificial,
Succ->Reg, Succ->Cost);
}
}
@@ -758,7 +758,7 @@
// New SUnit has the exact same predecessors.
for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end();
I != E; ++I)
- if (!I->isSpecial) {
+ if (!I->isArtificial) {
AddPred(NewSU, I->Dep, I->isCtrl, false, I->Reg, I->Cost);
NewSU->Depth = std::max(NewSU->Depth, I->Dep->Depth+1);
}
@@ -768,7 +768,7 @@
SmallVector<std::pair<SUnit*, bool>, 4> DelDeps;
for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
I != E; ++I) {
- if (I->isSpecial)
+ if (I->isArtificial)
continue;
if (I->Dep->isScheduled) {
NewSU->Height = std::max(NewSU->Height, I->Dep->Height+1);
@@ -810,7 +810,7 @@
SmallVector<std::pair<SUnit*, bool>, 4> DelDeps;
for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
I != E; ++I) {
- if (I->isSpecial)
+ if (I->isArtificial)
continue;
if (I->Dep->isScheduled) {
CopyToSU->Height = std::max(CopyToSU->Height, I->Dep->Height+1);
More information about the llvm-commits
mailing list