This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][MC] Added flag to identify VOP instructions which have a single variant
ClosedPublic

Authored by dp on Mar 26 2021, 3:43 AM.

Details

Summary

[AMDGPU][MC] Added flag to identify VOP instructions which have a single variant

By convention, VOP1/2/C instructions which can be promoted to VOP3 have _e32 suffix while promoted instructions have _e64 suffix. Instructions which have a single variant should have no _e32/_e64 suffix. Unfortunately there was no simple way to identify single variant instructions - it was implemented by a hack. See bug https://bugs.llvm.org/show_bug.cgi?id=39086.

This fix simplifies handling of single VOP instructions by adding a dedicated flag.

Diff Detail

Event Timeline

dp created this revision.Mar 26 2021, 3:43 AM
dp requested review of this revision.Mar 26 2021, 3:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 26 2021, 3:43 AM
dp retitled this revision from [AMDGPU] Added a flag to identify to [AMDGPU][MC] Added flag to identify VOP instructions which have a single variant.Mar 26 2021, 3:46 AM
dp edited the summary of this revision. (Show Details)
dp added a reviewer: rampitec.
foad added subscribers: Joe_Nash, foad.

Adding @Joe_Nash since he made some changes related to _e64 suffixes quite recently.

I do not thing this is really true:

all VOP instructions (including VOP3P) use VOPDstOperand;

VOPC does not have VOPDst.

dp edited the summary of this revision. (Show Details)Mar 30 2021, 10:00 AM
rampitec accepted this revision.Mar 30 2021, 10:26 AM

LGTM, but lease wait for @Joe_Nash vote as well.

This revision is now accepted and ready to land.Mar 30 2021, 10:26 AM
dp added inline comments.Mar 30 2021, 10:44 AM
llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
380

This check is not necessary:

Flags & SIInstrFlags::VOPC
dp updated this revision to Diff 334225.Mar 30 2021, 10:45 AM

Removed unnecessary code