This is an archive of the discontinued LLVM Phabricator instance.

ScheduleDAGInstrs: Rework schedule graph builder.
ClosedPublic

Authored by MatzeB on Apr 16 2015, 7:16 PM.

Details

Summary

The new algorithm remembers the uses encountered while walking backwards
until a matching def is found. Contrary to the previous version this:

  • Works without LiveIntervals being available
  • Allows to increase the precision to subregisters/lanemasks (not used for now)

The changes in the AMDGPU tests are necessary because the R600 scheduler
is not stable with respect to the order of nodes in the ready queues.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 23893.Apr 16 2015, 7:16 PM
MatzeB retitled this revision from to ScheduleDAGInstrs: Optionally respect lanemasks when creating dependencies..
MatzeB updated this object.
MatzeB edited the test plan for this revision. (Show Details)
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: Unknown Object (MLST).
qcolombet requested changes to this revision.Sep 8 2015, 11:19 AM
qcolombet edited edge metadata.

Hi Matthias,

The change looks mostly good to me.
There is one FIXME though, that I believe should be fixed before pushing.

Thanks,
-Quentin

include/llvm/CodeGen/ScheduleDAGInstrs.h
100 ↗(On Diff #23893)

Should we mention the sub-register here?
I am wondering if it is clear for everybody that lane masks come from sub-registers.

lib/CodeGen/ScheduleDAGInstrs.cpp
371 ↗(On Diff #23893)

I guess the constant used here is not very important since we consistently have the same for every virtual registers.
That being said, it feels more natural to use ~0U, to emphasize we set the whole register, however I reckon we would set too many “lane mask” bits.
What do you think?

376 ↗(On Diff #23893)

Ditto.

402 ↗(On Diff #23893)

Didn’t we come to the conclusion that the other lanes may be undef for this use but still live?
I.e., the kill mask is redundant with the def mask.

417 ↗(On Diff #23893)

When do you plan to fix this?
I am guessing there is not much point in pushing the patch forward without that fixed.

This revision now requires changes to proceed.Sep 8 2015, 11:19 AM
MatzeB updated this revision to Diff 41081.Nov 24 2015, 1:53 PM
MatzeB retitled this revision from ScheduleDAGInstrs: Optionally respect lanemasks when creating dependencies. to ScheduleDAGInstrs: Rework schedule graph builder..
MatzeB updated this object.
MatzeB edited edge metadata.
atrick accepted this revision.Nov 29 2015, 10:00 PM
atrick edited edge metadata.

LGTM. Thanks.

This revision was automatically updated to reflect the committed changes.