Add ability to emit internal instruction representation to CodeGen assembly output.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 9 Jul 2014 10:07:36 +0000 (10:07 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Wed, 9 Jul 2014 10:07:36 +0000 (10:07 +0000)
commit123c38de3b2adaaa644f14c9478edb072d6b8e84
tree2e4d5db1c00d5160bb78d3893bc5c256bb6168eb
parent2ebc9426837be456e5c1ce8b1bee675e73ad5091
Add ability to emit internal instruction representation to CodeGen assembly output.

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.

Reviewers: rafael, dsanders

Reviewed By: dsanders

Subscribers: zoran.jovanovic, llvm-commits

Differential Revision: http://reviews.llvm.org/D4267

llvm-svn: 212603
llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h