This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Reduce repetition in SMEM instruction definitions
ClosedPublic

Authored by foad on Mar 30 2023, 4:27 AM.

Details

Reviewers
dp
Group Reviewers
Restricted Project
Commits
rG939fbef3ea2e: [AMDGPU] Reduce repetition in SMEM instruction definitions
Summary

This tries to remove all cases where we repeat the instruction name as
both an identifier (the tablegen name) and as a string (the assembler/
disassembler name). It uses tablegen's new !tolower operator.

Diff Detail

Event Timeline

foad created this revision.Mar 30 2023, 4:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2023, 4:27 AM
foad requested review of this revision.Mar 30 2023, 4:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2023, 4:27 AM
foad added a subscriber: dp.Mar 30 2023, 4:28 AM

@dp @kosarev what do you think? Is this going too far? If not we could apply the same technique to other *Instructions.td files.

piotr added a subscriber: piotr.Mar 30 2023, 4:31 AM

LGTM - looks cleaner than the version before the change.

dp accepted this revision.Mar 30 2023, 5:58 AM

LGTM. Nice refactoring!

This revision is now accepted and ready to land.Mar 30 2023, 5:58 AM
This revision was automatically updated to reflect the committed changes.

More of that would be great.

llvm/lib/Target/AMDGPU/SMInstructions.td
347

nit: These spaces after < here and below might need some more treatment.

foad added inline comments.Mar 31 2023, 3:11 AM
llvm/lib/Target/AMDGPU/SMInstructions.td
347

Whoops. Fixed in 6b6303ac0024.