ARM: Default to the Swift CPU when targeting armv7s/thumbv7s.
authorTilmann Scheller <tilmann.scheller@googlemail.com>
Mon, 2 Sep 2013 17:09:01 +0000 (17:09 +0000)
committerTilmann Scheller <tilmann.scheller@googlemail.com>
Mon, 2 Sep 2013 17:09:01 +0000 (17:09 +0000)
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

lib/Target/ARM/ARMSubtarget.cpp
test/CodeGen/ARM/dagcombine-concatvector.ll

index 3111f5e385ee2023b45b6579e55b1af751ae6e9c..e9254c3d90c66c16ad82463f4898f7a83e1ef9a6 100644 (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
index d8c6c6455801c867966bf88d6899d5ddb5515860..2927ea2f3ca9e5c8b611ddd7365600ca31ffa1ec 100644 (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: