[llvm] [AIX] Support per global code model. (PR #79202)

Sean Fertile via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 08:23:53 PST 2024


================
@@ -186,9 +186,18 @@ bool PPCSubtarget::enableSubRegLiveness() const {
 }
 
 bool PPCSubtarget::isGVIndirectSymbol(const GlobalValue *GV) const {
+  if (isAIXABI() && isa<GlobalVariable>(GV)) {
+    // On AIX the only symbols that aren't indirect are toc-data.
+    if (cast<GlobalVariable>(GV)->hasAttribute("toc-data"))
+      return false;
+
+    return true;
+  }
+
   // Large code model always uses the TOC even for local symbols.
   if (TM.getCodeModel() == CodeModel::Large)
     return true;
+
----------------
mandlebug wrote:

unintended, removed.

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


More information about the llvm-commits mailing list