[llvm] [LoongArch] Modify expanding code sequence for PseudoLA_TLS_LE (PR #119696)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 18:13:46 PST 2024


================
@@ -301,7 +301,8 @@ class LoongArchTargetLowering : public TargetLowering {
   SDValue getAddr(NodeTy *N, SelectionDAG &DAG, CodeModel::Model M,
                   bool IsLocal = true) const;
   SDValue getStaticTLSAddr(GlobalAddressSDNode *N, SelectionDAG &DAG,
-                           unsigned Opc, bool UseGOT, bool Large = false) const;
+                           unsigned Opc, bool UseGOT, bool Large = false,
+                           bool IsNormalOrMediumLE = false) const;
----------------
zhaoqi5 wrote:

When TLS_LE calling `getStaticTLSAddr()`, parameter `Large` always uses the default value `false` no matter what the actual codemodel is. So `LoongArch::PseudoLA_TLS_LE && !Large` is always `true`. But we only expect `IsNormalOrMediumLE` to be true when the codemodel is actually normal or medium.

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


More information about the llvm-commits mailing list