This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][AsmParser] Refine parsing cache policy modifiers.
ClosedPublic

Authored by kosarev on Dec 15 2022, 7:58 AM.

Diff Detail

Event Timeline

kosarev created this revision.Dec 15 2022, 7:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 7:58 AM
kosarev requested review of this revision.Dec 15 2022, 7:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 7:58 AM
arsenm accepted this revision.Dec 15 2022, 8:08 AM
This revision is now accepted and ready to land.Dec 15 2022, 8:08 AM
dp accepted this revision.Dec 15 2022, 10:44 AM

Very nice refactoring!

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
6049

Maybe CPolId would be better than P.

kosarev added inline comments.Dec 16 2022, 3:02 AM
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
6049

What if just CPol then? So it doesn't look like we parse an id into another id.

dp added inline comments.Dec 16 2022, 3:07 AM
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
6049

Good point. CPol is fine.

kosarev updated this revision to Diff 483470.Dec 16 2022, 3:12 AM

Renamed the P to CPol and parseCPolId() to getCPolKind() to avoid it be
looking like the other parse*() functions that actually consume tokens.

dp accepted this revision.Dec 16 2022, 3:33 AM

LGTM, thanks!

kosarev updated this revision to Diff 483950.Dec 19 2022, 6:41 AM

Sorry, missed the test change. Which also reminds me that strictly
speaking this is not an NFC.

kosarev retitled this revision from [AMDGPU][AsmParser][NFC] Refine parsing cache policy modifiers. to [AMDGPU][AsmParser] Refine parsing cache policy modifiers..Dec 19 2022, 6:41 AM