1Pull in r199024 from upstream llvm trunk (by Venkatraman Govindaraju): 2 3 [Sparc] Add missing processor types: v7 and niagara 4 5Introduced here: http://svnweb.freebsd.org/changeset/base/262261 6 7Index: lib/Target/Sparc/Sparc.td 8=================================================================== 9--- lib/Target/Sparc/Sparc.td 10+++ lib/Target/Sparc/Sparc.td 11@@ -56,6 +56,7 @@ class Proc<string Name, list<SubtargetFeature> Fea 12 : Processor<Name, NoItineraries, Features>; 13 14 def : Proc<"generic", []>; 15+def : Proc<"v7", []>; 16 def : Proc<"v8", []>; 17 def : Proc<"supersparc", []>; 18 def : Proc<"sparclite", []>; 19@@ -67,7 +68,10 @@ def : Proc<"tsc701", []>; 20 def : Proc<"v9", [FeatureV9]>; 21 def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated]>; 22 def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated]>; 23-def : Proc<"ultrasparc3-vis", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>; 24+def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated]>; 25+def : Proc<"niagara2", [FeatureV9, FeatureV8Deprecated]>; 26+def : Proc<"niagara3", [FeatureV9, FeatureV8Deprecated]>; 27+def : Proc<"niagara4", [FeatureV9, FeatureV8Deprecated]>; 28 29 def SparcAsmWriter : AsmWriter { 30 string AsmWriterClassName = "InstPrinter"; 31Index: lib/Target/Sparc/SparcSubtarget.cpp 32=================================================================== 33--- lib/Target/Sparc/SparcSubtarget.cpp 34+++ lib/Target/Sparc/SparcSubtarget.cpp 35@@ -35,13 +35,8 @@ SparcSubtarget::SparcSubtarget(const std::string & 36 37 // Determine default and user specified characteristics 38 std::string CPUName = CPU; 39- if (CPUName.empty()) { 40- if (is64Bit) 41- CPUName = "v9"; 42- else 43- CPUName = "v8"; 44- } 45- IsV9 = CPUName == "v9"; 46+ if (CPUName.empty()) 47+ CPUName = (is64Bit) ? "v9" : "v8"; 48 49 // Parse features string. 50 ParseSubtargetFeatures(CPUName, FS); 51Index: test/CodeGen/SPARC/ctpop.ll 52=================================================================== 53--- test/CodeGen/SPARC/ctpop.ll 54+++ test/CodeGen/SPARC/ctpop.ll 55@@ -1,6 +1,13 @@ 56 ; RUN: llc < %s -march=sparc -mattr=-v9 | FileCheck %s -check-prefix=V8 57 ; RUN: llc < %s -march=sparc -mattr=+v9 | FileCheck %s -check-prefix=V9 58-; RUN: llc < %s -march=sparcv9 | FileCheck %s -check-prefix=SPARC64 59+; RUN: llc < %s -march=sparc -mcpu=v9 | FileCheck %s -check-prefix=V9 60+; RUN: llc < %s -march=sparc -mcpu=ultrasparc | FileCheck %s -check-prefix=V9 61+; RUN: llc < %s -march=sparc -mcpu=ultrasparc3 | FileCheck %s -check-prefix=V9 62+; RUN: llc < %s -march=sparc -mcpu=niagara | FileCheck %s -check-prefix=V9 63+; RUN: llc < %s -march=sparc -mcpu=niagara2 | FileCheck %s -check-prefix=V9 64+; RUN: llc < %s -march=sparc -mcpu=niagara3 | FileCheck %s -check-prefix=V9 65+; RUN: llc < %s -march=sparc -mcpu=niagara4 | FileCheck %s -check-prefix=V9 66+; RUN: llc < %s -march=sparcv9 | FileCheck %s -check-prefix=SPARC64 67 68 declare i32 @llvm.ctpop.i32(i32) 69 70