59 #define DEBUG_TYPE "mips-hazard-schedule"
61 STATISTIC(NumInsertedNops,
"Number of nops inserted");
73 StringRef getPassName()
const override {
return "Mips Hazard Schedule"; }
91 return new MipsHazardSchedule();
97 Iter
I = Position,
E = Position->getParent()->end();
99 [](
const Iter &Insn) {
return Insn->isTransient(); });
107 if (Position == Parent->
end()) {
109 if (Succ !=
nullptr && Parent->
isSuccessor(Succ)) {
110 Position = Succ->
begin();
114 "Should have identified the end of the function earlier!");
119 if (Instr == Parent->
end()) {
134 bool Changed =
false;
138 for (Iter
I = FI->begin();
I != FI->end(); ++
I) {
145 bool LastInstInFunction =
146 std::next(
I) == FI->end() && std::next(FI) == MF.
end();
147 if (!LastInstInFunction) {
bool HasForbiddenSlot(const MachineInstr &MI) const
Predicate to determine if an instruction has a forbidden slot.
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
STATISTIC(NumFunctions,"Total number of functions")
static Iter getNextMachineInstrInBB(Iter Position)
const MipsInstrInfo * getInstrInfo() const override
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
auto find_if_not(R &&Range, UnaryPredicate P) -> decltype(std::begin(Range))
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
FunctionPass * createMipsHazardSchedule()
Returns a pass that clears pipeline hazards.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
bool SafeInForbiddenSlot(const MachineInstr &MI) const
Predicate to determine if an instruction can go in a forbidden slot.
FunctionPass class - This class is used to implement most global optimizations.
bool inMicroMipsMode() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static Iter getNextMachineInstr(Iter Position, MachineBasicBlock *Parent)
Iterator for intrusive lists based on ilist_node.
bool isSuccessor(const MachineBasicBlock *MBB) const
Return true if the specified MBB is a successor of this block.
MachineFunctionProperties & set(Property P)
MIBundleBuilder & append(MachineInstr *MI)
Insert MI into MBB by appending it to the instructions in the bundle.
StringRef - Represent a constant reference to a string, i.e.
Properties which a MachineFunction may have at a given point in time.
Helper class for constructing bundles of MachineInstrs.