This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GFX940] Simplify definitions of GLOBAL_ATOMIC
Needs ReviewPublic

Authored by mariusz-sikora-at-amd on Mar 29 2023, 7:25 AM.

Details

Summary

This change aims to remove unnecessary SubtargetPredicate override
for Flat_Global_Atomics for gfx940.

In current implementation we override SubtargetPredicate twice.
First time when creating definition for Pseudo Instruction in which
SubtargetPredicate is changed to 'isGFX90APlus' and later when
creating Real instruction SubtargetPredicate is changed to 'isGFX940Plus'.
This should not be needed because multiclass 'FLAT_Global_Atomic_Pseudo'
sets up SubtargetPredicate to 'HasFlatGlobalInsts' and all ASICs Generations
should add this feature if they support it.

Additionaly FLAT_Global_Real_Atomics_gfx940 sets up AssemblerPredicate to
'isGFX940Plus' which later is added to final list of all Predicates
for Real instructions in 'list<Predicate> Predicates'

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2023, 7:25 AM
mariusz-sikora-at-amd requested review of this revision.Mar 29 2023, 7:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2023, 7:25 AM
foad added inline comments.Mar 29 2023, 7:57 AM
llvm/lib/Target/AMDGPU/FLATInstructions.td
725–728

Can you also remove the predicate for these FLAT Reals? Or is there some reason why that would not work?

rampitec added inline comments.Mar 29 2023, 11:16 AM
llvm/lib/Target/AMDGPU/FLATInstructions.td
730

I do not understand this. These were only added in gfx90a.

llvm/lib/Target/AMDGPU/FLATInstructions.td
730

This patch is only removing 'complexity' from gfx940. For gfx90A we still have Real Instruction under SubtargetPredicate = IsGFX90APlus.
I will add test for gfx908.

Add tests for gfx908 with unsupported instructions.

rampitec added inline comments.Mar 30 2023, 12:02 PM
llvm/lib/Target/AMDGPU/FLATInstructions.td
730

This patch is only removing 'complexity' from gfx940. For gfx90A we still have Real Instruction under SubtargetPredicate = IsGFX90APlus.
I will add test for gfx908.

But isn't pseudo still need a predicate too, not just real instruction?