[llvm] [PowerPC][AIX] Emit PowerPC version for XCOFF (PR #95510)

Qiu Chaofan via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 03:12:15 PDT 2024


================
@@ -514,9 +514,27 @@ bool AsmPrinter::doInitialization(Module &M) {
     }
   }
 
-  // On AIX, emit bytes for llvm.commandline metadata after .file so that the
-  // C_INFO symbol is preserved if any csect is kept by the linker.
   if (TM.getTargetTriple().isOSBinFormatXCOFF()) {
+    // Emit .machine directive on AIX.
+    StringRef TargetCPU;
+    // Walk through the target-cpu attribute of functions and use the newest
+    // level as the CPU of the module.
+    for (auto &F : M) {
+      StringRef FunCPU = TM.getSubtargetImpl(F)->getCPU();
----------------
ecnelises wrote:

What does `FunCPU` mean?

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


More information about the llvm-commits mailing list