]> granicus.if.org Git - llvm/commitdiff
Reapply 272328 and 272329 as a single patch.
authorAlina Sbirlea <asbirlea@google.com>
Thu, 9 Jun 2016 23:04:15 +0000 (23:04 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Thu, 9 Jun 2016 23:04:15 +0000 (23:04 +0000)
[cpu-detection] [amdfam10] Return barcelona, and amdfam10 for all other
subtypes. Address Bug 28067.

Along with the refactoring of Host.cpp, getHostCPUName() was modified to
return more precise types for CPUs in amdfam10.
However, callers of getHostCPUName() do string matching on type, so this
cannot be modified.
Currently there is support in the x86 backend for barcelona.
For all other subtypes the assumed return value is amdfam10.

Fix: getHostCPUName() returns barcelona subtype and amdfam10 for all
others. This can be extended further when support for the other subtypes
is added.

Differential revision: http://reviews.llvm.org/D21193

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272333 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Host.cpp

index 7c6447b74b18685c4d280f2a8b8c72f44068dc85..e1ed96a030132121f94c46dacb4ac5fce6f62693 100644 (file)
@@ -869,16 +869,9 @@ StringRef sys::getHostCPUName() {
         return "athlon";
       }
     case AMDFAM10H:
-      switch (Subtype) {
-      case AMDFAM10H_BARCELONA:
-        return "amdfam10-barcelona";
-      case AMDFAM10H_SHANGHAI:
-        return "amdfam10-shanghai";
-      case AMDFAM10H_ISTANBUL:
-        return "amdfam10-istanbul";
-      default:
-        return "amdfam10";
-      }
+      if(Subtype == AMDFAM10H_BARCELONA)
+        return "barcelona";
+      return "amdfam10";
     case AMDFAM14H:
       return "btver1";
     case AMDFAM15H: