This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Put un-initiaized enumerators together in an enum definition.
ClosedPublic

Authored by cfang on Jan 12 2023, 4:22 PM.

Details

Summary

For any enumerator whose definition does not have an initializer, the associated value is the value of the previous enumerator plus one.
In order to avoid the possibility that two unrelated enumerators to have the same value, we should try to cluster the uninitialized enumerators together.

Diff Detail

Unit TestsFailed

Event Timeline

cfang created this revision.Jan 12 2023, 4:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 4:22 PM
cfang requested review of this revision.Jan 12 2023, 4:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2023, 4:22 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm accepted this revision.Jan 12 2023, 4:31 PM
This revision is now accepted and ready to land.Jan 12 2023, 4:31 PM
arsenm requested changes to this revision.Jan 12 2023, 4:32 PM

Missing test

This revision now requires changes to proceed.Jan 12 2023, 4:32 PM
foad accepted this revision.Jan 13 2023, 2:24 AM

LGTM even if it is currently NFC.

cfang updated this revision to Diff 490684.Jan 19 2023, 4:24 PM

Add a test.

arsenm added inline comments.Jan 19 2023, 6:34 PM
llvm/test/CodeGen/AMDGPU/permlane-op-sel.ll
2

Should also add a direct to asm line with -show-mc-encoding to be sure

6

Should check the encoding comments

cfang updated this revision to Diff 490947.Jan 20 2023, 12:49 PM
cfang marked 2 inline comments as done.

update test

arsenm accepted this revision.Jan 20 2023, 2:22 PM
This revision is now accepted and ready to land.Jan 20 2023, 2:22 PM
  1. There is a bug in permlane16 selection I am working on and will put up a patch for soon
  2. I'm curious how AMDGPU/permlane-op-sel.ll test passes. When I run the runline "llc -march=amdgcn -mcpu=gfx1030 -show-mc-encoding" using ToT and check the output I get "v_permlane16_b32 v0, v0, s7, s0 op_sel:[1,0] ; encoding: [0x00,0x49,0x77,0xd7,0x00,0x0f,0x00,0x20]" not what is in the check line.
foad added inline comments.Feb 21 2023, 12:08 AM
llvm/test/CodeGen/AMDGPU/permlane-op-sel.ll
11

This line doesn't do anything because ASM-CHRCK is not a check prefix

Joe_Nash added inline comments.Feb 21 2023, 1:36 PM
llvm/test/CodeGen/AMDGPU/permlane-op-sel.ll
11