diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-08-01 19:14:14 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-08-01 19:14:14 +0000 |
commit | 9373beba6010dd34316a801c3a9b37ab9e048031 (patch) | |
tree | f6d992f9dbc3f4227a2b902c35cf4d9cd2eeed8e /lib | |
parent | 1ed3af11b55becb26a3485494409084a668a9232 (diff) | |
download | external_llvm-9373beba6010dd34316a801c3a9b37ab9e048031.zip external_llvm-9373beba6010dd34316a801c3a9b37ab9e048031.tar.gz external_llvm-9373beba6010dd34316a801c3a9b37ab9e048031.tar.bz2 |
Now that the ISel is available, it's possible to create a default instruction
scheduler creator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 84daabb..3a1af95 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -68,7 +68,8 @@ namespace { cl::desc("Instruction schedulers available:")); static RegisterScheduler - defaultListDAGScheduler("default", " Best scheduler for the target", NULL); + defaultListDAGScheduler("default", " Best scheduler for the target", + createDefaultScheduler); } // namespace namespace { @@ -124,6 +125,24 @@ namespace { namespace llvm { //===--------------------------------------------------------------------===// + /// createDefaultScheduler - This creates an instruction scheduler appropriate + /// for the target. + ScheduleDAG* createDefaultScheduler(SelectionDAGISel *IS, + SelectionDAG *DAG, + MachineBasicBlock *BB) { + TargetLowering &TLI = IS->getTargetLowering(); + + if (TLI.getSchedulingPreference() == TargetLowering::SchedulingForLatency) { + return createTDListDAGScheduler(IS, DAG, BB); + } else { + assert(TLI.getSchedulingPreference() == + TargetLowering::SchedulingForRegPressure && "Unknown sched type!"); + return createBURRListDAGScheduler(IS, DAG, BB); + } + } + + + //===--------------------------------------------------------------------===// /// FunctionLoweringInfo - This contains information that is global to a /// function that is used when lowering a region of the function. class FunctionLoweringInfo { @@ -3614,22 +3633,8 @@ void SelectionDAGISel::ScheduleAndEmitDAG(SelectionDAG &DAG) { RegisterScheduler::getDefault(); if (!Ctor) { - if (std::string("default") == std::string(ISHeuristic)) { - if (TLI.getSchedulingPreference() == TargetLowering::SchedulingForLatency) - Ctor = RegisterScheduler::FindCtor("list-td"); - else { - assert(TLI.getSchedulingPreference() == - TargetLowering::SchedulingForRegPressure && "Unknown sched type!"); - Ctor = RegisterScheduler::FindCtor("list-burr"); - } - - assert(Ctor && "Default instruction scheduler not present"); - if (!Ctor) Ctor = RegisterScheduler::FindCtor("none"); - } else { - Ctor = RegisterScheduler::FindCtor(ISHeuristic); - } - - RegisterScheduler::setDefault(Ctor); + Ctor = RegisterScheduler::FindCtor(ISHeuristic); + RegisterScheduler::setDefault(Ctor); } assert(Ctor && "No instruction scheduler found"); |