[LLVMdev] [PATCH] fix outs/ins of MOV16mr instruction (X86)

Tim Northover t.p.northover at gmail.com
Tue Mar 24 19:28:29 PDT 2015


>> Why?  i16mem here stands for the pointer, not the actual memory.  A
>> store doesn't define a pointer, so why would it be in "outs"?
>
> Then why does this "i16mem:$dst" belongs to "ins"? Is that wrong, correct?

Think about a typical instruction:

    movw %ax, 1234(%rax, 4, %rbx)

The components making up the "i16mem" operand are "1234", %rax, 4 and
%rbx (+ a hidden segment register). None of those are defined/written
by the instruction (but they are read). So they need to be ins.

What's written is some nebulous memory location specified by those
operands. This isn't modelled by LLVM's basic instructions at all
(except possibly via mayLoad and mayStore).

The existing code is correct.

Cheers.

Tim.



More information about the llvm-dev mailing list