Rafael EspĂndola
2006-Oct-16 20:51 UTC
[LLVMdev] TargetExternalSymbol and TargetGlobalAddress
I have noticed that TargetGlobalAddress is generated for "source code" functions and TargetExternalSymbol is generated for builtins like __lshrdi3. What is the difference between TargetExternalSymbol and TargetGlobalAddress? Thanks, Rafael
Chris Lattner
2006-Oct-17 18:30 UTC
[LLVMdev] TargetExternalSymbol and TargetGlobalAddress
On Mon, 16 Oct 2006, [UTF-8] Rafael Esp?ndola wrote:> I have noticed that TargetGlobalAddress is generated for "source code" > functions and TargetExternalSymbol is generated for builtins like > __lshrdi3. What is the difference between TargetExternalSymbol and > TargetGlobalAddress?The only real difference is that one exists in the LLVM code and one doesn't. :) In particular, TargetExternalSymbol's are limited to being defined in some other module, but TargetGlobalAddress can be defined in the current module. TargetExternalSymbol is a somewhat ugly solution to handle things like "__lshrdi3" or "malloc", which don't necessarily exist in the LLVM .bc file. Previously we would add new prototypes to represent these things to the LLVM module, but we aim to have the code generator not modify the LLVM module at all. In my opinion, a better overall design would be to have the lowering phase totally eliminate LLVM GlobalValue references, making everything in the code generator be a reference to a lowered name. This would simplify several pieces of code, particularly the x86 backend. -Chris -- http://nondot.org/sabre/ http://llvm.org/
Seemingly Similar Threads
- [LLVMdev] Subsuming a memory node of a TargetGlobalAddress with a TargetConstant node
- Ensuring chain dependencies with expansion to libcalls
- [LLVMdev] A few questions from a newbie
- [LLVMdev] A few questions from a newbie
- How to constraint instructions reordering from patterns?