summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/DFAPacketizer.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-03-08 15:33:51 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2016-03-08 15:33:51 +0000
commit1a1d78b86f74d1ef094cde2caf9284730d62665b (patch)
tree070c645c6ea6a3f1a39822fc8ec7ce8024c52e39 /llvm/lib/CodeGen/DFAPacketizer.cpp
parent999ac754f2477ef19998ec6bf947dfa228a84147 (diff)
downloadbcm5719-llvm-1a1d78b86f74d1ef094cde2caf9284730d62665b.tar.gz
bcm5719-llvm-1a1d78b86f74d1ef094cde2caf9284730d62665b.zip
Add DAG mutation interface to the DFA packetizer
llvm-svn: 262930
Diffstat (limited to 'llvm/lib/CodeGen/DFAPacketizer.cpp')
-rw-r--r--llvm/lib/CodeGen/DFAPacketizer.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/DFAPacketizer.cpp b/llvm/lib/CodeGen/DFAPacketizer.cpp
index a4ed61b98ce..205ebf80c59 100644
--- a/llvm/lib/CodeGen/DFAPacketizer.cpp
+++ b/llvm/lib/CodeGen/DFAPacketizer.cpp
@@ -155,11 +155,20 @@ namespace llvm {
class DefaultVLIWScheduler : public ScheduleDAGInstrs {
private:
AliasAnalysis *AA;
+ /// Ordered list of DAG postprocessing steps.
+ std::vector<std::unique_ptr<ScheduleDAGMutation>> Mutations;
public:
DefaultVLIWScheduler(MachineFunction &MF, MachineLoopInfo &MLI,
AliasAnalysis *AA);
// Actual scheduling work.
void schedule() override;
+
+ /// DefaultVLIWScheduler takes ownership of the Mutation object.
+ void addMutation(std::unique_ptr<ScheduleDAGMutation> Mutation) {
+ Mutations.push_back(std::move(Mutation));
+ }
+protected:
+ void postprocessDAG();
};
}
@@ -172,9 +181,17 @@ DefaultVLIWScheduler::DefaultVLIWScheduler(MachineFunction &MF,
}
+/// Apply each ScheduleDAGMutation step in order.
+void DefaultVLIWScheduler::postprocessDAG() {
+ for (auto &M : Mutations)
+ M->apply(this);
+}
+
+
void DefaultVLIWScheduler::schedule() {
// Build the scheduling graph.
buildSchedGraph(AA);
+ postprocessDAG();
}
@@ -272,3 +289,10 @@ void VLIWPacketizerList::PacketizeMIs(MachineBasicBlock *MBB,
VLIWScheduler->exitRegion();
VLIWScheduler->finishBlock();
}
+
+
+// Add a DAG mutation object to the ordered list.
+void VLIWPacketizerList::addMutation(
+ std::unique_ptr<ScheduleDAGMutation> Mutation) {
+ VLIWScheduler->addMutation(std::move(Mutation));
+}
OpenPOWER on IntegriCloud