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

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 02:22:26 PDT 2024


================
@@ -517,6 +517,11 @@ 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 =
+        TM.getTargetCPU().empty() ? "pwr7" : TM.getTargetCPU();
----------------
chenzheng1030 wrote:

We should use the "target-cpu" function attribute which is controlled by the clang frontend. No `-mcpu` case is also handled well in "target-cpu" function attribute. We 

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


More information about the llvm-commits mailing list