summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilmann Scheller <tilmann.scheller@googlemail.com>2013-09-02 12:01:58 +0000
committerTilmann Scheller <tilmann.scheller@googlemail.com>2013-09-02 12:01:58 +0000
commit024e76b69bc46a20e96eba22f2655d249c495d00 (patch)
tree4abf78e7d31a017aa2d5540a9c6059c48ebdfe99
parent4629e0da6a19ea5883ecdfca841cacb3de657d73 (diff)
downloadllvm-024e76b69bc46a20e96eba22f2655d249c495d00.tar.gz
llvm-024e76b69bc46a20e96eba22f2655d249c495d00.tar.bz2
llvm-024e76b69bc46a20e96eba22f2655d249c495d00.tar.xz
ARM: Default to Swift when compiling for iOS 6 or later.
Test cases adjusted accordingly. This fixes rdar://14871821. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189756 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/ARMSubtarget.cpp9
-rw-r--r--test/CodeGen/ARM/struct_byval.ll2
-rw-r--r--test/CodeGen/ARM/swift-atomics.ll4
3 files changed, 10 insertions, 5 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp
index 3111f5e385..a8e62e5a55 100644
--- a/lib/Target/ARM/ARMSubtarget.cpp
+++ b/lib/Target/ARM/ARMSubtarget.cpp
@@ -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() && !getTargetTriple().isOSVersionLT(6))
+ // Default to Swift for iOS 6 or later versions.
+ 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
diff --git a/test/CodeGen/ARM/struct_byval.ll b/test/CodeGen/ARM/struct_byval.ll
index 012b994853..0b3d7afe6c 100644
--- a/test/CodeGen/ARM/struct_byval.ll
+++ b/test/CodeGen/ARM/struct_byval.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=armv7-apple-ios6.0 | FileCheck %s
+; RUN: llc < %s -mtriple=armv7-apple-ios6.0 -mcpu=generic| FileCheck %s
; rdar://9877866
%struct.SmallStruct = type { i32, [8 x i32], [37 x i8] }
diff --git a/test/CodeGen/ARM/swift-atomics.ll b/test/CodeGen/ARM/swift-atomics.ll
index 1d71815571..883165fc02 100644
--- a/test/CodeGen/ARM/swift-atomics.ll
+++ b/test/CodeGen/ARM/swift-atomics.ll
@@ -1,5 +1,5 @@
-; RUN: llc -mtriple=armv7-apple-ios6.0 -mcpu=swift < %s | FileCheck %s
-; RUN: llc -mtriple=armv7-apple-ios6.0 < %s | FileCheck %s --check-prefix=CHECK-STRICT-ATOMIC
+; RUN: llc -mtriple=armv7-apple-ios6.0 < %s | FileCheck %s
+; RUN: llc -mtriple=armv7-apple-ios6.0 -mcpu=generic < %s | FileCheck %s --check-prefix=CHECK-STRICT-ATOMIC
; Release operations only need the store barrier provided by a "dmb ishst",