Stream: cranelift

Topic: Cold calling convention


view this post on Zulip Kristian H. Kristensen (Jun 15 2023 at 11:52):

Is there a calling convention that forces no callee saved registers? Is that what CallConv::Cold? I'm calling into something that can't guarantee it won't clobber callee saved registers, and instead of brute force spilling all callee save regs, it would be better to make the caller do that since it knows which of them are live.

view this post on Zulip Chris Fallin (Jun 15 2023 at 15:58):

Currently Cold doesn't do anything different, but we could implement an "all-caller-saved" convention; I'm happy to point to the relevant bits (basically cranelift/codegen/src/{machinst/abi.rs,isa/*/abi.rs}) if you want to take a crack at this

view this post on Zulip Jamey Sharp (Jun 15 2023 at 16:04):

@fitzgen (he/him) has recently been working on making the tail-call convention have no callee-saved registers, and while you likely wouldn't want to use that convention since it does other things, that work should demonstrate how to do what you want. I don't see that Nick has pushed that branch anywhere yet though.

view this post on Zulip fitzgen (he/him) (Jun 15 2023 at 16:08):

slight aside: I think we should consider making fast have no callee-save registers, and cold having no caller-save registers

I haven't pushed my WIP branch for the tail calling convention anywhere yet, I've become distracted with fuzz bugs. can do that soon

view this post on Zulip fitzgen (he/him) (Jun 15 2023 at 17:35):

This is my WIP work to make all registers callee-save on the tail calling convention: https://github.com/bytecodealliance/wasmtime/commit/f9a9c5a8ae1618928b9208dab2e718e0209a91db

Note that I've only implemented it for x64 and aarch64 so far, no riscv64 or s390x yet.

…ng convention

view this post on Zulip Kristian H. Kristensen (Jun 15 2023 at 20:45):

Ok, thanks for the pointers, I might take a look


Last updated: Nov 22 2024 at 16:03 UTC