summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-04-18Add a skipped test case for opt_mult overflowTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Implement all basic Fixnum instructions ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/50) * Implement all basic Fixnum instructions * Use opnd! macro for other instructions as well Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Compile FixnumLt (https://github.com/Shopify/zjit/pull/48)Max Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add comments to testsMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add diff_text to pretty-print IR differences in unit test failuresMax Bernstein
This produces errors that look like thread 'hir::tests::test_display_types' panicked at src/hir.rs:1777:9: assertion `left == right` failed: Differences found (-expected, +actual): --- bb0(): v0:NilClassExact = Const Value(nil) v2:TrueClassExact = Const Value(true) v6:CBool[true] = Test v2 - IfFalse v6, bb1(v) + IfFalse v6, bb1(v2) v9:Fixnum[3] = Const Value(3) Return v9 bb1(v12): v14 = Const Value(4) Return v14 --- instead of just left: "bb0():\n v0:NilClassExact = Const Value(nil)\n v2:TrueClassExact = Const Value(true)\n v6:CBool[true] = Test v2\n IfFalse v6, bb1(v2)\n v9:Fixnum[3] = Const Value(3)\n Return v9\nbb1(v12):\n v14 = Const Value(4)\n Return v14\n" right: "bb0():\n v0:NilClassExact = Const Value(nil)\n v2:TrueClassExact = Const Value(true)\n v6:CBool[true] = Test v2\n IfFalse v6, bb1(v)\n v9:Fixnum[3] = Const Value(3)\n Return v9\nbb1(v12):\n v14 = Const Value(4)\n Return v14\n" Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add commented out if-else test to test_zjit.rbMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Remove reference to nonexistent functionMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add intraprocedural flow typing (https://github.com/Shopify/zjit/pull/23)Max Bernstein
* Add RPO * Add basic flow typing * Add more tests, check for type bit equality * Run to fixpoint * Only use/flow types if insn has an output * WIP * WIP 2: merge pred args * It compiles again * Infer more Const instructions * Boot VM * Test displaying types * . * Use type_of more * Extract Param inference into its own function for readability * . * . * Add notion of unions to generated type bit patterns * . * . * Fix hierarchy for user/exact * . * . * . * Give ArraySet a receiver * Use Function::find consistently * s/fd/find/g * Comment * . * Add TODO about recursion * FrameStateId * Use worklist based type inference This requires computing "uses", or at least which blocks to revisit if their params change. * Just use a set * Revert "Just use a set" This reverts commit 54d88be00cbf78ce7e928c66d955c968187a5ec9. * Revert "Use worklist based type inference" This reverts commit e99b24629723c8848fefd5a75caa23e84c2f552e. * . * Store block params separately * Sparse type inference * Get tests passing after rebase * . * Use assert_method_hir * . Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add while loop test to test_zjit.rbMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add small test for setlocalMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Set a return value before popping registers ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/41) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix a comment for subtractionTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Implement Insn::FixnumSub (https://github.com/Shopify/zjit/pull/42)Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Move lib.rs functions to appropriate modules ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/43) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Pass test results using #inspectTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Assert everything is compiled in test_zjit ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/40) * Assert everything is compiled in test_zjit * Update a comment on rb_zjit_assert_compiles Co-authored-by: Maxime Chevalier-Boisvert <[email protected]> * Add a comment about assert_compiles * Actually use pipe_fd --------- Co-authored-by: Maxime Chevalier-Boisvert <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add two more small btestsMaxime Chevalier-Boisvert
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Implement Insn::Param using the SP register ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/39) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Load an immediate into a register in the backend ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/38) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Do not assert inside rb_protect() (https://github.com/Shopify/zjit/pull/37)Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Rename Top to Any and Bottom to EmptyMax Bernstein
Top/Bottom can be unintuitive or ambiguous. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Store block params separately (https://github.com/Shopify/zjit/pull/35)Max Bernstein
Don't put them in the instruction stream. Instead put them in `Block::params`. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Test HIR using FunctionPrinter (https://github.com/Shopify/zjit/pull/34)Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Load Param off of cfp->ep (https://github.com/Shopify/zjit/pull/31)Takashi Kokubun
* Load Param off of cfp->ep * Test with --zjit-call-threshold=1 as well * Fix get_opnd's debug output * Return Mem operand from gen_param * Test both first and second calls * Spell out the namespace for Opnd returns * Update a comment about gen_param * Explain why we take a lock * Fix a typo Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Share FrameState by storing it on FunctionMax Bernstein
Give every instruction a cheap ID to hold onto instead of owning a copy. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Implement FixnumAdd and stub PatchPoint/GuardType ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/30) * Implement FixnumAdd and stub PatchPoint/GuardType Co-authored-by: Max Bernstein <[email protected]> Co-authored-by: Maxime Chevalier-Boisvert <[email protected]> * Clone Target for arm64 * Use $create instead of use create Co-authored-by: Alan Wu <[email protected]> * Fix misindentation from suggested changes * Drop an unneeded variable for mut * Load operand into a register only if necessary --------- Co-authored-by: Max Bernstein <[email protected]> Co-authored-by: Maxime Chevalier-Boisvert <[email protected]> Co-authored-by: Alan Wu <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add std docs to crate docsMax Bernstein
This makes it easier to work offline. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Sort type bits at compile time for DisplayMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Profile instructions for fixnum arithmetic ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/24) * Profile instructions for fixnum arithmetic * Drop PartialEq from Type * Do not push PatchPoint onto the stack * Avoid pushing the output of the guards * Pop operands after guards * Test HIR from profiled runs * Implement Display for new instructions * Drop unused FIXNUM_BITS * Use a Rust function to split lines * Use Display for GuardType operands Co-authored-by: Max Bernstein <[email protected]> * Fix tests with Display-ed values --------- Co-authored-by: Max Bernstein <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Tell GitHub that `*.inc.rs` files are generatedAlan Wu
... and rename hir_type_generated.rs so it gets picked up by the glob. This mostly changes how GitHub renders diffs for generated files on the web interface. See: https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Write all bits in Type as easy-to-read namesMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add compact Type latticeMax Bernstein
This will be used for local type inference and potentially SCCP. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add zjit_* instructions to profile the interpreter ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/16) * Add zjit_* instructions to profile the interpreter * Rename FixnumPlus to FixnumAdd * Update a comment about Invalidate * Rename Guard to GuardType * Rename Invalidate to PatchPoint * Drop unneeded debug!() * Plan on profiling the types * Use the output of GuardType as type refined outputs Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Compile Insn::Const (https://github.com/Shopify/zjit/pull/18)Takashi Kokubun
* Compile Insn::Const * Update the comment on JITState * Print insn index like YJIT * Wrap and unwrap InsnId Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Rename --zjit-dump-ssa to --zjit-dump-hir ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/17) * Rename --zjit-dump-ssa to --zjit-dump-hir * Update comments * Add a comment on iseq_to_hir Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix inconsistent triggers of workflowsTakashi Kokubun
This is another left-over from https://github.com/Shopify/zjit/pull/12. No reason to duplicate jobs for PRs. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix inconsistent workflow settingsTakashi Kokubun
This is a left-over from https://github.com/Shopify/zjit/pull/12. It was supposed to be removed from both workflows in the PR, but this was somehow uncommitted. Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Use rustup to get 1.85.0 since GitHub's image doesn't have itAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Avoid setting RUST_BACKTRACE environment while panickingAlan Wu
The 2024 edition pointed out that setting env vars in multiple threaded programs is unsafe, due to it being thread unsafe in glibc. Sure don't want to crash while already crashing! Always grab a backtrace with force_backtrace(). Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Upgrade bindgen, so it generates `unsafe extern` as 2024 expectsAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix 2024 edition errorsAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Bump to Rust 1.85.0, 2024 editionAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Make pattern match clearer with globalMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Pretty-print ConstMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add sample union-find implementationMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Remove OpndMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Fix ep_offset locals mathMax Bernstein
Thanks to @xrxr for explaining all of the "kindergarten" math :) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Rename `backend::Opnd` to `backend::lir::Opnd` ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/13) Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add `result` CI job to enable auto-merge ↵Takashi Kokubun
(https://github.com/Shopify/zjit/pull/12) * Add `result` CI job to enable auto-merge * Avoid triggering duplicated jobs on PRs * Drop cancel-in-progress We don't run as many jobs as ruby/ruby CI. We shouldn't need this here. * Fix a typo * Drop the concurrency group too Similarly, we shouldn't need this in the Shopify/zjit repo Notes: Merged: https://github.com/ruby/ruby/pull/13131
2025-04-18Add asm commentsTakashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/13131