40#define DEBUG_TYPE "post-RA-hazard-rec"
45struct PostRAHazardRecognizer {
53 PostRAHazardRecognizerLegacy() : MachineFunctionPass(ID) {}
55 void getAnalysisUsage(AnalysisUsage &AU)
const override {
61 bool runOnMachineFunction(MachineFunction &Fn)
override {
62 MachineLoopInfo &MLI = getAnalysis<MachineLoopInfoWrapperPass>().getLI();
63 return PostRAHazardRecognizer().run(Fn, &MLI);
66char PostRAHazardRecognizerLegacy::ID = 0;
73 "Post RA hazard recognizer",
false,
false)
82 if (!PostRAHazardRecognizer().
run(MF, MLI))
92 std::unique_ptr<ScheduleHazardRecognizer> HazardRec(
93 TII->CreateTargetPostRAHazardRecognizer(Fn, MLI));
101 for (
auto &
MBB : Fn) {
106 unsigned NumPreNoops = HazardRec->PreEmitNoops(&
MI);
107 HazardRec->EmitNoops(NumPreNoops);
109 NumNoops += NumPreNoops;
113 HazardRec->EmitInstruction(&
MI);
114 if (HazardRec->atIssueLimit()) {
115 HazardRec->AdvanceCycle();
const HexagonInstrInfo * TII
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(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)
AnalysisUsage & addRequired()
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.
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.
Representation of each machine instruction.
Analysis pass that exposes the MachineLoopInfo for a machine function.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
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.
TargetInstrInfo - Interface to description of machine instruction set.
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.