akirilov-arm opened PR #2960 from leaf_functions
to main
:
Leaf functions that do not use the stack (e.g. do not clobber any callee-saved registers) do not need a frame record; this has been discussed in issue #1148. I am not familiar with the ABIs of other architectures, so I don't know if it is safe to apply the same optimization, and that's why only the AArch64 backend does it.
@cfallin I'd appreciate any feedback on how these changes interact with unwinding; in particular, do we need an
Inst::Unwind
pseudo-instruction for the simple leaf functions we are optimizing?cc @abrown @bnjbvr @uweigand
akirilov-arm updated PR #2960 from leaf_functions
to main
.
cfallin submitted PR review.
cfallin created PR review comment:
Strictly speaking, this is always
false
on s390x, I think (though its generated prologues/epilogues are empty so it does not actually matter what we return here)?
cfallin submitted PR review.
cfallin created PR review comment:
If I am understanding the refactoring in the common
abi_impl.rs
code correctly, it seems that this should basically Just Work on x64 as well, I think?Though it's strictly out of scope for a "simplify leaf functions on aarch64" PR, since the code is shared I think I'd prefer to retain the correspondence here and turn this leaf-function mode on for both platforms. Would you mind trying this out, if it's not too much trouble?
akirilov-arm submitted PR review.
akirilov-arm created PR review comment:
Sure, I can change the return value to
false
, but I can't test. @uweigand, any objections?
akirilov-arm submitted PR review.
akirilov-arm created PR review comment:
I replaced the check here with the one from the AArch64 backend (and made another similar change), but unfortunately it was not enough and I started getting test failures. However, that made me realize that there were no unwind test for AArch64 (such as these), neither were the GC tests enabled, so now I am not sure that even my AArch64 implementation is complete. I'll make some testing changes in separate pull requests and then I'll come back to this.
akirilov-arm updated PR #2960 from leaf_functions
to main
.
akirilov-arm updated PR #2960 from leaf_functions
to main
.
akirilov-arm updated PR #2960 from leaf_functions
to main
.
akirilov-arm updated PR #2960 from leaf_functions
to main
.
Last updated: Nov 22 2024 at 17:03 UTC