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

Amy Kwan via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 08:20:51 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;
+
----------------
amy-kwan wrote:

Unnecessary new line? Or was this intended?

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


More information about the llvm-commits mailing list