diff options
author | Darshan Bhat <darshanbhatsirsi@gmail.com> | 2023-02-11 13:42:29 +0530 |
---|---|---|
committer | Shivam Gupta <shivam98.tkg@gmail.com> | 2023-02-11 14:31:58 +0530 |
commit | 19c42f672f942518b4d711a0c734693a9244f78c (patch) | |
tree | f6dad65e3661b8a1469460f6a9b621e76fc51b81 /llvm/lib/CodeGen/DFAPacketizer.cpp | |
parent | 5fc73b7502fbbb46faa57a558c8661822b2b5215 (diff) | |
download | llvm-19c42f672f942518b4d711a0c734693a9244f78c.zip llvm-19c42f672f942518b4d711a0c734693a9244f78c.tar.gz llvm-19c42f672f942518b4d711a0c734693a9244f78c.tar.bz2 |
[DFAPacketizer] Move DefaultVLIWScheduler class declaration to header file
This change moves "DefaultVLIWScheduler" class declaration from
DFAPacketizer.cpp to DFAPacketizer.h.
This is needed because there is a protected class member of
type "DefaultVLIWScheduler*" in "VLIWPacketizerList" class.
The derived classes cannot use this memeber unless declaration
is available to it. More specifically :
// Without this change
```
class HexagonPacketizerList : public VLIWPacketizerList {
public :
HexagonPacketizerList() {
// Below line will cause incomplete class error since
// declaration was not available through header.
VLIWScheduler->schedule();
}
}
```
Reviewed By: kparzysz
Differential Revision: https://reviews.llvm.org/D139767
Diffstat (limited to 'llvm/lib/CodeGen/DFAPacketizer.cpp')
-rw-r--r-- | llvm/lib/CodeGen/DFAPacketizer.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/llvm/lib/CodeGen/DFAPacketizer.cpp b/llvm/lib/CodeGen/DFAPacketizer.cpp index 34fb1d2..cf02918b9 100644 --- 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 @@ unsigned DFAPacketizer::getUsedResources(unsigned InstIdx) { 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<std::unique_ptr<ScheduleDAGMutation>> 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<ScheduleDAGMutation> Mutation) { - Mutations.push_back(std::move(Mutation)); - } - -protected: - void postprocessDAG(); -}; - -} // end namespace llvm - DefaultVLIWScheduler::DefaultVLIWScheduler(MachineFunction &MF, MachineLoopInfo &MLI, AAResults *AA) |