[llvm] d311edd - [PowerPC] fix default cpu setting

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 06:55:41 PDT 2024


Author: Chen Zheng
Date: 2024-07-25T09:55:00-04:00
New Revision: d311edd0eff2095b1e5e73b4e612e7ddd8d93d70

URL: https://github.com/llvm/llvm-project/commit/d311edd0eff2095b1e5e73b4e612e7ddd8d93d70
DIFF: https://github.com/llvm/llvm-project/commit/d311edd0eff2095b1e5e73b4e612e7ddd8d93d70.diff

LOG: [PowerPC] fix default cpu setting

for platform that returns nothing for getHostCPUName()
For example for target ARM on windows. For this case, -mcpu=native
should set CPU to the default according to triple instead of setting
CPU to "native"

Fixes https://lab.llvm.org/buildbot/#/builders/161/builds/873 caused by
https://github.com/llvm/llvm-project/pull/97541

Added: 
    

Modified: 
    llvm/lib/TargetParser/PPCTargetParser.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/TargetParser/PPCTargetParser.cpp b/llvm/lib/TargetParser/PPCTargetParser.cpp
index c773c326f1841..422d758c772e1 100644
--- a/llvm/lib/TargetParser/PPCTargetParser.cpp
+++ b/llvm/lib/TargetParser/PPCTargetParser.cpp
@@ -97,7 +97,7 @@ StringRef getNormalizedPPCTargetCPU(const Triple &T, StringRef CPUName) {
     }
 
     StringRef CPU = normalizeCPUName(CPUName);
-    if (CPU != "generic")
+    if (CPU != "generic" && CPU != "native")
       return CPU;
   }
 


        


More information about the llvm-commits mailing list