From: drahn Date: Fri, 14 May 2021 01:15:54 +0000 (+0000) Subject: Initial enablment of EMULTLS on RiscV X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f9151a4c5438587052ec5f4a344b78db4cbfb96d;p=openbsd Initial enablment of EMULTLS on RiscV Uncertain if this is 100% correct, however this enables self hosting using clang. --- diff --git a/gnu/llvm/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/gnu/llvm/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 03d9eefd59d..17f06abbfb3 100644 --- a/gnu/llvm/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/gnu/llvm/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -634,6 +634,10 @@ SDValue RISCVTargetLowering::getDynamicTLSAddr(GlobalAddressSDNode *N, SDValue RISCVTargetLowering::lowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const { + const GlobalAddressSDNode *GA = cast(Op); + if (DAG.getTarget().useEmulatedTLS()) + return LowerToTLSEmulatedModel(GA, DAG); + SDLoc DL(Op); EVT Ty = Op.getValueType(); GlobalAddressSDNode *N = cast(Op);