[llvm-dev] target porting : objdump is not giving proper registers.

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sun Dec 10 23:57:35 PST 2017


Hi Mahesh,

On 11 December 2017 at 06:41, Mahesh Bodapati via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> we have seen proper register numbers when we have generated assembly files
> through clang but when we generated dump files from object file then we didn't see expected
> register numbers.

I assume this is a backend you're writing? Those encodings have a lot
of 0s in them, so I'm guessing the object file is what's wrong rather
than the dumper.

Have you made sure you have fields in your instructions whose names
match the registers in the (outs) and (ins) and get assigned to the
"Inst" bitfield? That's how TableGen knows where to encode each
register.

You should look for calls to getMachineOpValue in
build/lib/Target/XYZ/XYZGenMCCodeEmitter.inc, both in the source and
with a debugger to make sure it's actually being called and doing what
you expect.

Cheers.

Tim.


More information about the llvm-dev mailing list