From f832b4e1d88cf3be30e7c2080b8fb11e92d3a78d Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Mon, 27 Jun 2022 11:45:10 -0700 Subject: [PATCH 1/4] Upgrade to regalloc2 v0.2.3 to get bugfix from bytecodealliance/regalloc2#60. --- Cargo.lock | 4 ++-- cranelift/codegen/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57c8c6e2bd8b..d91e1d01427d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2351,9 +2351,9 @@ dependencies = [ [[package]] name = "regalloc2" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d37148700dbb38f994cd99a1431613057f37ed934d7e4d799b7ab758c482461" +checksum = "4a8d23b35d7177df3b9d31ed8a9ab4bf625c668be77a319d4f5efd4a5257701c" dependencies = [ "fxhash", "log", diff --git a/cranelift/codegen/Cargo.toml b/cranelift/codegen/Cargo.toml index 7be601382c88..d24c8b0cb55f 100644 --- a/cranelift/codegen/Cargo.toml +++ b/cranelift/codegen/Cargo.toml @@ -23,7 +23,7 @@ serde = { version = "1.0.94", features = ["derive"], optional = true } bincode = { version = "1.2.1", optional = true } gimli = { version = "0.26.0", default-features = false, features = ["write"], optional = true } smallvec = { version = "1.6.1" } -regalloc2 = { version = "0.2.2", features = ["checker"] } +regalloc2 = { version = "0.2.3", features = ["checker"] } souper-ir = { version = "2.1.0", optional = true } # It is a goal of the cranelift-codegen crate to have minimal external dependencies. # Please don't add any unless they are essential to the task of creating binary From 210b94fcc4ec9562831d549baa3d6b4d1eefa6b3 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Mon, 27 Jun 2022 11:49:23 -0700 Subject: [PATCH 2/4] Update RELEASES.md. --- RELEASES.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index e686cbd9fdcd..6fffd7ead9e3 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,18 @@ -------------------------------------------------------------------------------- +## 0.38.1 + +Released 2022-06-27. + +### Fixed. + +* A register allocator bug was fixed that could affect direct users of + Cranelift who use struct-return (`sret`) arguments. The bug had to do with + the handling of physical register constraints in the function prologue. No + impact should be possible for users of Cranelift via the Wasm frontend, + including Wasmtime. + [regalloc2#60](https://github.com/bytecodealliance/regalloc2/pull/60) + ## 0.38.0 Released 2022-06-21. From e8d70b8c49470c48cf71971c3bd3cb26479b60ee Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Mon, 27 Jun 2022 12:19:01 -0700 Subject: [PATCH 3/4] Update two compile tests based on slightly shifting regalloc output. --- .../filetests/filetests/isa/aarch64/reftypes.clif | 8 ++++---- .../filetests/filetests/isa/s390x/reftypes.clif | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cranelift/filetests/filetests/isa/aarch64/reftypes.clif b/cranelift/filetests/filetests/isa/aarch64/reftypes.clif index 1348494e3163..7253ae6c9ae5 100644 --- a/cranelift/filetests/filetests/isa/aarch64/reftypes.clif +++ b/cranelift/filetests/filetests/isa/aarch64/reftypes.clif @@ -72,20 +72,20 @@ block3(v7: r64, v8: r64): ; ldr x3, 8 ; b 12 ; data TestCase { length: 1, ascii: [102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } + 0 ; blr x3 ; mov x9, sp -; ldr x10, [sp, #8] -; str x10, [x9] +; ldr x11, [sp, #8] +; str x11, [x9] ; and w7, w0, #1 ; cbz x7, label1 ; b label3 ; block1: ; b label2 ; block2: -; mov x1, x10 +; mov x1, x11 ; ldr x0, [sp, #16] ; b label5 ; block3: ; b label4 ; block4: -; mov x0, x10 +; mov x0, x11 ; ldr x1, [sp, #16] ; b label5 ; block5: diff --git a/cranelift/filetests/filetests/isa/s390x/reftypes.clif b/cranelift/filetests/filetests/isa/s390x/reftypes.clif index 673bed07cc40..8314f33a0a9d 100644 --- a/cranelift/filetests/filetests/isa/s390x/reftypes.clif +++ b/cranelift/filetests/filetests/isa/s390x/reftypes.clif @@ -74,21 +74,21 @@ block3(v7: r64, v8: r64): ; bras %r1, 12 ; data %f + 0 ; lg %r5, 0(%r1) ; basr %r14, %r5 ; la %r3, 160(%r15) -; lg %r4, 168(%r15) -; stg %r4, 0(%r3) -; llcr %r5, %r2 -; chi %r5, 0 +; lg %r5, 168(%r15) +; stg %r5, 0(%r3) +; llcr %r4, %r2 +; chi %r4, 0 ; jgnlh label1 ; jg label3 ; block1: ; jg label2 ; block2: -; lgr %r3, %r4 +; lgr %r3, %r5 ; lg %r2, 176(%r15) ; jg label5 ; block3: ; jg label4 ; block4: -; lgr %r2, %r4 +; lgr %r2, %r5 ; lg %r3, 176(%r15) ; jg label5 ; block5: From 79bade0b233d6b1ff2cffde3e3f3225196536ad2 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Mon, 27 Jun 2022 12:21:56 -0700 Subject: [PATCH 4/4] Add dividing line in RELEASES.md as per format. --- RELEASES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 6fffd7ead9e3..486497a5fec4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -13,6 +13,8 @@ Released 2022-06-27. including Wasmtime. [regalloc2#60](https://github.com/bytecodealliance/regalloc2/pull/60) +-------------------------------------------------------------------------------- + ## 0.38.0 Released 2022-06-21.