[llvm] [X86] Insert CALLSEQ when lowering GlobalTLSAddress for ELF targets (PR #113706)
Fabian Ritter via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 28 06:57:13 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()) {
----------------
ritter-x2a wrote:
It definitely is awkward, I hope that the assertions that I proposed make this code at least a bit clearer. For this specific line, `getGluedUser` seems not helpful since the use of TGA that is checked here is actual data flow, not glue.
It does however apply for the lines below, ab2b4b69a93bbe599e2fc6a49b92fed39699dc8e uses `getGluedUser` there.
I'm certainly open for suggestions to make this code less awkward.
https://github.com/llvm/llvm-project/pull/113706
More information about the llvm-commits
mailing list