This is an archive of the discontinued LLVM Phabricator instance.

Add ability to emit internal instruction representation to CodeGen assembly output.
ClosedPublic

Authored by dsanders on Jun 24 2014, 3:02 AM.

Details

Summary

This patch re-uses the implementation of 'llvm-mc -show-inst' and makes it
available to llc as 'llc -asm-show-inst'.

This is necessary to test parts of MIPS32r6/MIPS64r6 without resorting to
'llc -filetype=obj' tests. For example, on MIPS32r2 and earlier we use the
'jr $rs' instruction for indirect branches and returns. On MIPS32r6, we no
longer have 'jr $rs' and use 'jalr $zero, $rs' instead. The catch is that,
on MIPS32r6, 'jr $rs' is an alias for 'jalr $zero, $rs' and is the preferred
way of writing this instruction. As a result, all MIPS ISA's emit 'jr $rs' in
their assembly output and the assembler encodes this to different opcodes
according to the ISA.

Using this option, we can check that the MCInst really is a JR or a JALR by
matching the emitted comment. This removes the need for a 'llc -filetype=obj'
test.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 10777.Jun 24 2014, 3:02 AM
dsanders retitled this revision from to Add ability to emit internal instruction representation to CodeGen assembly output. This patch re-uses the implementation of 'llvm-mc -show-inst' and makes it available to llc as 'llc -asm-show-inst'. This is necessary to test parts of....
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: rafael.
dsanders added a subscriber: Unknown Object (MLST).
dsanders retitled this revision from Add ability to emit internal instruction representation to CodeGen assembly output. This patch re-uses the implementation of 'llvm-mc -show-inst' and makes it available to llc as 'llc -asm-show-inst'. This is necessary to test parts of... to Add ability to emit internal instruction representation to CodeGen assembly output..Jun 24 2014, 3:03 AM
dsanders updated this object.
dsanders accepted this revision.Jul 9 2014, 3:15 AM
dsanders added a reviewer: dsanders.
This revision is now accepted and ready to land.Jul 9 2014, 3:15 AM
dsanders closed this revision.Jul 9 2014, 3:15 AM