This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] prefer non-mfma in post-RA schedule
ClosedPublic

Authored by rampitec on Jul 29 2020, 11:53 AM.

Details

Summary

MFMA instructions shall not be scheduled back to back
to avoid MAI SIMD stall. Tell post-RA schedule we would
prefer some other instruction instead.

Diff Detail

Event Timeline

rampitec created this revision.Jul 29 2020, 11:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2020, 11:53 AM
rampitec requested review of this revision.Jul 29 2020, 11:53 AM

Minor nit, but test should disable-power-sched otherwise I think MFMA will be scheduled apart anyway.

Minor nit, but test should disable-power-sched otherwise I think MFMA will be scheduled apart anyway.

It will not schedule s_cmp in between, but in general you are right.

rampitec updated this revision to Diff 281700.Jul 29 2020, 12:08 PM

Added -amdgpu-disable-power-sched in test.

Actually MFMA would need more height to ensure post-RA tries to schedule them first and together. You could have their results be implicit uses on later instruction like S_ENDPGM or something.

Actually MFMA would need more height to ensure post-RA tries to schedule them first and together. You could have their results be implicit uses on later instruction like S_ENDPGM or something.

W/o this patch they are scheduled back to back:

S_ADD_U32
S_ADDC_U32
V_MFMA_F32_32X32X1F32
V_MFMA_F32_32X32X1F32
S_CMP_LG_U32

kerbowa accepted this revision.Jul 29 2020, 12:15 PM

LGTM either way

This revision is now accepted and ready to land.Jul 29 2020, 12:15 PM
This revision was automatically updated to reflect the committed changes.
foad added a subscriber: foad.Aug 7 2020, 3:32 AM