s390x: update some regalloc metadata to remove use of reg_mod. (#4856)

* s390x: update some regalloc metadata to remove use of `reg_mod`.

This is a step toward ultimately removing modify-operands, which along
with removal of pinned vregs, lets us move to a completely
constraint-based and fully-SSA regalloc input and get some nice
advantages eventually.

There are still a few uses of `mod` operands and pinned vregs remaining,
especially around the "regpair" abstraction. Those proved to be a bit
trickier to update though, so will have to be done separately.

* Review feedback: restore two-arg pretty-print form.

* Review feedback.
This commit is contained in:
Chris Fallin
2022-09-09 18:43:36 -05:00
committed by GitHub
parent 2986f6b0ff
commit 96bfd4e8c0
16 changed files with 653 additions and 420 deletions

View File

@@ -178,6 +178,20 @@ pub fn pretty_print_reg(reg: Reg, allocs: &mut AllocationConsumer<'_>) -> String
show_reg(reg)
}
pub fn pretty_print_reg_mod(
rd: Writable<Reg>,
ri: Reg,
allocs: &mut AllocationConsumer<'_>,
) -> String {
let output = allocs.next_writable(rd).to_reg();
let input = allocs.next(ri);
if output == input {
show_reg(output)
} else {
format!("{}<-{}", show_reg(output), show_reg(input))
}
}
pub fn pretty_print_fpr(reg: Reg, allocs: &mut AllocationConsumer<'_>) -> (String, Option<String>) {
let reg = allocs.next(reg);
(show_reg(reg), maybe_show_fpr(reg))