diff options
author | Dan Gohman <gohman@apple.com> | 2009-01-15 19:20:50 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-01-15 19:20:50 +0000 |
commit | 79ce276083ced01256a0eb7d80731e4948ca6e87 (patch) | |
tree | b8ca5d82fd79edad2fa840c1cfdd039e08ca4466 /lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp | |
parent | 6ad2b2a3d20c667e01535fed4bc7f4753aa6fc85 (diff) |
Move a few containers out of ScheduleDAGInstrs::BuildSchedGraph
and into the ScheduleDAGInstrs class, so that they don't get
destructed and re-constructed for each block. This fixes a
compile-time hot spot in the post-pass scheduler.
To help facilitate this, tidy and do some minor reorganization
in the scheduler constructor functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62275 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp index 6f0767aa10..2e2cac4121 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp @@ -25,7 +25,6 @@ #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" @@ -62,11 +61,10 @@ private: HazardRecognizer *HazardRec; public: - ScheduleDAGList(SelectionDAG *dag, MachineBasicBlock *bb, - const TargetMachine &tm, + ScheduleDAGList(MachineFunction &mf, SchedulingPriorityQueue *availqueue, HazardRecognizer *HR) - : ScheduleDAGSDNodes(dag, bb, tm), + : ScheduleDAGSDNodes(mf), AvailableQueue(availqueue), HazardRec(HR) { } @@ -268,10 +266,8 @@ void ScheduleDAGList::ListScheduleTopDown() { /// new hazard recognizer. This scheduler takes ownership of the hazard /// recognizer and deletes it when done. ScheduleDAG* llvm::createTDListDAGScheduler(SelectionDAGISel *IS, - SelectionDAG *DAG, - const TargetMachine *TM, - MachineBasicBlock *BB, bool Fast) { - return new ScheduleDAGList(DAG, BB, *TM, + bool Fast) { + return new ScheduleDAGList(*IS->MF, new LatencyPriorityQueue(), IS->CreateTargetHazardRecognizer()); } |