From f9151a4c5438587052ec5f4a344b78db4cbfb96d Mon Sep 17 00:00:00 2001 From: drahn Date: Fri, 14 May 2021 01:15:54 +0000 Subject: [PATCH] Initial enablment of EMULTLS on RiscV Uncertain if this is 100% correct, however this enables self hosting using clang. --- gnu/llvm/llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.20.1