[PATCH] D11546: WebAssembly: add a generic CPU

JF Bastien jfb at chromium.org
Mon Jul 27 16:26:08 PDT 2015


jfb created this revision.
jfb added subscribers: sunfish, llvm-commits.
Herald added a subscriber: jfb.

WebAssemblySubtarget.cpp expects a default 'generic' CPU to exist, and this seems to be prevalent with other targets. It makes sense to have something between MVP and bleeding-edge, even though for now it's the same as MVP. This removes a warning that's currently generated.

http://reviews.llvm.org/D11546

Files:
  lib/Target/WebAssembly/WebAssembly.td
  test/CodeGen/WebAssembly/cpus.ll

Index: test/CodeGen/WebAssembly/cpus.ll
===================================================================
--- test/CodeGen/WebAssembly/cpus.ll
+++ test/CodeGen/WebAssembly/cpus.ll
@@ -2,6 +2,8 @@
 
 ; RUN: llc < %s -mtriple=wasm32-unknown-unknown -mcpu=mvp 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=wasm64-unknown-unknown -mcpu=mvp 2>&1 | FileCheck %s
+; RUN: llc < %s -mtriple=wasm32-unknown-unknown -mcpu=generic 2>&1 | FileCheck %s
+; RUN: llc < %s -mtriple=wasm64-unknown-unknown -mcpu=generic 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=wasm32-unknown-unknown -mcpu=bleeding-edge 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=wasm64-unknown-unknown -mcpu=bleeding-edge 2>&1 | FileCheck %s
 ; RUN: llc < %s -mtriple=wasm32-unknown-unknown -mcpu=invalidcpu 2>&1 | FileCheck %s --check-prefix=INVALID
Index: lib/Target/WebAssembly/WebAssembly.td
===================================================================
--- lib/Target/WebAssembly/WebAssembly.td
+++ lib/Target/WebAssembly/WebAssembly.td
@@ -50,6 +50,9 @@
 // Minimal Viable Product.
 def : ProcessorModel<"mvp", NoSchedModel, []>;
 
+// Generic processor: latest stable version.
+def : ProcessorModel<"generic", NoSchedModel, []>;
+
 // Latest and greatest experimental version of WebAssembly. Bugs included!
 def : ProcessorModel<"bleeding-edge", NoSchedModel, [FeatureSIMD128]>;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11546.30762.patch
Type: text/x-patch
Size: 1354 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150727/cd5e50ed/attachment.bin>


More information about the llvm-commits mailing list