diff --git a/llvm/include/llvm/CodeGen/DFAPacketizer.h b/llvm/include/llvm/CodeGen/DFAPacketizer.h --- a/llvm/include/llvm/CodeGen/DFAPacketizer.h +++ b/llvm/include/llvm/CodeGen/DFAPacketizer.h @@ -26,6 +26,8 @@ #define LLVM_CODEGEN_DFAPACKETIZER_H #include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/ScheduleDAGInstrs.h" +#include "llvm/CodeGen/ScheduleDAGMutation.h" #include "llvm/Support/Automaton.h" #include #include @@ -35,7 +37,6 @@ namespace llvm { -class DefaultVLIWScheduler; class ScheduleDAGMutation; class InstrItineraryData; class MachineFunction; @@ -45,6 +46,30 @@ class SUnit; class TargetInstrInfo; +// This class extends ScheduleDAGInstrs and overrides the schedule method +// to build the dependence graph. +class DefaultVLIWScheduler : public ScheduleDAGInstrs { +private: + AAResults *AA; + /// Ordered list of DAG postprocessing steps. + std::vector> Mutations; + +public: + DefaultVLIWScheduler(MachineFunction &MF, MachineLoopInfo &MLI, + AAResults *AA); + + // Actual scheduling work. + void schedule() override; + + /// DefaultVLIWScheduler takes ownership of the Mutation object. + void addMutation(std::unique_ptr Mutation) { + Mutations.push_back(std::move(Mutation)); + } + +protected: + void postprocessDAG(); +}; + class DFAPacketizer { private: const InstrItineraryData *InstrItins; diff --git a/llvm/lib/CodeGen/DFAPacketizer.cpp b/llvm/lib/CodeGen/DFAPacketizer.cpp --- a/llvm/lib/CodeGen/DFAPacketizer.cpp +++ b/llvm/lib/CodeGen/DFAPacketizer.cpp @@ -29,8 +29,6 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBundle.h" #include "llvm/CodeGen/ScheduleDAG.h" -#include "llvm/CodeGen/ScheduleDAGInstrs.h" -#include "llvm/CodeGen/ScheduleDAGMutation.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/MC/MCInstrDesc.h" @@ -98,34 +96,6 @@ return RS[InstIdx] ^ RS[InstIdx - 1]; } -namespace llvm { - -// This class extends ScheduleDAGInstrs and overrides the schedule method -// to build the dependence graph. -class DefaultVLIWScheduler : public ScheduleDAGInstrs { -private: - AAResults *AA; - /// Ordered list of DAG postprocessing steps. - std::vector> Mutations; - -public: - DefaultVLIWScheduler(MachineFunction &MF, MachineLoopInfo &MLI, - AAResults *AA); - - // Actual scheduling work. - void schedule() override; - - /// DefaultVLIWScheduler takes ownership of the Mutation object. - void addMutation(std::unique_ptr Mutation) { - Mutations.push_back(std::move(Mutation)); - } - -protected: - void postprocessDAG(); -}; - -} // end namespace llvm - DefaultVLIWScheduler::DefaultVLIWScheduler(MachineFunction &MF, MachineLoopInfo &MLI, AAResults *AA)