From 4b49be1cbef6944ec913f5289c1c2efaa42e70ee Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Sat, 21 Jun 2008 01:08:22 +0000 Subject: [PATCH] Simplify some template parameterization. llvm-svn: 52571 --- .../SelectionDAG/ScheduleDAGRRList.cpp | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index d2ed4eff44d0..fc20170616ac 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -1324,9 +1324,8 @@ namespace { } }; - template class VISIBILITY_HIDDEN BURegReductionPriorityQueue - : public RegReductionPriorityQueue { + : public RegReductionPriorityQueue { // SUnitMap SDNode to SUnit mapping (n -> n). DenseMap > *SUnitMap; @@ -1412,9 +1411,8 @@ namespace { }; - template class VISIBILITY_HIDDEN TDRegReductionPriorityQueue - : public RegReductionPriorityQueue { + : public RegReductionPriorityQueue { // SUnitMap SDNode to SUnit mapping (n -> n). DenseMap > *SUnitMap; @@ -1551,8 +1549,8 @@ bool bu_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const { return (left->NodeQueueId > right->NodeQueueId); } -template bool -BURegReductionPriorityQueue::canClobber(const SUnit *SU, const SUnit *Op) { +bool +BURegReductionPriorityQueue::canClobber(const SUnit *SU, const SUnit *Op) { if (SU->isTwoAddress) { unsigned Opc = SU->Node->getTargetOpcode(); const TargetInstrDesc &TID = TII->get(Opc); @@ -1619,8 +1617,7 @@ static bool canClobberPhysRegDefs(SUnit *SuccSU, SUnit *SU, /// one that has a CopyToReg use (more likely to be a loop induction update). /// If both are two-address, but one is commutable while the other is not /// commutable, favor the one that's not commutable. -template -void BURegReductionPriorityQueue::AddPseudoTwoAddrDeps() { +void BURegReductionPriorityQueue::AddPseudoTwoAddrDeps() { for (unsigned i = 0, e = SUnits->size(); i != e; ++i) { SUnit *SU = (SUnit *)&((*SUnits)[i]); if (!SU->isTwoAddress) @@ -1681,8 +1678,7 @@ void BURegReductionPriorityQueue::AddPseudoTwoAddrDeps() { /// CalcNodeSethiUllmanNumber - Priority is the Sethi Ullman number. /// Smaller number is the higher priority. -template -unsigned BURegReductionPriorityQueue:: +unsigned BURegReductionPriorityQueue:: CalcNodeSethiUllmanNumber(const SUnit *SU) { unsigned &SethiUllmanNumber = SethiUllmanNumbers[SU->NodeNum]; if (SethiUllmanNumber != 0) @@ -1711,8 +1707,7 @@ CalcNodeSethiUllmanNumber(const SUnit *SU) { /// CalculateSethiUllmanNumbers - Calculate Sethi-Ullman numbers of all /// scheduling units. -template -void BURegReductionPriorityQueue::CalculateSethiUllmanNumbers() { +void BURegReductionPriorityQueue::CalculateSethiUllmanNumbers() { SethiUllmanNumbers.assign(SUnits->size(), 0); for (unsigned i = 0, e = SUnits->size(); i != e; ++i) @@ -1784,8 +1779,7 @@ bool td_ls_rr_sort::operator()(const SUnit *left, const SUnit *right) const { /// CalcNodeSethiUllmanNumber - Priority is the Sethi Ullman number. /// Smaller number is the higher priority. -template -unsigned TDRegReductionPriorityQueue:: +unsigned TDRegReductionPriorityQueue:: CalcNodeSethiUllmanNumber(const SUnit *SU) { unsigned &SethiUllmanNumber = SethiUllmanNumbers[SU->NodeNum]; if (SethiUllmanNumber != 0) @@ -1825,8 +1819,7 @@ CalcNodeSethiUllmanNumber(const SUnit *SU) { /// CalculateSethiUllmanNumbers - Calculate Sethi-Ullman numbers of all /// scheduling units. -template -void TDRegReductionPriorityQueue::CalculateSethiUllmanNumbers() { +void TDRegReductionPriorityQueue::CalculateSethiUllmanNumbers() { SethiUllmanNumbers.assign(SUnits->size(), 0); for (unsigned i = 0, e = SUnits->size(); i != e; ++i) @@ -1843,8 +1836,8 @@ llvm::ScheduleDAG* llvm::createBURRListDAGScheduler(SelectionDAGISel *IS, const TargetInstrInfo *TII = DAG->getTarget().getInstrInfo(); const TargetRegisterInfo *TRI = DAG->getTarget().getRegisterInfo(); - BURegReductionPriorityQueue *priorityQueue = - new BURegReductionPriorityQueue(TII, TRI); + BURegReductionPriorityQueue *priorityQueue = + new BURegReductionPriorityQueue(TII, TRI); ScheduleDAGRRList * scheduleDAG = new ScheduleDAGRRList(*DAG, BB, DAG->getTarget(), true, priorityQueue); @@ -1856,6 +1849,6 @@ llvm::ScheduleDAG* llvm::createTDRRListDAGScheduler(SelectionDAGISel *IS, SelectionDAG *DAG, MachineBasicBlock *BB) { return new ScheduleDAGRRList(*DAG, BB, DAG->getTarget(), false, - new TDRegReductionPriorityQueue()); + new TDRegReductionPriorityQueue()); }