Skip to content

Commit

Permalink
[PowerPC] fix default cpu setting
Browse files Browse the repository at this point in the history
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
#97541

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250515
  • Loading branch information
chenzheng1030 authored and yuxuanchen1997 committed Jul 25, 2024
1 parent 2e97c09 commit f412fdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/TargetParser/PPCTargetParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit f412fdd

Please sign in to comment.