forked from OSchip/llvm-project
Set TargetCPUName for AIX to default to pwr7.
Summary: Set the TargetCPUName for AIX to default to pwr7, removing the setting of it based on the major/minor of the OS version, which previously set it to pwr4 for AIX 7.1 and earlier. The old code would also set it to pwr4 when the OS version was not specified and with the change, it will default it to pwr7 in all cases. Author: Jamie Schmeiser <schmeise@ca.ibm.com> Reviewed By:hubert.reinterpretcast (Hubert Tong) Differential Revision: https://reviews.llvm.org/D107063
This commit is contained in:
parent
a90da62adb
commit
c3c1826c31
|
@ -403,14 +403,9 @@ std::string tools::getCPUName(const ArgList &Args, const llvm::Triple &T,
|
||||||
if (!TargetCPUName.empty())
|
if (!TargetCPUName.empty())
|
||||||
return TargetCPUName;
|
return TargetCPUName;
|
||||||
|
|
||||||
if (T.isOSAIX()) {
|
if (T.isOSAIX())
|
||||||
unsigned major, minor, unused_micro;
|
TargetCPUName = "pwr7";
|
||||||
T.getOSVersion(major, minor, unused_micro);
|
else if (T.getArch() == llvm::Triple::ppc64le)
|
||||||
// The minimal arch level moved from pwr4 for AIX7.1 to
|
|
||||||
// pwr7 for AIX7.2.
|
|
||||||
TargetCPUName =
|
|
||||||
(major < 7 || (major == 7 && minor < 2)) ? "pwr4" : "pwr7";
|
|
||||||
} else if (T.getArch() == llvm::Triple::ppc64le)
|
|
||||||
TargetCPUName = "ppc64le";
|
TargetCPUName = "ppc64le";
|
||||||
else if (T.getArch() == llvm::Triple::ppc64)
|
else if (T.getArch() == llvm::Triple::ppc64)
|
||||||
TargetCPUName = "ppc64";
|
TargetCPUName = "ppc64";
|
||||||
|
|
|
@ -2,18 +2,36 @@
|
||||||
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
||||||
// RUN: -target powerpc-ibm-aix7.2 \
|
// RUN: -target powerpc-ibm-aix7.2 \
|
||||||
// RUN: | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
|
// RUN: | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
|
||||||
|
|
||||||
|
// Check that the target cpu defaults to power7 on AIX7.2 and up.
|
||||||
|
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
||||||
|
// RUN: -target powerpc64-ibm-aix7.2 \
|
||||||
|
// RUN: | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
|
||||||
|
|
||||||
|
// Check that the target cpu defaults to power7 on AIX7.1 and below.
|
||||||
|
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
||||||
|
// RUN: -target powerpc-ibm-aix7.1 \
|
||||||
|
// RUN: | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
|
||||||
|
|
||||||
|
// Check that the target cpu defaults to power7 on AIX7.1 and below.
|
||||||
|
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
||||||
|
// RUN: -target powerpc64-ibm-aix7.1 \
|
||||||
|
// RUN: | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
|
||||||
|
|
||||||
|
// Check that the target cpu defaults to power7 when level not specified.
|
||||||
|
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
||||||
|
// RUN: -target powerpc-ibm-aix \
|
||||||
|
// RUN: | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
|
||||||
|
|
||||||
|
// Check that the target cpu defaults to power7 when level not specified.
|
||||||
|
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
||||||
|
// RUN: -target powerpc64-ibm-aix \
|
||||||
|
// RUN: | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
|
||||||
|
|
||||||
// CHECK-MCPU-DEFAULT-AIX72-NOT: warning:
|
// CHECK-MCPU-DEFAULT-AIX72-NOT: warning:
|
||||||
// CHECK-MCPU-DEFAULT-AIX72: {{.*}}clang{{.*}}" "-cc1"
|
// CHECK-MCPU-DEFAULT-AIX72: {{.*}}clang{{.*}}" "-cc1"
|
||||||
// CHECK-MCPU-DEFAULT-AIX72: "-target-cpu" "pwr7"
|
// CHECK-MCPU-DEFAULT-AIX72: "-target-cpu" "pwr7"
|
||||||
|
|
||||||
// Check that the target cpu defaults to power4 on AIX7.1 and below.
|
|
||||||
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
|
||||||
// RUN: -target powerpc-ibm-aix7.1 \
|
|
||||||
// RUN: | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX71 %s
|
|
||||||
// CHECK-MCPU-DEFAULT-AIX71-NOT: warning:
|
|
||||||
// CHECK-MCPU-DEFAULT-AIX71: {{.*}}clang{{.*}}" "-cc1"
|
|
||||||
// CHECK-MCPU-DEFAULT-AIX71: "-target-cpu" "pwr4"
|
|
||||||
|
|
||||||
// Check that the user is able to overwrite the default with '-mcpu'.
|
// Check that the user is able to overwrite the default with '-mcpu'.
|
||||||
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
// RUN: %clang -no-canonical-prefixes %s -### -c 2>&1 \
|
||||||
// RUN: -mcpu=pwr6 \
|
// RUN: -mcpu=pwr6 \
|
||||||
|
|
Loading…
Reference in New Issue