[PATCH] D110681: [X86][ISel] Lowering llvm.thread.pointer
LuoYuanke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 7 18:45:29 PDT 2021
LuoYuanke added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:26724
+ Value *Ptr = Constant::getNullValue(Type::getInt8PtrTy(
+ *DAG.getContext(), Subtarget.is64Bit() ? 257 : 256));
+ return DAG.getLoad(PtrVT, dl, DAG.getEntryNode(),
----------------
pengfei wrote:
> X86::FS, X86::GS?
> X86::FS, X86::GS?
Should be X86AS::FS and X86AS::GS.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:26725
+ *DAG.getContext(), Subtarget.is64Bit() ? 257 : 256));
+ return DAG.getLoad(PtrVT, dl, DAG.getEntryNode(),
+ DAG.getIntPtrConstant(0, dl), MachinePointerInfo(Ptr));
----------------
Not sure about the chain. It accesses memory.
================
Comment at: llvm/test/CodeGen/X86/thread_pointer.ll:21
+; X86: # %bb.0:
+; X86-NEXT: movl %gs:0, %eax
+; X86-NEXT: retl
----------------
The first entry of the TLS store the pointer of itself. Right?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110681/new/
https://reviews.llvm.org/D110681
More information about the llvm-commits
mailing list