This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][MC][GFX11] Disable non-null src0 for s_waitcnt_*cnt
ClosedPublic

Authored by dp on Sep 28 2022, 7:07 AM.

Diff Detail

Event Timeline

dp created this revision.Sep 28 2022, 7:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2022, 7:07 AM
dp requested review of this revision.Sep 28 2022, 7:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2022, 7:07 AM
foad added a comment.Sep 28 2022, 7:29 AM

Looks OK for GFX11, I just wonder if there is a way to do this that will automatically work for future architectures too? Or will we just have to remember to update the list of opcodes in validateWaitCnt?

dp added a comment.Sep 28 2022, 8:40 AM

Looks OK for GFX11, I just wonder if there is a way to do this that will automatically work for future architectures too? Or will we just have to remember to update the list of opcodes in validateWaitCnt?

Unfortunately, I do not see how else we can detect these opcodes in the parser. They do not have any distinct feature flags we could use.
I can add a tablegenned function for opcode detection, but this will not automatically work for future architectures.
If we were able to convert MC opcodes to PSEUDO, this might work.

dp added a comment.Sep 28 2022, 12:51 PM

As an afterthought, I think this instruction will unlikely exist in future architectures (at least in the current form). I believe src0 will be either removed or repurposed.

dp updated this revision to Diff 463656.Sep 28 2022, 12:53 PM

Fix unexpected disassembler breakage caused by this change. Update disassembler tests.

This revision is now accepted and ready to land.Sep 28 2022, 1:38 PM
This revision was automatically updated to reflect the committed changes.