This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] fix operand printing failure on dissassembly (LIGHTNING-260)
ClosedPublic

Authored by vpykhtin on Aug 9 2016, 8:55 AM.

Details

Summary

There're cases when our TD instruction definitions has "silent" bugs (operand name mismatch between In/out dags and encoding fields) which may lead to a situation when instruction has less operands than expected on disassembly. While this definitely requires a fix for such mismatches, it would be nice if operand printer not crash when no operand is met on such instruction. This fix prints such operands as missing.

Diff Detail

Repository
rL LLVM

Event Timeline

vpykhtin updated this revision to Diff 67357.Aug 9 2016, 8:55 AM
vpykhtin retitled this revision from to [AMDGPU] fix operand printing failure on dissassembly (LIGHTNING-260).
vpykhtin updated this object.
vpykhtin added reviewers: tstellarAMD, nhaustov.
vpykhtin set the repository for this revision to rL LLVM.
vpykhtin added a project: Restricted Project.
arsenm accepted this revision.Aug 10 2016, 12:22 PM
arsenm added a reviewer: arsenm.

LGTM

This revision is now accepted and ready to land.Aug 10 2016, 12:22 PM
arsenm added inline comments.Aug 10 2016, 12:23 PM
test/MC/Disassembler/AMDGPU/missing_op.txt
4 ↗(On Diff #67357)

Is this a valid assembler comment syntax? Should this be ; missing x y z?

vpykhtin added inline comments.Aug 11 2016, 4:31 AM
test/MC/Disassembler/AMDGPU/missing_op.txt
4 ↗(On Diff #67357)

You're right that would be better, but unfortunatelly I have to print it upon printOperand entry and this creates such "intermediate" comment. Otherwise I would need to accumulate comment line and print it sometime afterwards. Anyway this assembler text shouldn't be assembled so I think such comment would be ok.

This revision was automatically updated to reflect the committed changes.