Cranellift: remove Baldrdash support and related features. (#4571)

* Cranellift: remove Baldrdash support and related features.

As noted in Mozilla's bugzilla bug 1781425 [1], the SpiderMonkey team
has recently determined that their current form of integration with
Cranelift is too hard to maintain, and they have chosen to remove it
from their codebase. If and when they decide to build updated support
for Cranelift, they will adopt different approaches to several details
of the integration.

In the meantime, after discussion with the SpiderMonkey folks, they
agree that it makes sense to remove the bits of Cranelift that exist
to support the integration ("Baldrdash"), as they will not need
them. Many of these bits are difficult-to-maintain special cases that
are not actually tested in Cranelift proper: for example, the
Baldrdash integration required Cranelift to emit function bodies
without prologues/epilogues, and instead communicate very precise
information about the expected frame size and layout, then stitched
together something post-facto. This was brittle and caused a lot of
incidental complexity ("fallthrough returns", the resulting special
logic in block-ordering); this is just one example. As another
example, one particular Baldrdash ABI variant processed stack args in
reverse order, so our ABI code had to support both traversal
orders. We had a number of other Baldrdash-specific settings as well
that did various special things.

This PR removes Baldrdash ABI support, the `fallthrough_return`
instruction, and pulls some threads to remove now-unused bits as a
result of those two, with the  understanding that the SpiderMonkey folks
will build new functionality as needed in the future and we can perhaps
find cleaner abstractions to make it all work.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1781425

* Review feedback.

* Fix (?) DWARF debug tests: add `--disable-cache` to wasmtime invocations.

The debugger tests invoke `wasmtime` from within each test case under
the control of a debugger (gdb or lldb). Some of these tests started to
inexplicably fail in CI with unrelated changes, and the failures were
only inconsistently reproducible locally. It seems to be cache related:
if we disable cached compilation on the nested `wasmtime` invocations,
the tests consistently pass.

* Review feedback.
This commit is contained in:
Chris Fallin
2022-08-02 12:37:56 -07:00
committed by GitHub
parent ff37c9d8a4
commit 43f1765272
57 changed files with 221 additions and 1134 deletions

View File

@@ -20,7 +20,7 @@ block0(v0: i64):
; ret
function %f2(i32) -> i64 {
fn0 = %g(i32 uext) -> i64 baldrdash_system_v
fn0 = %g(i32 uext) -> i64
block0(v0: i32):
v1 = call fn0(v0)
@@ -29,41 +29,22 @@ block0(v0: i32):
; stp fp, lr, [sp, #-16]!
; mov fp, sp
; stp x27, x28, [sp, #-16]!
; stp x25, x26, [sp, #-16]!
; stp x23, x24, [sp, #-16]!
; stp x21, x22, [sp, #-16]!
; stp x19, x20, [sp, #-16]!
; stp d14, d15, [sp, #-16]!
; stp d12, d13, [sp, #-16]!
; stp d10, d11, [sp, #-16]!
; stp d8, d9, [sp, #-16]!
; block0:
; mov w0, w0
; ldr x5, 8 ; b 12 ; data TestCase { length: 1, ascii: [103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } + 0
; blr x5
; ldp d8, d9, [sp], #16
; ldp d10, d11, [sp], #16
; ldp d12, d13, [sp], #16
; ldp d14, d15, [sp], #16
; ldp x19, x20, [sp], #16
; ldp x21, x22, [sp], #16
; ldp x23, x24, [sp], #16
; ldp x25, x26, [sp], #16
; ldp x27, x28, [sp], #16
; ldp fp, lr, [sp], #16
; ret
function %f3(i32) -> i32 uext baldrdash_system_v {
function %f3(i32) -> i32 uext {
block0(v0: i32):
return v0
}
; block0:
; mov w0, w0
; ret
function %f4(i32) -> i64 {
fn0 = %g(i32 sext) -> i64 baldrdash_system_v
fn0 = %g(i32 sext) -> i64
block0(v0: i32):
v1 = call fn0(v0)
@@ -72,38 +53,19 @@ block0(v0: i32):
; stp fp, lr, [sp, #-16]!
; mov fp, sp
; stp x27, x28, [sp, #-16]!
; stp x25, x26, [sp, #-16]!
; stp x23, x24, [sp, #-16]!
; stp x21, x22, [sp, #-16]!
; stp x19, x20, [sp, #-16]!
; stp d14, d15, [sp, #-16]!
; stp d12, d13, [sp, #-16]!
; stp d10, d11, [sp, #-16]!
; stp d8, d9, [sp, #-16]!
; block0:
; sxtw x0, w0
; ldr x5, 8 ; b 12 ; data TestCase { length: 1, ascii: [103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } + 0
; blr x5
; ldp d8, d9, [sp], #16
; ldp d10, d11, [sp], #16
; ldp d12, d13, [sp], #16
; ldp d14, d15, [sp], #16
; ldp x19, x20, [sp], #16
; ldp x21, x22, [sp], #16
; ldp x23, x24, [sp], #16
; ldp x25, x26, [sp], #16
; ldp x27, x28, [sp], #16
; ldp fp, lr, [sp], #16
; ret
function %f5(i32) -> i32 sext baldrdash_system_v {
function %f5(i32) -> i32 sext {
block0(v0: i32):
return v0
}
; block0:
; sxtw x0, w0
; ret
function %f6(i8) -> i64 {
fn0 = %g(i32, i32, i32, i32, i32, i32, i32, i32, i8 sext) -> i64

View File

@@ -2,7 +2,6 @@ test compile precise-output
set unwind_info=false
target aarch64
;; Test default (non-SpiderMonkey) ABI.
function %f() -> i64, i64 {
block1:
v0 = iconst.i64 1

View File

@@ -1,7 +1,6 @@
test compile precise-output
target s390x
;; Test default (non-SpiderMonkey) ABI.
function %f1() -> i64, i64, i64, i64 {
block1:
v0 = iconst.i64 1

View File

@@ -10,13 +10,13 @@ block1:
; nextln: return
; nextln: }
function %r1() -> i32, f32 baldrdash_system_v {
function %r1() -> i32, f32 {
block1:
v1 = iconst.i32 3
v2 = f32const 0.0
return v1, v2
}
; sameln: function %r1() -> i32, f32 baldrdash_system_v {
; sameln: function %r1() -> i32, f32
; nextln: block1:
; nextln: v1 = iconst.i32 3
; nextln: v2 = f32const 0.0
@@ -25,13 +25,13 @@ block1:
function %signatures() {
sig10 = ()
sig11 = (i32, f64) -> i32, b1 baldrdash_system_v
sig11 = (i32, f64) -> i32, b1
fn5 = %foo sig11
fn8 = %bar(i32) -> b1
}
; sameln: function %signatures() fast {
; check: sig10 = () fast
; check: sig11 = (i32, f64) -> i32, b1 baldrdash_system_v
; check: sig11 = (i32, f64) -> i32, b1
; check: sig12 = (i32) -> b1 fast
; not: fn0
; check: fn5 = %foo sig11