[llvm] [X86] Insert CALLSEQ when lowering GlobalTLSAddress for ELF targets (PR #113706)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 16:19:47 PDT 2024


================
@@ -18841,8 +18842,25 @@ GetTLSADDR(SelectionDAG &DAG, SDValue Chain, GlobalAddressSDNode *GA,
     TGA = DAG.getTargetExternalSymbol("_TLS_MODULE_BASE_", PtrVT, OperandFlags);
     auto UI = TGA->use_begin();
     // Reuse existing GetTLSADDR node if we can find it.
-    if (UI != TGA->use_end())
-      return SDValue(*UI->use_begin()->use_begin(), 0);
+    if (UI != TGA->use_end()) {
----------------
arsenm wrote:

This is awkward parsing of users of a target constant. Can you just use getGluedUser()? 

https://github.com/llvm/llvm-project/pull/113706


More information about the llvm-commits mailing list