[llvm] [Xtensa] Implement THREADPTR and DFPAccel Xtensa Options. (PR #145543)
Andrei Safronov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 27 06:08:00 PDT 2025
================
@@ -919,6 +920,52 @@ SDValue XtensaTargetLowering::LowerGlobalAddress(SDValue Op,
return Res;
}
+SDValue XtensaTargetLowering::LowerGlobalTLSAddress(SDValue Op,
+ SelectionDAG &DAG) const {
+ const GlobalAddressSDNode *G = cast<GlobalAddressSDNode>(Op);
+ SDLoc DL(Op);
+ auto PtrVT = Op.getValueType();
+ const GlobalValue *GV = G->getGlobal();
+
+ if (DAG.getTarget().useEmulatedTLS())
+ return LowerToTLSEmulatedModel(G, DAG);
+
+ TLSModel::Model model = getTargetMachine().getTLSModel(GV);
+
+ if (!Subtarget.hasTHREADPTR()) {
+ report_fatal_error("only emulated TLS supported");
+ }
+
+ if ((model == TLSModel::LocalExec) || (model == TLSModel::InitialExec)) {
----------------
andreisfr wrote:
Fxied
https://github.com/llvm/llvm-project/pull/145543
More information about the llvm-commits
mailing list