Hi all, I have a question about the types of MachineOperand. There are 12 different types of MachineOperand such as MO_Register, MO_Immediate and so on. Some of the names are self-explanatory such as MO_Register and MO_Immediate. Some of them are a little confusing such as MO_FrameIndex, MO_ConstantPoolIndex and so on. For example, what is the different between MO_ExternalSymbol and MO_GlobalAddress? Are these two types orthogonal? I found that memset and memcpy are MO_ExternalSymbol and printf and fprintf and so on are MO_GlobalAddress. Thanks a lot in advance. Any advice will be greatly appreciated. Bin
On Mar 2, 2011, at 8:34 PM, Bin Zeng wrote:> Hi all, > > I have a question about the types of MachineOperand. There are 12 > different types of MachineOperand such as MO_Register, MO_Immediate and > so on. Some of the names are self-explanatory such as MO_Register and > MO_Immediate. Some of them are a little confusing such as MO_FrameIndex, > MO_ConstantPoolIndex and so on. For example, what is the different > between MO_ExternalSymbol and MO_GlobalAddress? Are these two types > orthogonal? I found that memset and memcpy are MO_ExternalSymbol and > printf and fprintf and so on are MO_GlobalAddress. > > Thanks a lot in advance. Any advice will be greatly appreciated.GlobalAddress is used to refer to something that exists in IR, such as a global variable. ExternalSymbol is used to refer to something that isn't in the IR because it was synthesized by codegen, such as __addsi3. -Chris
On Mar 3, 2011, at 2:30 PM, Bin Zeng wrote:>>> >>> Thanks a lot in advance. Any advice will be greatly appreciated. >> GlobalAddress is used to refer to something that exists in IR, such as a global variable. ExternalSymbol is used to refer to something that isn't in the IR because it was synthesized by codegen, such as __addsi3. >> >> -Chris > > Thanks for the quick reply. According to your reply, memset and memcpy are synthesized by codegen? I saw memcpy in the source file. Did it get optimized out in the IR and later codegen synthesized memset and memcpy?Yes, codegen does synthesize memcpy in some cases, also memset. -Chris
Apparently Analagous Threads
- [LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
- [LLVMdev] MachineOperand: GlobalAddress vs. ExternalSymbol
- [LLVMdev] [llvm-commits] [llvm] r162770 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h lib/CodeGen/MachineInstr.cpp
- [LLVMdev] [llvm-commits] [llvm] r162770 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h lib/CodeGen/MachineInstr.cpp
- [LLVMdev] [llvm-commits] [llvm] r162770 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h lib/CodeGen/MachineInstr.cpp