[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Evan Cheng
evan.cheng at apple.com
Mon Jan 8 15:56:08 PST 2007
Changes in directory llvm/lib/CodeGen/SelectionDAG:
ScheduleDAGRRList.cpp updated: 1.24 -> 1.25
---
Log message:
Naming consistency.
---
Diffs of the changes: (+27 -25)
ScheduleDAGRRList.cpp | 52 +++++++++++++++++++++++++-------------------------
1 files changed, 27 insertions(+), 25 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.24 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.25
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.24 Mon Jan 8 17:50:38 2007
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Jan 8 17:55:53 2007
@@ -434,7 +434,7 @@
std::vector<SUnit> &sunits) {}
virtual void releaseState() {}
- virtual unsigned getSethiUllmanNumber(const SUnit *SU) const {
+ virtual unsigned getNodePriority(const SUnit *SU) const {
return 0;
}
@@ -484,7 +484,7 @@
// Add pseudo dependency edges for two-address nodes.
AddPseudoTwoAddrDeps();
// Calculate node priorities.
- CalculatePriorities();
+ CalculateSethiUllmanNumbers();
}
void releaseState() {
@@ -492,7 +492,7 @@
SethiUllmanNumbers.clear();
}
- unsigned getSethiUllmanNumber(const SUnit *SU) const {
+ unsigned getNodePriority(const SUnit *SU) const {
assert(SU->NodeNum < SethiUllmanNumbers.size());
unsigned Opc = SU->Node->getOpcode();
if (Opc == ISD::CopyFromReg && !isCopyFromLiveIn(SU))
@@ -533,8 +533,8 @@
private:
bool canClobber(SUnit *SU, SUnit *Op);
void AddPseudoTwoAddrDeps();
- void CalculatePriorities();
- unsigned CalcNodePriority(const SUnit *SU);
+ void CalculateSethiUllmanNumbers();
+ unsigned CalcNodeSethiUllmanNumber(const SUnit *SU);
};
@@ -557,7 +557,7 @@
SUnitMap = &sumap;
SUnits = &sunits;
// Calculate node priorities.
- CalculatePriorities();
+ CalculateSethiUllmanNumbers();
}
void releaseState() {
@@ -565,14 +565,14 @@
SethiUllmanNumbers.clear();
}
- unsigned getSethiUllmanNumber(const SUnit *SU) const {
+ unsigned getNodePriority(const SUnit *SU) const {
assert(SU->NodeNum < SethiUllmanNumbers.size());
return SethiUllmanNumbers[SU->NodeNum];
}
private:
- void CalculatePriorities();
- unsigned CalcNodePriority(const SUnit *SU);
+ void CalculateSethiUllmanNumbers();
+ unsigned CalcNodeSethiUllmanNumber(const SUnit *SU);
};
}
@@ -580,8 +580,6 @@
bool bu_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const {
bool LIsTarget = left->Node->isTargetOpcode();
bool RIsTarget = right->Node->isTargetOpcode();
- unsigned LPriority = SPQ->getSethiUllmanNumber(left);
- unsigned RPriority = SPQ->getSethiUllmanNumber(right);
// Special tie breaker: if two nodes share a operand, the one that use it
// as a def&use operand is preferred.
@@ -594,6 +592,8 @@
return true;
}
+ unsigned LPriority = SPQ->getNodePriority(left);
+ unsigned RPriority = SPQ->getNodePriority(right);
if (LPriority > RPriority)
return true;
else if (LPriority == RPriority)
@@ -693,10 +693,10 @@
}
}
-/// CalcNodePriority - Priority is the Sethi Ullman number.
+/// CalcNodeSethiUllmanNumber - Priority is the Sethi Ullman number.
/// Smaller number is the higher priority.
template<class SF>
-unsigned BURegReductionPriorityQueue<SF>::CalcNodePriority(const SUnit *SU) {
+unsigned BURegReductionPriorityQueue<SF>::CalcNodeSethiUllmanNumber(const SUnit *SU) {
unsigned &SethiUllmanNumber = SethiUllmanNumbers[SU->NodeNum];
if (SethiUllmanNumber != 0)
return SethiUllmanNumber;
@@ -706,7 +706,7 @@
I != E; ++I) {
if (I->second) continue; // ignore chain preds
SUnit *PredSU = I->first;
- unsigned PredSethiUllman = CalcNodePriority(PredSU);
+ unsigned PredSethiUllman = CalcNodeSethiUllmanNumber(PredSU);
if (PredSethiUllman > SethiUllmanNumber) {
SethiUllmanNumber = PredSethiUllman;
Extra = 0;
@@ -722,13 +722,14 @@
return SethiUllmanNumber;
}
-/// CalculatePriorities - Calculate priorities of all scheduling units.
+/// CalculateSethiUllmanNumbers - Calculate Sethi-Ullman numbers of all
+/// scheduling units.
template<class SF>
-void BURegReductionPriorityQueue<SF>::CalculatePriorities() {
+void BURegReductionPriorityQueue<SF>::CalculateSethiUllmanNumbers() {
SethiUllmanNumbers.assign(SUnits->size(), 0);
for (unsigned i = 0, e = SUnits->size(); i != e; ++i)
- CalcNodePriority(&(*SUnits)[i]);
+ CalcNodeSethiUllmanNumber(&(*SUnits)[i]);
}
static unsigned SumOfUnscheduledPredsOfSuccs(const SUnit *SU) {
@@ -750,8 +751,8 @@
// Top down
bool td_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const {
- unsigned LPriority = SPQ->getSethiUllmanNumber(left);
- unsigned RPriority = SPQ->getSethiUllmanNumber(right);
+ unsigned LPriority = SPQ->getNodePriority(left);
+ unsigned RPriority = SPQ->getNodePriority(right);
bool LIsTarget = left->Node->isTargetOpcode();
bool RIsTarget = right->Node->isTargetOpcode();
bool LIsFloater = LIsTarget && left->NumPreds == 0;
@@ -801,10 +802,10 @@
return false;
}
-/// CalcNodePriority - Priority is the Sethi Ullman number.
+/// CalcNodeSethiUllmanNumber - Priority is the Sethi Ullman number.
/// Smaller number is the higher priority.
template<class SF>
-unsigned TDRegReductionPriorityQueue<SF>::CalcNodePriority(const SUnit *SU) {
+unsigned TDRegReductionPriorityQueue<SF>::CalcNodeSethiUllmanNumber(const SUnit *SU) {
unsigned &SethiUllmanNumber = SethiUllmanNumbers[SU->NodeNum];
if (SethiUllmanNumber != 0)
return SethiUllmanNumber;
@@ -827,7 +828,7 @@
I != E; ++I) {
if (I->second) continue; // ignore chain preds
SUnit *PredSU = I->first;
- unsigned PredSethiUllman = CalcNodePriority(PredSU);
+ unsigned PredSethiUllman = CalcNodeSethiUllmanNumber(PredSU);
if (PredSethiUllman > SethiUllmanNumber) {
SethiUllmanNumber = PredSethiUllman;
Extra = 0;
@@ -841,13 +842,14 @@
return SethiUllmanNumber;
}
-/// CalculatePriorities - Calculate priorities of all scheduling units.
+/// CalculateSethiUllmanNumbers - Calculate Sethi-Ullman numbers of all
+/// scheduling units.
template<class SF>
-void TDRegReductionPriorityQueue<SF>::CalculatePriorities() {
+void TDRegReductionPriorityQueue<SF>::CalculateSethiUllmanNumbers() {
SethiUllmanNumbers.assign(SUnits->size(), 0);
for (unsigned i = 0, e = SUnits->size(); i != e; ++i)
- CalcNodePriority(&(*SUnits)[i]);
+ CalcNodeSethiUllmanNumber(&(*SUnits)[i]);
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list