27 #define DEBUG_TYPE "machine-scheduler" 29 STATISTIC(NumFused,
"Number of instr pairs fused");
77 if (&SecondSU != &DAG.
ExitSU)
81 SU == &DAG.
ExitSU || SU == &SecondSU || SU->
isPred(&SecondSU))
102 if (&SecondSU == &DAG.
ExitSU) {
104 if (SU.
Succs.empty())
139 scheduleAdjacentImpl(*DAG, ISU);
143 scheduleAdjacentImpl(*DAG, DAG->
ExitSU);
178 std::unique_ptr<ScheduleDAGMutation>
186 std::unique_ptr<ScheduleDAGMutation>
Weak DAG edge linking a chain of clustered instrs.
This class represents lattice values for constants.
STATISTIC(NumFused, "Number of instr pairs fused")
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 HexagonInstrInfo * TII
void apply(Opt *O, const Mod &M, const Mods &... Ms)
static bool fuseInstructionPair(ScheduleDAGMI &DAG, SUnit &FirstSU, SUnit &SecondSU)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
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).
bool isBoundaryNode() const
Boundary nodes are placeholders for the boundary of the scheduling region.
TargetInstrInfo - Interface to description of machine instruction set.
initializer< Ty > init(const Ty &Val)
MachineInstr * getInstr() const
Returns the representative MachineInstr for this SUnit.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
bool addEdge(SUnit *SuccSU, const SDep &PredDep)
Add a DAG edge to the given SU with the given predecessor dependence data.
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 dumpNodeName(const SUnit &SU) const
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
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.
static bool isHazard(const SDep &Dep)
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.
SUnit EntrySU
Special node for the region entry.
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.
Kind getKind() const
Returns an enum value representing the kind of the dependence.
SmallVector< SDep, 4 > Succs
All sunit successors.
bool isCluster() const
Tests if this is an Order dependence that is marked as "cluster", meaning it is artificial and wants ...
Arbitrary strong DAG edge (no real dependence).
bool isWeak() const
Tests if this a weak dependence.
std::vector< SUnit > SUnits
The scheduling units.
bool isSucc(const SUnit *N) const
Tests if node N is a successor of this node.
Scheduling unit. This is a node in the scheduling DAG.
bool isPred(const SUnit *N) const
Tests if node N is a predecessor of this node.