-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the tail calling convention by default #8540
Enable the tail calling convention by default #8540
Conversation
3522c5c
to
beb7738
Compare
Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
beb7738
to
68bc800
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Out of curiosity do you know if a sightglass run has been done to confirm there's no perf regression?
Otherwise though I see how this is a little tricky to handle this. I'm wary of how this is currently implemented. We've tried to avoid interactions where one feature silently enables another or interacts with another and this is adding a bit of that with relation to the tail call handling.
Could the validation/etc be done without needing mut self
on Config::validate
? Instead could this preserve the &self
-ness and perhaps add other validations to ensure the stars align right?
I did some perf testing during the initial tail-call refactoring PRs and didn't notice any regression in perf. I'll do another sightglass run with this branch to verify that. We initially tried to implement this in |
Do you think it would be workable to enable tail calls by default except for s390x and then have a validation check that tail calls aren't enabled for winch? That would require |
Where would we set the default for |
Yep, there were multiple runs at various points here, and there is no longer any gap between
We tried to do this in The only alternatives I see are
|
Ah sorry yeah I was thinking As a bikeshed, though, how about restructuring this slightly? Something like:
Also, in the case that |
Oh also no need to worry about perf, just wanted to double check, sounds like plenty of due diligence |
15838b4
to
d5f95a2
Compare
crates/wasmtime/src/config.rs
Outdated
// Enable tail calls by default when cranelift is going to be used as the compilation | ||
// strategy, and we're not targeting s390x, which currently lacks tail-call support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind also editing this to cover that this logic is only applicable if tail calls were not otherwise explicitly disabled or enabled? (aka explaining the .is_none()
)
Switch to enabling the wasm tail call feature by default when the target is one of
x86_64
,aarch64
, orriscv64
, and the compilation strategy iscranelift
. We also added tests checking that the feature is not enabled for either winch or thes390x
backend.Co-authored-by: Nick Fitzgerald fitzgen@gmail.com