aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PostRASchedulerList.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-03-05 15:45:23 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-03-05 15:45:23 +0000
commit5c61d11a6daa4e5209bf414e28940b26a42b0e9f (patch)
tree48bf3b1c2f8d5c6410b00d67e12dbb083c20344d /llvm/lib/CodeGen/PostRASchedulerList.cpp
parent7f6d50b229cf67ee186c057a5aa89a6bd4dbbfc1 (diff)
downloadllvm-5c61d11a6daa4e5209bf414e28940b26a42b0e9f.zip
llvm-5c61d11a6daa4e5209bf414e28940b26a42b0e9f.tar.gz
llvm-5c61d11a6daa4e5209bf414e28940b26a42b0e9f.tar.bz2
Add DAG mutation interface to the post-RA scheduler
Differential Revision: http://reviews.llvm.org/D17868 llvm-svn: 262774
Diffstat (limited to 'llvm/lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r--llvm/lib/CodeGen/PostRASchedulerList.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp
index 06a88bf..4266dec 100644
--- a/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -128,6 +128,9 @@ namespace {
/// The schedule. Null SUnit*'s represent noop instructions.
std::vector<SUnit*> Sequence;
+ /// Ordered list of DAG postprocessing steps.
+ std::vector<std::unique_ptr<ScheduleDAGMutation>> Mutations;
+
/// The index in BB of RegionEnd.
///
/// This is the instruction number from the top of the current block, not
@@ -176,6 +179,9 @@ namespace {
void finishBlock() override;
private:
+ /// Apply each ScheduleDAGMutation step in order.
+ void postprocessDAG();
+
void ReleaseSucc(SUnit *SU, SDep *SuccEdge);
void ReleaseSuccessors(SUnit *SU);
void ScheduleNodeTopDown(SUnit *SU, unsigned CurCycle);
@@ -203,6 +209,7 @@ SchedulePostRATDList::SchedulePostRATDList(
HazardRec =
MF.getSubtarget().getInstrInfo()->CreateTargetPostRAHazardRecognizer(
InstrItins, this);
+ MF.getSubtarget().getPostRAMutations(Mutations);
assert((AntiDepMode == TargetSubtargetInfo::ANTIDEP_NONE ||
MRI.tracksLiveness()) &&
@@ -429,6 +436,12 @@ void SchedulePostRATDList::finishBlock() {
ScheduleDAGInstrs::finishBlock();
}
+/// Apply each ScheduleDAGMutation step in order.
+void SchedulePostRATDList::postprocessDAG() {
+ for (auto &M : Mutations)
+ M->apply(this);
+}
+
//===----------------------------------------------------------------------===//
// Top-Down Scheduling
//===----------------------------------------------------------------------===//