[PATCH] D70490: [mips] Add a 'generic' Mips CPU

Miloš Stojanović via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 06:46:33 PST 2019


mstojanovic created this revision.
mstojanovic added reviewers: atanasyan, petarj, Petar.Avramovic.
Herald added subscribers: hiraditya, arichardson, sdardis.
Herald added a project: LLVM.

Having a generic CPU removes a warning when creating a subtarget without the CPU being explicitly specified.


https://reviews.llvm.org/D70490

Files:
  llvm/lib/Target/Mips/Mips.td
  llvm/test/CodeGen/Mips/cpus.ll


Index: llvm/test/CodeGen/Mips/cpus.ll
===================================================================
--- llvm/test/CodeGen/Mips/cpus.ll
+++ llvm/test/CodeGen/Mips/cpus.ll
@@ -1,5 +1,9 @@
 ; Check that the CPU names work.
 
+; RUN: llc -mtriple=mips -mcpu=generic -filetype=obj < %s \
+; RUN:   | llvm-readelf -A | FileCheck %s --check-prefix=GENERIC
+; GENERIC: ISA: MIPS32
+
 ; RUN: llc -mtriple=mips -mcpu=mips2 -filetype=obj < %s \
 ; RUN:   | llvm-readelf -A | FileCheck %s --check-prefix=MIPS2
 ; MIPS2: ISA: MIPS2
Index: llvm/lib/Target/Mips/Mips.td
===================================================================
--- llvm/lib/Target/Mips/Mips.td
+++ llvm/lib/Target/Mips/Mips.td
@@ -232,6 +232,7 @@
 class Proc<string Name, list<SubtargetFeature> Features>
  : ProcessorModel<Name, MipsGenericModel, Features>;
 
+def : Proc<"generic", []>;
 def : Proc<"mips1", [FeatureMips1]>;
 def : Proc<"mips2", [FeatureMips2]>;
 def : Proc<"mips32", [FeatureMips32]>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70490.230246.patch
Type: text/x-patch
Size: 973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191120/cea4712d/attachment-0001.bin>


More information about the llvm-commits mailing list