From 04543e719e53c3ebd6533ef4cb4bdf60c27d658c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 23 Dec 2008 18:36:58 +0000 Subject: Rename BuildSchedUnits to BuildSchedGraph, and refactor the code in ScheduleDAGSDNodes' BuildSchedGraph into separate functions. llvm-svn: 61376 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp index 4a7920acedb..347410ae7d6 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp @@ -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() { // During scheduling, the NodeId field of SDNode is used to map SDNodes // to their associated SUnits by holding SUnits table indices. A value @@ -146,7 +143,9 @@ void ScheduleDAGSDNodes::BuildSchedUnits() { else ComputeLatency(NodeSUnit); } - +} + +void ScheduleDAGSDNodes::AddSchedEdges() { // Pass 2: add the preds, succs, etc. for (unsigned su = 0, e = SUnits.size(); su != e; ++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) { const InstrItineraryData &InstrItins = TM.getInstrItineraryData(); -- cgit v1.2.3