This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][MC][GFX11] Support base+soffset+offset SMEM loads.
ClosedPublic

Authored by kosarev on May 23 2022, 7:39 AM.

Diff Detail

Event Timeline

kosarev created this revision.May 23 2022, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 7:39 AM
kosarev requested review of this revision.May 23 2022, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 7:39 AM
kosarev added inline comments.May 23 2022, 7:43 AM
llvm/lib/Target/AMDGPU/SMInstructions.td
142

Looks like we have a use case for classes in multiclasses?

dp added inline comments.May 23 2022, 2:59 PM
llvm/lib/Target/AMDGPU/SMInstructions.td
1143

Is the _COMMON variant defined for aesthetic reasons? I believe the following code should work:

def : MnemonicAlias<!cast<SM_Load_Pseudo>(ps#"_IMM").Mnemonic, opName>,
kosarev added inline comments.May 24 2022, 1:56 AM
llvm/lib/Target/AMDGPU/SMInstructions.td
1143

The aim here is to make the code reflect the fact that the pseudos share the same mnemonic (and I'm not sure casting to SM_Load_Pseudo instead of SM_Pseudo makes it obvious enough). This introduces a pseudo that is not used as such, but that seems a result of using pseudos to describe instruction properties -- a problem that we might want to address separately at some point.

dp added inline comments.May 24 2022, 4:55 AM
llvm/lib/Target/AMDGPU/SMInstructions.td
1143

This is a matter of taste, but for me the _COMMON definition does not make code clearer because the purpose of this definition is not immediately obvious. Maybe the name is a bit misleading and something like _MNEMO would be better?

Another (more important) problem is that the _COMMON definition if not for free - it contaminates compiler tables with unused entries.

kosarev updated this revision to Diff 431651.May 24 2022, 5:26 AM

Removed the _COMMON pseudos.

dp accepted this revision.May 24 2022, 5:58 AM

LGTM.

This revision is now accepted and ready to land.May 24 2022, 5:58 AM
This revision was landed with ongoing or failed builds.May 24 2022, 7:15 AM
This revision was automatically updated to reflect the committed changes.