Stream: git-wasmtime

Topic: wasmtime / PR #2483 x64 regalloc register order: put call...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 06:38):

cfallin opened PR #2483 from x64-regalloc-register-order to main:

The x64 backend currently builds the RealRegUniverse in a way that
is generating somewhat suboptimal code. In many blocks, we see uses of
callee-save (non-volatile) registers (r12, r13, r14, rbx) first, even in
very short leaf functions where there are plenty of volatiles to use.
This is leading to unnecessary spills/reloads.

On one (local) test program, a medium-sized C benchmark compiled to Wasm
and run on Wasmtime, I am seeing a ~10% performance improvement with
this change; it will be less pronounced in programs with high register
pressure (there we are likely to use all registers regardless, so the
prologue/epilogue will save/restore all callee-saves), or in programs
with fewer calls, but this is a clear win for small functions and in
many cases removes prologue/epilogue clobber-saves altogether.

Separately, I think the RA's coalescing is tripping up a bit in some
cases; see e.g. the filetest touched by this commit that loads a value
into %rsi then moves to %rax and returns immediately. This is an
orthogonal issue, though, and should be addressed (if worthwhile) in
regalloc.rs.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 06:38):

cfallin requested julian-seward1 for a review on PR #2483.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 07:52):

bnjbvr submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 07 2020 at 16:53):

cfallin merged PR #2483.


Last updated: Oct 23 2024 at 20:03 UTC