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()) {
110 if (Succ !=
nullptr && Parent->
isSuccessor(Succ)) {
111 Position = Succ->
begin();
114 return std::make_pair(Position,
true);
116 }
while (Parent->
empty());
120 if (Instr == Parent->
end()) {
123 return std::make_pair(Instr,
false);
135 bool Changed =
false;
139 for (Iter
I = FI->begin();
I != FI->end(); ++
I) {
146 bool LastInstInFunction =
147 std::next(
I) == FI->end() && std::next(FI) == MF.
end();
148 if (!LastInstInFunction) {
150 LastInstInFunction |= Res.second;
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))
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.
static std::pair< Iter, bool > getNextMachineInstr(Iter Position, MachineBasicBlock *Parent)
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
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.