Qingan Li
2011-Jan-29 02:34 UTC
[LLVMdev] The type or size of virtual registers in machineinstr
Hi, I want to know what is the type or size of a virtual register in a Machineinstr::MachineOperand (If this MachineOperand is a register). For example, what is the size of reg16385 in the following MachineInstr. I know now in the llvm bitcode, the type of a Instruction could be obtained from the Value::GetType(), but what is the counterpart in MachineInstr (not derived from class Value)? %reg16385<def> = MOV32rm <fi#0>, 1, %reg0, 0, %reg0; mem:LD4[%x_addr] GR32:%reg16385 -- Best regards, Li Qingan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110129/9cb9b514/attachment.html>
Jakob Stoklund Olesen
2011-Jan-29 03:29 UTC
[LLVMdev] The type or size of virtual registers in machineinstr
On Jan 28, 2011, at 6:34 PM, Qingan Li wrote:> I want to know what is the type or size of a virtual register in a Machineinstr::MachineOperand (If this MachineOperand is a register). For example, what is the size of reg16385 in the following MachineInstr. I know now in the llvm bitcode, the type of a Instruction could be obtained from the Value::GetType(), but what is the counterpart in MachineInstr (not derived from class Value)? > > %reg16385<def> = MOV32rm <fi#0>, 1, %reg0, 0, %reg0; mem:LD4[%x_addr] GR32:%reg16385There are no types in machine code, that is not tracked by the code generator. The size of a register is not completely well defined (think of x87), but TargetRegisterClass::getSize() will tell you the size of the spill slot that the register allocator would use for the register. /jakob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 1929 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110128/5e6b2e9a/attachment.bin>