[llvm-commits] Patch for review: Speeding up ScheduleDAG computations

Dan Gohman gohman at apple.com
Thu Feb 28 13:01:04 PST 2008


Hi Roman,

This patch looks good to me. Watch out for tabs. And I have a few  
other minor
corrections below.

 > +  // Initialize the data structures
 > +  for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {

This can use DAGSize instead of SUnits.size().

 > +  for (unsigned i = 0, e = SUnits.size(); i != e; ++i) {

DItto.

 > +        assert(WorkList.size() == 0 && "Should be empty");
...
 > +        assert(WorkList.size() == 0 && "Should be empty");

Please use WorkList.empty().

 > +    for (SUnit::succ_iterator I = SU->Preds.begin(), E = SU- 
 >Preds.end();
 > +	 I != E; ++I) {

Use pred_iterator here instead of succ_iterator.

 > +        Latencies[SU->NodeNum] = 1;

Why 1? I guess it doesn't affect the schedule, but I'd prefer to see  
this
be either 0 or SU->Latency.

 > +    // Update InDegrees of all nodes depending on current SUnit
 > +    for (SUnit::const_succ_iterator I = SU->Preds.begin(), E = SU- 
 >Preds.end();
 > +	 I != E; ++I) {

For iterating through predecessors, use const_pred_iterator instead of
const_succ_iterator.

 > +      SUnit *SU = I->Dep;

This can be `const SUnit *'.

Dan

On Feb 28, 2008, at 6:15 AM, Roman Levenstein wrote:

> Hi,
>
> I've implemented some improvements related to the computation of
> heights, depths and priorities and latencies of SUnits.
>
> The basic idea is that all these algorithms are computing the longest
> paths from the root node or to the exit node. Therefore I changed the
> existing implementation that uses and iterative and potentially
> exponential algorithm to a well-known graph algorithm based on dynamic
> programming. It has a linear run-time.
>
> Tests on very big  input files with tens of thousends of instructions
> in a BB, e.g. big4.bc use-case from Duraid's testsuit, indicate huge
> speed-ups (up to 2x) compared to the current version,
>
> Please review and tell if it is OK for submission.
> - Roman
> <ScheduleDAG.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list