Skip to content

Commit 0807bc7

Browse files
committed
[wasm-ld] Update supported features in the generic CPU configuration
Accompanying https://reviews.llvm.org/D125728, this updates LLVM Codegen's "generic" CPU to enable the same new features. Differential Revision: https://reviews.llvm.org/D125729
1 parent 31b9dad commit 0807bc7

38 files changed

+80
-72
lines changed

lld/test/wasm/function-imports-first.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret32.s -o %t.ret32.o
2-
; RUN: llc -filetype=obj %s -o %t.o
2+
; RUN: llc -mcpu=mvp -filetype=obj %s -o %t.o
33
; RUN: wasm-ld -o %t.wasm %t.o %t.ret32.o
44
; RUN: obj2yaml %t.wasm | FileCheck %s
55

lld/test/wasm/gc-sections.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc -filetype=obj %s -o %t.o
1+
; RUN: llc -mcpu=mvp -filetype=obj %s -o %t.o
22
; RUN: yaml2obj %S/Inputs/globals.yaml -o %t_globals.o
33
; RUN: wasm-ld -print-gc-sections -o %t1.wasm %t.o %t_globals.o | \
44
; RUN: FileCheck %s -check-prefix=PRINT-GC

lld/test/wasm/init-fini.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -filetype=obj -o %t.o %s
2-
; RUN: llc -filetype=obj %S/Inputs/global-ctor-dtor.ll -o %t.global-ctor-dtor.o
1+
; RUN: llc -mcpu=mvp -filetype=obj -o %t.o %s
2+
; RUN: llc -mcpu=mvp -filetype=obj %S/Inputs/global-ctor-dtor.ll -o %t.global-ctor-dtor.o
33

44
target triple = "wasm32-unknown-unknown"
55

lld/test/wasm/local-symbols.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; Test that internal symbols can still be GC'd when with --export-dynamic.
2-
; RUN: llc -filetype=obj %s -o %t.o
2+
; RUN: llc -mcpu=mvp -filetype=obj %s -o %t.o
33
; RUN: wasm-ld --export-dynamic -o %t.wasm %t.o
44
; RUN: obj2yaml %t.wasm | FileCheck %s
55

lld/test/wasm/locals-duplicate.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -filetype=obj %p/Inputs/locals-duplicate1.ll -o %t1.o
2-
; RUN: llc -filetype=obj %p/Inputs/locals-duplicate2.ll -o %t2.o
1+
; RUN: llc -mcpu=mvp -filetype=obj %p/Inputs/locals-duplicate1.ll -o %t1.o
2+
; RUN: llc -mcpu=mvp -filetype=obj %p/Inputs/locals-duplicate2.ll -o %t2.o
33
; RUN: wasm-ld --export-dynamic --no-entry -o %t.wasm %t1.o %t2.o
44
; RUN: obj2yaml %t.wasm | FileCheck %s
55

lld/test/wasm/signature-mismatch-export.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret32.s -o %t.ret32.o
2-
; RUN: llc -filetype=obj %s -o %t.main.o
2+
; RUN: llc -mcpu=mvp -filetype=obj %s -o %t.main.o
33
; RUN: wasm-ld --export=ret32 -o %t.wasm %t.main.o %t.ret32.o
44
; RUN: obj2yaml %t.wasm | FileCheck %s
55

lld/test/wasm/weak-alias-overide.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -filetype=obj -o %t.o %s
2-
; RUN: llc -filetype=obj %S/Inputs/weak-alias.ll -o %t2.o
1+
; RUN: llc -mcpu=mvp -filetype=obj -o %t.o %s
2+
; RUN: llc -mcpu=mvp -filetype=obj %S/Inputs/weak-alias.ll -o %t2.o
33
; RUN: wasm-ld --export-dynamic %t.o %t2.o -o %t.wasm
44
; RUN: obj2yaml %t.wasm | FileCheck %s
55

lld/test/wasm/weak-alias.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; RUN: llc -filetype=obj -o %t.o %s
2-
; RUN: llc -filetype=obj %S/Inputs/weak-alias.ll -o %t2.o
1+
; RUN: llc -mcpu=mvp -filetype=obj -o %t.o %s
2+
; RUN: llc -mcpu=mvp -filetype=obj %S/Inputs/weak-alias.ll -o %t2.o
33
; RUN: wasm-ld --export-dynamic %t.o %t2.o -o %t.wasm
44
; RUN: obj2yaml %t.wasm | FileCheck %s
55

llvm/lib/Target/WebAssembly/WebAssembly.td

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ def WebAssemblyInstrInfo : InstrInfo;
9797
def : ProcessorModel<"mvp", NoSchedModel, []>;
9898

9999
// Generic processor: latest stable version.
100-
def : ProcessorModel<"generic", NoSchedModel, []>;
100+
//
101+
// This includes features that have achieved phase 4 of the standards process,
102+
// and that are expected to work for most users in the current time, with
103+
// consideration given to available support in relevant engines and tools, and
104+
// the importance of the features.
105+
def : ProcessorModel<"generic", NoSchedModel,
106+
[FeatureSignExt, FeatureMutableGlobals]>;
101107

102108
// Latest and greatest experimental version of WebAssembly. Bugs included!
103109
def : ProcessorModel<"bleeding-edge", NoSchedModel,

llvm/test/CodeGen/WebAssembly/PR41149.ll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ define void @mod() {
1313
; CHECK-NEXT: i32.load8_u 0
1414
; CHECK-NEXT: local.tee 0
1515
; CHECK-NEXT: local.get 0
16-
; CHECK-NEXT: i32.const 24
17-
; CHECK-NEXT: i32.shl
18-
; CHECK-NEXT: i32.const 31
16+
; CHECK-NEXT: i32.extend8_s
17+
; CHECK-NEXT: i32.const 7
1918
; CHECK-NEXT: i32.shr_s
2019
; CHECK-NEXT: local.tee 0
2120
; CHECK-NEXT: i32.xor

0 commit comments

Comments
 (0)