diff options
| author | Jim Laskey <jlaskey@mac.com> | 2006-08-01 18:29:48 +0000 |
|---|---|---|
| committer | Jim Laskey <jlaskey@mac.com> | 2006-08-01 18:29:48 +0000 |
| commit | 03593f72db599f32d089cc1b4fbce3a80e0027c2 (patch) | |
| tree | 06d7237152fbb37394fbf6103b22532cfedb007a /llvm/lib | |
| parent | b25c49dd0c72e3938504d8cf25410912b879d454 (diff) | |
| download | bcm5719-llvm-03593f72db599f32d089cc1b4fbce3a80e0027c2.tar.gz bcm5719-llvm-03593f72db599f32d089cc1b4fbce3a80e0027c2.zip | |
1. Change use of "Cache" to "Default".
2. Added argument to instruction scheduler creators so the creators can do
special things.
3. Repaired target hazard code.
4. Misc.
More to follow.
llvm-svn: 29450
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/MachinePassRegistry.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/Passes.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp | 9 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 13 |
6 files changed, 31 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/MachinePassRegistry.cpp b/llvm/lib/CodeGen/MachinePassRegistry.cpp index a5f4408f7d7..c4409924760 100644 --- a/llvm/lib/CodeGen/MachinePassRegistry.cpp +++ b/llvm/lib/CodeGen/MachinePassRegistry.cpp @@ -1,4 +1,4 @@ -//===-- MachineInstr.cpp --------------------------------------------------===// +//===-- CodeGen/MachineInstr.cpp ------------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -6,9 +6,13 @@ // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// +// This file contains the machine function pass registry for register allocators +// and instruction schedulers. +// +//===----------------------------------------------------------------------===// #include "llvm/CodeGen/MachinePassRegistry.h" -#include <iostream> using namespace llvm; diff --git a/llvm/lib/CodeGen/Passes.cpp b/llvm/lib/CodeGen/Passes.cpp index 04f390a2f84..a896f83526e 100644 --- a/llvm/lib/CodeGen/Passes.cpp +++ b/llvm/lib/CodeGen/Passes.cpp @@ -27,13 +27,13 @@ namespace { } FunctionPass *llvm::createRegisterAllocator() { - RegisterRegAlloc::FunctionPassCtor Ctor = RegisterRegAlloc::getCache(); + RegisterRegAlloc::FunctionPassCtor Ctor = RegisterRegAlloc::getDefault(); if (!Ctor) { Ctor = RegisterRegAlloc::FindCtor(RegAlloc); assert(Ctor && "No register allocator found"); if (!Ctor) Ctor = RegisterRegAlloc::FirstCtor(); - RegisterRegAlloc::setCache(Ctor); + RegisterRegAlloc::setDefault(Ctor); } assert(Ctor && "No register allocator found"); diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp index 3d249733c63..8b82197b75f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp @@ -21,6 +21,7 @@ #define DEBUG_TYPE "sched" #include "llvm/CodeGen/MachinePassRegistry.h" #include "llvm/CodeGen/ScheduleDAG.h" +#include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/CodeGen/SSARegMap.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetData.h" @@ -519,9 +520,10 @@ void LatencyPriorityQueue::AdjustPriorityOfUnscheduledPreds(SUnit *SU) { /// createTDListDAGScheduler - This creates a top-down list scheduler with a /// new hazard recognizer. This scheduler takes ownership of the hazard /// recognizer and deletes it when done. -ScheduleDAG* llvm::createTDListDAGScheduler(SelectionDAG *DAG, +ScheduleDAG* llvm::createTDListDAGScheduler(SelectionDAGISel *IS, + SelectionDAG *DAG, MachineBasicBlock *BB) { return new ScheduleDAGList(*DAG, BB, DAG->getTarget(), new LatencyPriorityQueue(), - new HazardRecognizer()); + IS->CreateTargetHazardRecognizer()); } diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp index d0e9afc3a3f..6e7ef2e2511 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -886,13 +886,15 @@ void TDRegReductionPriorityQueue<SF>::CalculatePriorities() { // Public Constructor Functions //===----------------------------------------------------------------------===// -llvm::ScheduleDAG* llvm::createBURRListDAGScheduler(SelectionDAG *DAG, +llvm::ScheduleDAG* llvm::createBURRListDAGScheduler(SelectionDAGISel *IS, + SelectionDAG *DAG, MachineBasicBlock *BB) { return new ScheduleDAGRRList(*DAG, BB, DAG->getTarget(), true, new BURegReductionPriorityQueue<bu_ls_rr_sort>()); } -llvm::ScheduleDAG* llvm::createTDRRListDAGScheduler(SelectionDAG *DAG, +llvm::ScheduleDAG* llvm::createTDRRListDAGScheduler(SelectionDAGISel *IS, + SelectionDAG *DAG, MachineBasicBlock *BB) { return new ScheduleDAGRRList(*DAG, BB, DAG->getTarget(), false, new TDRegReductionPriorityQueue<td_ls_rr_sort>()); diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp index 88587ce5d72..2b8a754a061 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp @@ -1120,21 +1120,24 @@ void ScheduleDAGSimple::Schedule() { /// createSimpleDAGScheduler - This creates a simple two pass instruction /// scheduler using instruction itinerary. -llvm::ScheduleDAG* llvm::createSimpleDAGScheduler(SelectionDAG *DAG, +llvm::ScheduleDAG* llvm::createSimpleDAGScheduler(SelectionDAGISel *IS, + SelectionDAG *DAG, MachineBasicBlock *BB) { return new ScheduleDAGSimple(false, false, *DAG, BB, DAG->getTarget()); } /// createNoItinsDAGScheduler - This creates a simple two pass instruction /// scheduler without using instruction itinerary. -llvm::ScheduleDAG* llvm::createNoItinsDAGScheduler(SelectionDAG *DAG, +llvm::ScheduleDAG* llvm::createNoItinsDAGScheduler(SelectionDAGISel *IS, + SelectionDAG *DAG, MachineBasicBlock *BB) { return new ScheduleDAGSimple(false, true, *DAG, BB, DAG->getTarget()); } /// createBFS_DAGScheduler - This creates a simple breadth first instruction /// scheduler. -llvm::ScheduleDAG* llvm::createBFS_DAGScheduler(SelectionDAG *DAG, +llvm::ScheduleDAG* llvm::createBFS_DAGScheduler(SelectionDAGISel *IS, + SelectionDAG *DAG, MachineBasicBlock *BB) { return new ScheduleDAGSimple(true, false, *DAG, BB, DAG->getTarget()); } diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index dd3959b2241..84daabbd635 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -67,7 +67,7 @@ namespace { cl::init("default"), cl::desc("Instruction schedulers available:")); - RegisterScheduler + static RegisterScheduler defaultListDAGScheduler("default", " Best scheduler for the target", NULL); } // namespace @@ -3611,7 +3611,7 @@ void SelectionDAGISel::ScheduleAndEmitDAG(SelectionDAG &DAG) { if (ViewSchedDAGs) DAG.viewGraph(); static RegisterScheduler::FunctionPassCtor Ctor = - RegisterScheduler::getCache(); + RegisterScheduler::getDefault(); if (!Ctor) { if (std::string("default") == std::string(ISHeuristic)) { @@ -3629,16 +3629,21 @@ void SelectionDAGISel::ScheduleAndEmitDAG(SelectionDAG &DAG) { Ctor = RegisterScheduler::FindCtor(ISHeuristic); } - RegisterScheduler::setCache(Ctor); + RegisterScheduler::setDefault(Ctor); } assert(Ctor && "No instruction scheduler found"); - ScheduleDAG *SL = Ctor(&DAG, BB); + ScheduleDAG *SL = Ctor(this, &DAG, BB); BB = SL->Run(); delete SL; } +HazardRecognizer *SelectionDAGISel::CreateTargetHazardRecognizer() { + return new HazardRecognizer(); +} + + /// SelectInlineAsmMemoryOperands - Calls to this are automatically generated /// by tblgen. Others should not call it. void SelectionDAGISel:: |

