This will be used for __builtin_thread_pointer in clang.
Diff Detail
- Repository
- rL LLVM
Event Timeline
This is missing documentation. It *looks* like you're trying to get the
thread local storage pointer. Is that correct? This can't be reviewed
without context and documented intent.
Philip
This is indeed intended to fetch the TLS pointer: http://llvm.org/docs/LangRef.html#llvm-thread-pointer-intrinsic . For x86, this is simply the FS/GS base, ie. pointer to end of the TLS area. The intent is to support __builtin_thread_pointer() in clang, which comes useful in some strange places (eg. sanitizer_common uses it for aarch64, and could use it for x86 too if only gcc supported it as well).
Hi Marcin,
Would this work for all x86 platforms? Is this supposed to be Linux specific? If so, lacks appropriate checking.
@Manman, would this work out-of-the-box for Darwin?
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
17827 | What these constants mean? Please document it a comment |
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
17825 | This isn't true for windows. |
This isn't true for windows.