-
Notifications
You must be signed in to change notification settings - Fork 5.4k
ZJIT #13131
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
Merged
Merged
ZJIT #13131
+25,686
−139
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as spam.
This comment was marked as spam.
74a8e4c
to
6b4db2d
Compare
Also make pc a VALUE instead of ptr to VALUE
Need to read the index
* Remove redundant statements * Remove .clone() since A64 implements Copy * Remove .clone() since InsnId implements Copy . * Dereference since *const rb_call_data implements Copy * Remove unnecessary return statement * Remove unnecessary braces * Use .is_empty() over length checks * Remove unnecessary conversion handling Since i32 can always fit into i64 (the inner type in Opnd::Imm), the conversion is infallibile. * Use slice notation in lieu of Vec https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg * Simplify match statement
We want to return representatives for the stack and locals.
* Remove immediately deferenced borrow operators source: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow * Remove unnecessary cast as i64 Since Const::CInt64 wraps i64, it is unnecessary to cast to i64. * Remove unnecessary borrow operators * Beautify assign operation syntax * Use .is_null() convenience method * Omit .into() call from u32 to u32 * Use more descriptive std::ptr::null<VALUE>() In lieu of casting a literal as a type, opt to use the convenience type. * Use sized integer literal * Simplify pattern matching to explicit check
* Add --zjit-profile-interval option * Fix min to max * Avoid rewriting instructions for --zjit-call-threshold=1 * Rename the option to --zjit-num-profiles
* Disable ZJIT profiling at call-threshold * Stop referencing ZJIT instructions in codegen
In case the callee writes to the caller's locals, we need to be able to immediately side-exit because our frame's invariants might have been invalidated. If in the course of optimization we rewrite the Send, we can choose to remove the PatchPoint too---but it's not an error to keep it around.
A new optimization pass. Also: - Printing for `Insn::CCall` - Wrap `ID` and add convenience method for printing, replacing calls to rb_id2name()
We don't want to only guard on the class
We need to keep the Snapshot instruction alive.
Helps with readability and threads type info that's there around for longer. Amend test so `GuardType` doesn't DCE'ed.
* Implement JIT-to-JIT calls * Use a closer dummy address for Arm64 * Revert an obsoleted change * Revert a few more obsoleted changes * Fix outdated comments * Explain PosMarkers for CCall * s/JIT code/machine code/ * Get rid of ParallelMov
* Show failing test * Add second test case * Add empty NewArray setup * Update opt_tests and fix NewArray instantiation * Add code generation for NewArray * Add NewArray ordering test
This makes the output a little nicer when doing --zjit-dump-hir=all
👏 👏 👏 👏 👏 🎉 🎉 🎉 🎉 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR upstreams ZJIT to CRuby. [Feature #21221]
As the ticket clarifies, ZJIT is not yet ready for evaluation; it doesn't implement side exits or invalidations, so most benchmarks crash.
For now, YJIT and ZJIT cannot be enabled together. When rustc is available, YJIT is enabled by default, and ZJIT is disabled. If you configure with
--enable-zjit
, you can build ZJIT. We have a branch that allows to support YJIT and ZJIT in the same build, but that's going to be merged separately from this PR.Some commit messages refer to PRs in Shopify/zjit to link past discussions. The repository is currently private, but we're going to publish it shortly.