[clang] [llvm] [PowerPC] Tune AIX shared library TLS model at function level by heuristic (PR #84132)

Amy Kwan via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 21 10:55:44 PDT 2024


================
@@ -848,6 +848,14 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr *MI) {
         return MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSLE;
       if (Model == TLSModel::InitialExec)
         return MCSymbolRefExpr::VariantKind::VK_PPC_AIX_TLSIE;
+      // On AIX, TLS model heuristic may have turned local-dynamic access into
+      // initial-exec access.
+      PPCFunctionInfo *FuncInfo = MF->getInfo<PPCFunctionInfo>();
+      if (Model == TLSModel::LocalDynamic && FuncInfo->isAIXFuncUseTLSIE()) {
+        LLVM_DEBUG(
+            dbgs() << "Current function use IE access for default LD vars.\n");
----------------
amy-kwan wrote:

```suggestion
            dbgs() << "Current function uses IE access for default LD vars.\n");
```

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


More information about the cfe-commits mailing list