[llvm-dev] OPERAND_MEMORY in MCOperandInfo

Ahmed Bougacha via llvm-dev llvm-dev at lists.llvm.org
Thu May 5 17:51:26 PDT 2016

On Thu, May 5, 2016 at 5:09 PM, Tom Chen via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hi,
> I am working on a class project that needs to generate random MachineInstrs,
> and I am confused as to what "OPERAND_MEMORY" means in MCOI::OperandKind;

All it means is that a given MCOperand is used by the instruction to
"address memory".

I don't think it's used in LLVM proper, but it's used by some LLVM
clients to do smarter disassembly (you can probably find some ancient
references to edis).

> specifically, what are the possible types of an MachineOperand (reg, and
> imm?) when that operand is labeled "OPERAND_MEMORY"?

OPERAND_MEMORY doesn't say anything about the operand type.  For
instance, on x86, addressing mode are represented by 5 operands (regs
and imms [0]), and all should be marked as OPERAND_MEMORY.


[0] http://llvm.org/docs/CodeGenerator.html#representing-x86-addressing-modes-in-machineinstrs

> Thanks,
> Tom
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

More information about the llvm-dev mailing list