Upgrade to regalloc2 version 0.2.1. (#4199)

This resolves an edge-case where mul.i128 with an input that continues
to be live after the instruction could cause an invalid regalloc
constraint (basically, the regalloc did not previously support an
instruction use and def both being constrained to the same physical reg;
and the "mul" variant used for mul.i128 on x64 was the only instance of
such operands in Cranelift).

Causes two extra move instructions in the mul.i128 filetest, but that's
the price to pay for the slightly more general (works in all cases)
handling of the constraints.
This commit is contained in:
Chris Fallin
2022-06-01 13:26:20 -07:00
committed by GitHub
parent 704db02e00
commit 8f61eb9341
3 changed files with 10 additions and 8 deletions

4
Cargo.lock generated
View File

@@ -2351,9 +2351,9 @@ dependencies = [
[[package]] [[package]]
name = "regalloc2" name = "regalloc2"
version = "0.2.0" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99e5ed49768d554b34463e467c27af849a7335c051d3ac402c4755f8366c6e0b" checksum = "dac38642b54866528dc69ab1d8d041cd13f5546a928b911004ab52611be66b3d"
dependencies = [ dependencies = [
"fxhash", "fxhash",
"log", "log",

View File

@@ -23,7 +23,7 @@ serde = { version = "1.0.94", features = ["derive"], optional = true }
bincode = { version = "1.2.1", optional = true } bincode = { version = "1.2.1", optional = true }
gimli = { version = "0.26.0", default-features = false, features = ["write"], optional = true } gimli = { version = "0.26.0", default-features = false, features = ["write"], optional = true }
smallvec = { version = "1.6.1" } smallvec = { version = "1.6.1" }
regalloc2 = { version = "0.2.0", features = ["checker"] } regalloc2 = { version = "0.2.1", features = ["checker"] }
souper-ir = { version = "2.1.0", optional = true } souper-ir = { version = "2.1.0", optional = true }
# It is a goal of the cranelift-codegen crate to have minimal external dependencies. # 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 # Please don't add any unless they are essential to the task of creating binary

View File

@@ -115,13 +115,15 @@ block0(v0: i128, v1: i128):
; block0: ; block0:
; movq %rdi, %r9 ; movq %rdi, %r9
; imulq %r9, %rcx, %r9 ; imulq %r9, %rcx, %r9
; movq %rdi, %rax
; imulq %rsi, %rdx, %rsi ; imulq %rsi, %rdx, %rsi
; addq %r9, %rsi, %r9 ; movq %r9, %r8
; addq %r8, %rsi, %r8
; movq %r8, %r9
; movq %rdi, %rax
; mul %rax, %rdx, %rax, %rdx ; mul %rax, %rdx, %rax, %rdx
; movq %r9, %rdi ; movq %r9, %r11
; addq %rdi, %rdx, %rdi ; addq %r11, %rdx, %r11
; movq %rdi, %r9 ; movq %r11, %r9
; movq %r9, %rdx ; movq %r9, %rdx
; movq %rbp, %rsp ; movq %rbp, %rsp
; popq %rbp ; popq %rbp