[LoongArch] Support llvm.thread.pointer
authorWANG Xuerui <git@xen0n.name>
Mon, 26 Sep 2022 01:55:21 +0000 (09:55 +0800)
committerWeining Lu <luweining@loongson.cn>
Mon, 26 Sep 2022 01:56:42 +0000 (09:56 +0800)
commitf89f0990db44b390cbe73ccf8a8d853adf674a73
tree072a74fb85b14dcacacfbc708f669c5b7f870a2c
parenta5676a3a7eab3a295ae0482162089a4e366bf9d2
[LoongArch] Support llvm.thread.pointer

For `__builtin_thread_pointer` to work, among other things.

Similar to D76828 for RISCV.

Differential Revision: https://reviews.llvm.org/D134368
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
llvm/lib/Target/LoongArch/LoongArchISelLowering.h
llvm/test/CodeGen/LoongArch/thread-pointer.ll [new file with mode: 0644]