39#define DEBUG_TYPE "post-RA-hazard-rec"
44struct PostRAHazardRecognizer {
52 PostRAHazardRecognizerLegacy() : MachineFunctionPass(ID) {}
54 void getAnalysisUsage(AnalysisUsage &AU)
const override {
59 bool runOnMachineFunction(MachineFunction &Fn)
override {
60 return PostRAHazardRecognizer().run(Fn);
63char PostRAHazardRecognizerLegacy::ID = 0;
70 "Post RA hazard recognizer",
false,
false)
75 if (!PostRAHazardRecognizer().run(MF))
85 std::unique_ptr<ScheduleHazardRecognizer> HazardRec(
94 for (
auto &
MBB : Fn) {
97 for (MachineInstr &
MI :
MBB) {
99 unsigned NumPreNoops = HazardRec->PreEmitNoops(&
MI);
100 HazardRec->EmitNoops(NumPreNoops);
102 NumNoops += NumPreNoops;
106 HazardRec->EmitInstruction(&
MI);
107 if (HazardRec->atIssueLimit()) {
108 HazardRec->AdvanceCycle();
const HexagonInstrInfo * TII
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Represents analyses that only rely on functions' control flow.
ScheduleHazardRecognizer * CreateTargetPostRAHazardRecognizer(const InstrItineraryData *II, const ScheduleDAG *DAG) const override
Allocate and return a hazard recognizer to use for this target when scheduling the machine instructio...
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
virtual const TargetInstrInfo * getInstrInfo() const
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI char & PostRAHazardRecognizerID
PostRAHazardRecognizer - This pass runs the post-ra hazard recognizer.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.