ARM: Default to the Swift CPU when targeting armv7s/thumbv7s.

Test cases adjusted accordingly.

This fixes rdar://14871821.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189766 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tilmann Scheller 2013-09-02 17:09:01 +00:00
parent 5bed440eb1
commit 195dd8a1ce
2 changed files with 8 additions and 3 deletions

View File

@ -133,8 +133,13 @@ void ARMSubtarget::resetSubtargetFeatures(const MachineFunction *MF) {
}
void ARMSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
if (CPUString.empty())
CPUString = "generic";
if (CPUString.empty()) {
if (isTargetIOS() && TargetTriple.getArchName().endswith("v7s"))
// Default to the Swift CPU when targeting armv7s/thumbv7s.
CPUString = "swift";
else
CPUString = "generic";
}
// Insert the architecture feature derived from the target triple into the
// feature string. This is important for setting features that are implied

View File

@ -1,4 +1,4 @@
; RUN: llc < %s -mtriple=thumbv7s-apple-ios3.0.0 | FileCheck %s
; RUN: llc < %s -mtriple=thumbv7s-apple-ios3.0.0 -mcpu=generic | FileCheck %s
; PR15525
; CHECK-LABEL: test1: