summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2015-01-29 15:59:09 +0000
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>2015-01-29 15:59:09 +0000
commit8cf15ced8ca334e177dd7416ba1d8df0e57ba170 (patch)
treeaf95c5ff5b5060072ccf5daa9d11766f40508e5f /llvm/lib/Target/PowerPC/PPCSubtarget.cpp
parent78bfb7c3a772330fe735f8c70dd1d6c212bb6056 (diff)
downloadbcm5719-llvm-8cf15ced8ca334e177dd7416ba1d8df0e57ba170.tar.gz
bcm5719-llvm-8cf15ced8ca334e177dd7416ba1d8df0e57ba170.zip
[PowerPC] Complete setting the baseline for ppc64le
Patch by Nemanja Ivanovic. As was uncovered by the failing test case (when run on non-PPC platforms), the feature set when compiling with -march=ppc64le was not being picked up. This change ensures that if the -mcpu option is not specified, the correct feature set is picked up regardless of whether we are on PPC or not. llvm-svn: 227455
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCSubtarget.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCSubtarget.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
index 115c7b49427..c753e68fe39 100644
--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
@@ -95,8 +95,13 @@ void PPCSubtarget::initializeEnvironment() {
void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
// Determine default and user specified characteristics
std::string CPUName = CPU;
- if (CPUName.empty())
- CPUName = "generic";
+ if (CPUName.empty()) {
+ // If cross-compiling with -march=ppc64le without -mcpu
+ if (TargetTriple.getArch() == Triple::ppc64le)
+ CPUName = "ppc64le";
+ else
+ CPUName = "generic";
+ }
#if (defined(__APPLE__) || defined(__linux__)) && \
(defined(__ppc__) || defined(__powerpc__))
if (CPUName == "generic")
OpenPOWER on IntegriCloud