This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add XDL resource to scheduling model
ClosedPublic

Authored by kerbowa on Sep 14 2020, 10:58 AM.

Diff Detail

Event Timeline

kerbowa created this revision.Sep 14 2020, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2020, 10:58 AM
kerbowa requested review of this revision.Sep 14 2020, 10:58 AM
This revision is now accepted and ready to land.Sep 14 2020, 11:19 AM
This revision was automatically updated to reflect the committed changes.
foad added a subscriber: foad.Sep 16 2020, 12:15 AM
foad added inline comments.Sep 16 2020, 7:13 AM
llvm/lib/Target/AMDGPU/SISchedule.td
107–109

As I understand it, from reading comments in MCSchedule.h and TargetSchedule.td, you have to set BufferSize = 0 to model instructions that immediately consume a resource for one or more cycles. It would be useful to do this for some VALU instructions, e.g. some transcendental instructions, that take more than one cycle to issue (on gfx10).

What I don't understand is, for a normal single-cycle issue (on gfx10) SALU or VALU instruction, should we use BufferSize = 0 or 1 ? What practical difference does it make?

kerbowa added inline comments.Sep 16 2020, 8:13 PM
llvm/lib/Target/AMDGPU/SISchedule.td
107–109

The conclusion I started to come to when working on this was that a BufferSize of 0 makes sense for most resources given our hardware. A BufferSize of 1 is used to model pipelines where a bubble could be introduced if instructions with a data dependency require the same resource. I'm not sure if there is any practical difference for normal VALU or SALU Ops though.

We would also need to model these types of non-nop hazards in the post-RA scheduler. I started working on some infrastructure for that.

foad added inline comments.Oct 8 2020, 2:24 AM
llvm/lib/Target/AMDGPU/SISchedule.td
107–109

Shouldn't we aim to switch to post-MI-sched instead of improving post-RA-sched?