This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Assembler: rework parsing of optional operands.
ClosedPublic

Authored by SamWot on May 23 2016, 9:26 AM.

Details

Summary

Change process of parsing of optional operands. All optional operands use same parsing method - parseOptionalOperand().
No default values are added to OperandsVector.
Get rid of WORKAROUND_USE_DUMMY_OPERANDS_INSTEAD_MUTIPLE_DEFAULT_OPERANDS.

Diff Detail

Repository
rL LLVM

Event Timeline

SamWot updated this revision to Diff 58108.May 23 2016, 9:26 AM
SamWot retitled this revision from to [AMDGPU] Assembler: rework parsing of optional operands..
SamWot updated this object.
artem.tamazov accepted this revision.May 23 2016, 11:28 AM
artem.tamazov edited edge metadata.

Please go ahead after minor fixing. Overall, good job, thanks!

lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
93 ↗(On Diff #58108)

There are many places like this, with comments which look useless. If you plan to get rid of those later, please put TODO or FIXME (or use #ifdef). Otherwise, remove.

2664 ↗(On Diff #58108)

newline

This revision is now accepted and ready to land.May 23 2016, 11:28 AM
SamWot updated this revision to Diff 58209.May 24 2016, 2:11 AM
SamWot edited edge metadata.

Removed unnecessary commented code.

vpykhtin accepted this revision.May 24 2016, 4:40 AM
vpykhtin edited edge metadata.

I love to delete code.

lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
2250 ↗(On Diff #58209)

while this can be submitted for now I think this can be enhanced to determine optional parser by operand prefix. Most of them starts with identifier (except for bits that may have "no" before them) which can be used as a key to select optional operand parser.

This revision was automatically updated to reflect the committed changes.