Switch default to new x86_64 backend.

This PR switches the default backend on x86, for both the
`cranelift-codegen` crate and for Wasmtime, to the new
(`MachInst`-style, `VCode`-based) backend that has been under
development and testing for some time now.

The old backend is still available by default in builds with the
`old-x86-backend` feature, or by requesting `BackendVariant::Legacy`
from the appropriate APIs.

As part of that switch, it adds some more runtime-configurable plumbing
to the testing infrastructure so that tests can be run using the
appropriate backend. `clif-util test` is now capable of parsing a
backend selector option from filetests and instantiating the correct
backend.

CI has been updated so that the old x86 backend continues to run its
tests, just as we used to run the new x64 backend separately.

At some point, we will remove the old x86 backend entirely, once we are
satisfied that the new backend has not caused any unforeseen issues and
we do not need to revert.
This commit is contained in:
Chris Fallin
2021-03-09 23:43:11 -08:00
parent b7b47e380d
commit cb48ea406e
243 changed files with 316 additions and 442 deletions

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
function %value_aliases(i32, f32, i64 vmctx) baldrdash_system_v {
gv0 = vmctx

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
; Reported as https://github.com/bytecodealliance/cranelift/issues/207
;

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
; Reported as https://github.com/bytecodealliance/cranelift/issues/216 from the Binaryen fuzzer.
;

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
function %pr227(i32 [%rdi], i32 [%rsi], i32 [%rdx], i32 [%rcx], i64 vmctx [%r8]) system_v {
gv0 = vmctx

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64
target x86_64 legacy
; Test that fallthrough returns are visited by reload and coloring.

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
; This test case would create a block parameter that was a ghost value.
; The coalescer would insert a copy of the ghost value, leading to verifier errors.

View File

@@ -1,5 +1,5 @@
test regalloc
target i686
target i686 legacy
; This test covers the troubles when values with global live ranges are defined
; by instructions with constrained register classes.

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
function %foo() system_v {
block4:

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64
target x86_64 legacy
function u0:587() fast {
block0:

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
function u0:9(i64 [%rdi], f32 [%xmm0], f64 [%xmm1], i32 [%rsi], i32 [%rdx], i64 vmctx [%r14]) -> i64 [%rax] baldrdash_system_v {
block0(v0: i64, v1: f32, v2: f64, v3: i32, v4: i32, v5: i64):

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
; Test combinations of constraints.
;

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64
target x86_64 legacy
; Return the same value twice. This needs a copy so that each value can be
; allocated its own register.

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
function %test(i64) -> i64 system_v {
block0(v0: i64):

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64 haswell
target x86_64 legacy haswell
; regex: V=v\d+
; regex: BB=block\d+

View File

@@ -1,5 +1,5 @@
test compile
target x86_64
target x86_64 legacy
; Filed as https://github.com/bytecodealliance/cranelift/issues/779
;

View File

@@ -1,5 +1,5 @@
test regalloc
target riscv32 enable_e
target riscv32 legacy enable_e
; regex: V=v\d+

View File

@@ -1,5 +1,5 @@
test regalloc
target i686 haswell
target i686 legacy haswell
function %pr165() system_v {
block0:

View File

@@ -1,7 +1,7 @@
test compile
set opt_level=speed
set enable_pinned_reg=true
target x86_64 haswell
target x86_64 legacy haswell
function u0:0(i32, i32, i32, i64 vmctx) -> i64 uext system_v {
block0(v0: i32, v1: i32, v2: i32, v3: i64):

View File

@@ -1,7 +1,7 @@
test compile
set opt_level=speed
set enable_pinned_reg=true
target x86_64 haswell
target x86_64 legacy haswell
function u0:0(i32, i32, i32, i64 vmctx) -> i64 uext system_v {
block0(v0: i32, v1: i32, v2: i32, v3: i64):

View File

@@ -1,7 +1,7 @@
test compile
set opt_level=speed
set enable_pinned_reg=true
target x86_64 haswell
target x86_64 legacy haswell
;; Test for the issue #1123; https://github.com/bytecodealliance/cranelift/issues/1123

View File

@@ -1,5 +1,5 @@
test regalloc
target x86_64
target x86_64 legacy
; Test case found by the Binaryen fuzzer.
;

View File

@@ -12,7 +12,7 @@ test regalloc
; regex: V=v\d+
; regex: WS=\s+
target riscv32 enable_e
target riscv32 legacy enable_e
; In straight-line code, the first value defined is spilled.
; That is in order:

View File

@@ -2,7 +2,7 @@
test compile
set enable_probestack=0
target x86_64 haswell
target x86_64 legacy haswell
; This function contains unreachable blocks which trip up the register
; allocator if they don't get cleared out.

View File

@@ -1,5 +1,5 @@
test regalloc
target i686
target i686 legacy
; regex: V=v\d+
; regex: BB=block\d+