27 #define DEBUG_TYPE "machine-scheduler"
29 STATISTIC(NumFused,
"Number of instr pairs fused");
60 if (&SecondSU != &DAG.
ExitSU)
85 : shouldScheduleAdjacent(shouldScheduleAdjacent), FuseBlock(FuseBlock) {}
99 scheduleAdjacentImpl(*DAG, ISU);
103 scheduleAdjacentImpl(*DAG, DAG->
ExitSU);
139 std::unique_ptr<ScheduleDAGMutation>
147 std::unique_ptr<ScheduleDAGMutation>
Weak DAG edge linking a chain of clustered instrs.
MachineInstr * getInstr() const
Returns the representative MachineInstr for this SUnit.
Mutate the DAG as a postpass after normal DAG building.
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
SmallVector< SDep, 4 > Preds
All sunit predecessors.
A register anti-dependence (aka WAR).
MachineFunction & MF
Machine function.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool isWeak() const
Tests if this a weak dependence.
const HexagonInstrInfo * TII
Kind getKind() const
Returns an enum value representing the kind of the dependence.
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
std::unique_ptr< ScheduleDAGMutation > createMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent)
Create a DAG scheduling mutation to pair instructions back to back for instructions that benefit acco...
A register output-dependence (aka WAW).
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
TargetInstrInfo - Interface to description of machine instruction set.
initializer< Ty > init(const Ty &Val)
bool addEdge(SUnit *SuccSU, const SDep &PredDep)
Add a DAG edge to the given SU with the given predecessor dependence data.
raw_ostream & print(raw_ostream &O, const SUnit *N=nullptr, const SUnit *X=nullptr) const
std::function< bool(const TargetInstrInfo &TII, const TargetSubtargetInfo &TSI, const MachineInstr *FirstMI, const MachineInstr &SecondMI)> ShouldSchedulePredTy
Check if the instr pair, FirstMI and SecondMI, should be fused together.
void apply(Opt *O, const Mod &M, const Mods &...Ms)
static bool shouldScheduleAdjacent(const TargetInstrInfo &TII, const TargetSubtargetInfo &TSI, const MachineInstr *FirstMI, const MachineInstr &SecondMI)
Check if the instr pair, FirstMI and SecondMI, should be fused together.
std::unique_ptr< ScheduleDAGMutation > createBranchMacroFusionDAGMutation(ShouldSchedulePredTy shouldScheduleAdjacent)
Create a DAG scheduling mutation to pair branch instructions with one of their predecessors back to b...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool isBoundaryNode() const
Boundary nodes are placeholders for the boundary of the scheduling region.
static cl::opt< bool > EnableMacroFusion("misched-fusion", cl::Hidden, cl::desc("Enable scheduling for macro fusion."), cl::init(true))
void setLatency(unsigned Lat)
Sets the latency for this edge.
TargetSubtargetInfo - Generic base class for all target subtargets.
static void fuseInstructionPair(ScheduleDAGMI &DAG, SUnit &FirstSU, SUnit &SecondSU)
A ScheduleDAG for scheduling lists of MachineInstr.
Representation of each machine instruction.
SUnit ExitSU
Special node for the region exit.
const TargetInstrInfo * TII
Target instruction information.
SmallVector< SDep, 4 > Succs
All sunit successors.
Arbitrary strong DAG edge (no real dependence).
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
std::vector< SUnit > SUnits
The scheduling units.
Scheduling unit. This is a node in the scheduling DAG.
STATISTIC(NumFused,"Number of instr pairs fused")