From f412fddf6233cc6a2131eae40ce8e503d341b4a1 Mon Sep 17 00:00:00 2001 From: Chen Zheng Date: Thu, 25 Jul 2024 09:21:55 -0400 Subject: [PATCH] [PowerPC] fix default cpu setting Summary: 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 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250515 --- llvm/lib/TargetParser/PPCTargetParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/TargetParser/PPCTargetParser.cpp b/llvm/lib/TargetParser/PPCTargetParser.cpp index c773c326f1841b..422d758c772e14 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; }