mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Rename BuildSchedUnits to BuildSchedGraph, and refactor the
code in ScheduleDAGSDNodes' BuildSchedGraph into separate functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61376 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1bda0541f0
commit
c9a5b9e38b
@ -442,10 +442,10 @@ namespace llvm {
|
|||||||
///
|
///
|
||||||
void Run();
|
void Run();
|
||||||
|
|
||||||
/// BuildSchedUnits - Build SUnits and set up their Preds and Succs
|
/// BuildSchedGraph - Build SUnits and set up their Preds and Succs
|
||||||
/// to form the scheduling dependency graph.
|
/// to form the scheduling dependency graph.
|
||||||
///
|
///
|
||||||
virtual void BuildSchedUnits() = 0;
|
virtual void BuildSchedGraph() = 0;
|
||||||
|
|
||||||
/// ComputeLatency - Compute node latency.
|
/// ComputeLatency - Compute node latency.
|
||||||
///
|
///
|
||||||
|
@ -45,9 +45,9 @@ namespace llvm {
|
|||||||
return &SUnits.back();
|
return &SUnits.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// BuildSchedUnits - Build SUnits from the MachineBasicBlock that we are
|
/// BuildSchedGraph - Build SUnits from the MachineBasicBlock that we are
|
||||||
/// input.
|
/// input.
|
||||||
virtual void BuildSchedUnits();
|
virtual void BuildSchedGraph();
|
||||||
|
|
||||||
/// ComputeLatency - Compute node latency.
|
/// ComputeLatency - Compute node latency.
|
||||||
///
|
///
|
||||||
|
@ -118,10 +118,11 @@ namespace llvm {
|
|||||||
|
|
||||||
virtual SelectionDAG *getDAG() { return DAG; }
|
virtual SelectionDAG *getDAG() { return DAG; }
|
||||||
|
|
||||||
/// BuildSchedUnits - Build SUnits from the selection dag that we are input.
|
/// BuildSchedGraph - Build the SUnit graph from the selection dag that we
|
||||||
/// This SUnit graph is similar to the SelectionDAG, but represents flagged
|
/// are input. This SUnit graph is similar to the SelectionDAG, but
|
||||||
/// together nodes with a single SUnit.
|
/// excludes nodes that aren't interesting to scheduling, and represents
|
||||||
virtual void BuildSchedUnits();
|
/// flagged together nodes with a single SUnit.
|
||||||
|
virtual void BuildSchedGraph();
|
||||||
|
|
||||||
/// ComputeLatency - Compute node latency.
|
/// ComputeLatency - Compute node latency.
|
||||||
///
|
///
|
||||||
@ -189,6 +190,10 @@ namespace llvm {
|
|||||||
void CreateVirtualRegisters(SDNode *Node, MachineInstr *MI,
|
void CreateVirtualRegisters(SDNode *Node, MachineInstr *MI,
|
||||||
const TargetInstrDesc &II,
|
const TargetInstrDesc &II,
|
||||||
DenseMap<SDValue, unsigned> &VRBaseMap);
|
DenseMap<SDValue, unsigned> &VRBaseMap);
|
||||||
|
|
||||||
|
/// BuildSchedUnits, AddSchedEdges - Helper functions for BuildSchedGraph.
|
||||||
|
void BuildSchedUnits();
|
||||||
|
void AddSchedEdges();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,8 +121,8 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
void SchedulePostRATDList::Schedule() {
|
void SchedulePostRATDList::Schedule() {
|
||||||
DOUT << "********** List Scheduling **********\n";
|
DOUT << "********** List Scheduling **********\n";
|
||||||
|
|
||||||
// Build scheduling units.
|
// Build the scheduling graph.
|
||||||
BuildSchedUnits();
|
BuildSchedGraph();
|
||||||
|
|
||||||
if (EnableAntiDepBreaking) {
|
if (EnableAntiDepBreaking) {
|
||||||
if (BreakAntiDependencies()) {
|
if (BreakAntiDependencies()) {
|
||||||
@ -133,7 +133,7 @@ void SchedulePostRATDList::Schedule() {
|
|||||||
// that register, and add new anti-dependence and output-dependence
|
// that register, and add new anti-dependence and output-dependence
|
||||||
// edges based on the next live range of the register.
|
// edges based on the next live range of the register.
|
||||||
SUnits.clear();
|
SUnits.clear();
|
||||||
BuildSchedUnits();
|
BuildSchedGraph();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ ScheduleDAGInstrs::ScheduleDAGInstrs(MachineBasicBlock *bb,
|
|||||||
const MachineDominatorTree &mdt)
|
const MachineDominatorTree &mdt)
|
||||||
: ScheduleDAG(0, bb, tm), MLI(mli), MDT(mdt) {}
|
: ScheduleDAG(0, bb, tm), MLI(mli), MDT(mdt) {}
|
||||||
|
|
||||||
void ScheduleDAGInstrs::BuildSchedUnits() {
|
void ScheduleDAGInstrs::BuildSchedGraph() {
|
||||||
SUnits.clear();
|
SUnits.clear();
|
||||||
SUnits.reserve(BB->size());
|
SUnits.reserve(BB->size());
|
||||||
|
|
||||||
|
@ -114,8 +114,8 @@ void ScheduleDAGFast::Schedule() {
|
|||||||
LiveRegDefs.resize(TRI->getNumRegs(), NULL);
|
LiveRegDefs.resize(TRI->getNumRegs(), NULL);
|
||||||
LiveRegCycles.resize(TRI->getNumRegs(), 0);
|
LiveRegCycles.resize(TRI->getNumRegs(), 0);
|
||||||
|
|
||||||
// Build scheduling units.
|
// Build the scheduling graph.
|
||||||
BuildSchedUnits();
|
BuildSchedGraph();
|
||||||
|
|
||||||
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
|
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
|
||||||
SUnits[su].dumpAll(this));
|
SUnits[su].dumpAll(this));
|
||||||
|
@ -91,8 +91,8 @@ HazardRecognizer::~HazardRecognizer() {}
|
|||||||
void ScheduleDAGList::Schedule() {
|
void ScheduleDAGList::Schedule() {
|
||||||
DOUT << "********** List Scheduling **********\n";
|
DOUT << "********** List Scheduling **********\n";
|
||||||
|
|
||||||
// Build scheduling units.
|
// Build the scheduling graph.
|
||||||
BuildSchedUnits();
|
BuildSchedGraph();
|
||||||
|
|
||||||
AvailableQueue->initNodes(SUnits);
|
AvailableQueue->initNodes(SUnits);
|
||||||
|
|
||||||
|
@ -170,8 +170,8 @@ void ScheduleDAGRRList::Schedule() {
|
|||||||
LiveRegDefs.resize(TRI->getNumRegs(), NULL);
|
LiveRegDefs.resize(TRI->getNumRegs(), NULL);
|
||||||
LiveRegCycles.resize(TRI->getNumRegs(), 0);
|
LiveRegCycles.resize(TRI->getNumRegs(), 0);
|
||||||
|
|
||||||
// Build scheduling units.
|
// Build the scheduling graph.
|
||||||
BuildSchedUnits();
|
BuildSchedGraph();
|
||||||
|
|
||||||
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
|
DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su)
|
||||||
SUnits[su].dumpAll(this));
|
SUnits[su].dumpAll(this));
|
||||||
|
@ -64,9 +64,6 @@ static void CheckForPhysRegDependency(SDNode *Def, SDNode *User, unsigned Op,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// BuildSchedUnits - Build SUnits from the selection dag that we are input.
|
|
||||||
/// This SUnit graph is similar to the SelectionDAG, but represents flagged
|
|
||||||
/// together nodes with a single SUnit.
|
|
||||||
void ScheduleDAGSDNodes::BuildSchedUnits() {
|
void ScheduleDAGSDNodes::BuildSchedUnits() {
|
||||||
// During scheduling, the NodeId field of SDNode is used to map SDNodes
|
// During scheduling, the NodeId field of SDNode is used to map SDNodes
|
||||||
// to their associated SUnits by holding SUnits table indices. A value
|
// to their associated SUnits by holding SUnits table indices. A value
|
||||||
@ -146,7 +143,9 @@ void ScheduleDAGSDNodes::BuildSchedUnits() {
|
|||||||
else
|
else
|
||||||
ComputeLatency(NodeSUnit);
|
ComputeLatency(NodeSUnit);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScheduleDAGSDNodes::AddSchedEdges() {
|
||||||
// Pass 2: add the preds, succs, etc.
|
// Pass 2: add the preds, succs, etc.
|
||||||
for (unsigned su = 0, e = SUnits.size(); su != e; ++su) {
|
for (unsigned su = 0, e = SUnits.size(); su != e; ++su) {
|
||||||
SUnit *SU = &SUnits[su];
|
SUnit *SU = &SUnits[su];
|
||||||
@ -196,6 +195,17 @@ void ScheduleDAGSDNodes::BuildSchedUnits() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// BuildSchedGraph - Build the SUnit graph from the selection dag that we
|
||||||
|
/// are input. This SUnit graph is similar to the SelectionDAG, but
|
||||||
|
/// excludes nodes that aren't interesting to scheduling, and represents
|
||||||
|
/// flagged together nodes with a single SUnit.
|
||||||
|
void ScheduleDAGSDNodes::BuildSchedGraph() {
|
||||||
|
// Populate the SUnits array.
|
||||||
|
BuildSchedUnits();
|
||||||
|
// Compute all the scheduling dependencies between nodes.
|
||||||
|
AddSchedEdges();
|
||||||
|
}
|
||||||
|
|
||||||
void ScheduleDAGSDNodes::ComputeLatency(SUnit *SU) {
|
void ScheduleDAGSDNodes::ComputeLatency(SUnit *SU) {
|
||||||
const InstrItineraryData &InstrItins = TM.getInstrItineraryData();
|
const InstrItineraryData &InstrItins = TM.getInstrItineraryData();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user