rust/compiler/rustc_codegen_cranelift/src/abi
Simonas Kazlauskas 6db94dbc25 abi: add a rust-preserve-none calling convention
This is the conceptual opposite of the rust-cold calling convention and
is particularly useful in combination with the new `explicit_tail_calls`
feature.

For relatively tight loops implemented with tail calling (`become`) each
of the function with the regular calling convention is still responsible
for restoring the initial value of the preserved registers. So it is not
unusual to end up with a situation where each step in the tail call loop
is spilling and reloading registers, along the lines of:

    foo:
        push r12
        ; do things
        pop r12
        jmp next_step

This adds up quickly, especially when most of the clobberable registers
are already used to pass arguments or other uses.

I was thinking of making the name of this ABI a little less LLVM-derived
and more like a conceptual inverse of `rust-cold`, but could not come
with a great name (`rust-cold` is itself not a great name: cold in what
context? from which perspective? is it supposed to mean that the
function is rarely called?)
2026-01-24 19:23:17 +02:00
..
comments.rs remove explicit deref of AbiAlign for most methods 2025-09-28 15:02:14 -07:00
mod.rs abi: add a rust-preserve-none calling convention 2026-01-24 19:23:17 +02:00
pass_mode.rs Merge commit 'a0b865dc87' into sync_cg_clif-2025-11-08 2025-11-08 14:18:53 +00:00
returning.rs Merge commit '979dcf8e2f' into sync_cg_clif-2025-05-25 2025-05-25 18:51:16 +00:00