[llvm-commits] [llvm] r48817 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Duncan Sands
baldrick at free.fr
Wed Mar 26 03:34:43 PDT 2008
Hi Roman,
> + /// AddPred - This adds the specified node X as a predecessor of
> + /// the current node Y if not already.
> + /// This returns true if this is a new pred.
new pred -> new predecessor
> + /// Updates the topological oredering if required.
oredering -> ordering
> + bool AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isSpecial,
> + unsigned PhyReg = 0, int Cost = 1);
Wrong indentation.
> + /// RemovePred - This removes the specified node N from predecessors of
from predecessors -> from the predecessors
> + /// the current node M. Updates the topological oredering if required
Two spaces after full stop. oredering -> ordering. Missing full stop at
end of line.
> + /// CreateNewSUnit - Creates a new SUnit and returns a pointer to it.
> + /// Updates the topological oredering if required.
oredering -> ordering
> + // Update the topologic ordering
topologic ordering -> topological ordering.
(Note the full stop).
> + /// CreateClone - Creates a new SUnit from old one.
from old one -> from an existing one
> + /// Updates the topological oredering if required.
oredering -> ordering
> + // Update the topologic ordering
topologic ordering -> topological ordering.
(Note the full stop).
> + /// This allows for very fast implementation of IsReachable.
allows for very fast -> allows a very fast
> + a directed acyclic graph" by David J.Pearce and Paul H.J. Kelly
Missing space between J. and Pearce.
> + This is the MNR algorithm, which is first introduced by
is first -> was first
> + A.Marchetti-Spaccamela, U.Nanni and H.Rohnert in
Missing spaces between initials and last names.
> + Topological ordering, ord, of a DAG maps each node to a topological
> + index so that fall all edges X->Y it is the case that ord(X) < ord(Y).
fall all -> for all
> + Algorithm first computes a topological ordering for a DAG by initializing
Algorithm -> The algorithm
a DAG -> the DAG
> + /// InitDAGTopologicalSorting - create the initial topological
> + /// ordering from the DAG to be scheduled
Missing full stop at end of line.
> + /// DFS - make a DFS traversal and mark all nodes affected by the
> + /// edge insertion. These nodes should later get new topological indexes
Two spaces after full stop.
should later -> will later
> + /// by means of Shift method
of Shift method -> of the Shift method.
(Note full stop).
> + /// Shift - reassign topological indexes for the nodes in the DAG
> + /// to preserve the topological ordering
Missing full stop at end of line.
> + /// Allocate - assign the topological index to a node n
a node n -> the node n.
(Note full stop).
> + /// Index2Node - Maps topological index to the node number
Missing full stop at end of line.
> + /// Node2Index - Maps the node number to its topological index
Missing full stop at end of line.
> + /// Visited - a set of nodes visited during a DFS traversal
Missing full stop at end of line.
> +bool ScheduleDAGRRList::IsReachable(SUnit *SU, SUnit *TargetSU) {
> + // If insertion of the edge SU->TargetSU would creates a cycle
would creates -> would create
> + // then there is a path from TargetSU to SU
Missing full stop at end of line.
> +/// Allocate - assign the topological index to a node n
a node n -> the node n.
(Note full stop).
I won't mention duplicate comments any more. When you fix up
the comment in the header please fix up the comment in the body too!
> +/// InitDAGTopologicalSorting - create the initial topological
> +/// ordering from the DAG to be scheduled.
Too many spaces after ///
> + // Initialize the data structures
Missing full stop at end of line.
> + // Collect leaf nodes
Missing full stop at end of line.
> + // If all dependencies of the node are processed already,
> + // then the node can be computed now
Missing full stop at end of line.
> +/// AddPred - adds edge from SUnit X to SUnit Y
adds edge -> adds an edge
Missing full stop at end of line.
> +/// Updates the topological oredering if required.
oredering -> ordering
> +bool ScheduleDAGRRList::AddPred(SUnit *Y, SUnit *X, bool isCtrl, bool isSpecial,
> + unsigned PhyReg, int Cost) {
Wrong indentation.
> + // Update the topological order
Missing full stop at end of line.
> + // Recompute topological indexes
Missing full stop at end of line.
> + // Now really insert the edge
Missing full stop at end of line.
> + return Y->addPred(X,isCtrl,isSpecial,PhyReg,Cost);
Missing spaces after commas.
> +/// RemovePred - This removes the specified node N from preds of
> +/// the current node M. Updates the topological oredering if required
Reuse the comment from the header.
> +/// DFS - make a DFS traversal to mark all nodes reachable from SU and and mark /// all nodes affected by the edge insertion. These nodes should later get new /// topological indexes by means of the Shift method
Somehow several comment lines seem to have been joined together.
- make a -> - Make a
and and -> and
Two spaces after full stop.
should later -> will later
Missing full stop at end of line.
> + // Visit successors if not already and is in affected region
is in -> in
Missing full stop at end of line.
> +/// Shift - renumber the nodes so that the topological ordering is
- renumber -> - Renumber
> +/// preserved
Missing full stop at end of line.
> + // w is node at topological index i
Missing full stop at end of line.
> + // Unmark
Missing full stop at end of line.
> + AddPred(LoadSU, Pred->Dep, Pred->isCtrl, Pred->isSpecial,
> Pred->Reg, Pred->Cost);
Wrong indentation.
> + AddPred(NewSU, Pred->Dep, Pred->isCtrl, Pred->isSpecial,
> Pred->Reg, Pred->Cost);
Wrong indentation.
> + AddPred(Succ->Dep, NewSU, Succ->isCtrl, Succ->isSpecial,
> Succ->Reg, Succ->Cost);
Wrong indentation.
> + AddPred(Succ->Dep, LoadSU, Succ->isCtrl, Succ->isSpecial,
> Succ->Reg, Succ->Cost);
Wrong indentation.
Ciao,
Duncan.
More information about the llvm-commits
mailing list