Last year, the YJIT compiler was upstreamed into CRuby and released as part of Ruby 3.1. Key advantages of YJIT are that it delivers fast warm up time and significant speedup on typical Ruby workloads such as Rails applications. However, up to this point, YJIT has only been available on x86-64 platforms.
This year, our goal is to transition from an experimental compiler towards something more broadly usable and future-proof. In order to make YJIT available on more platforms, we are currently working on the implementation of a new Intermediate Representation (IR) and backend for the compiler. This will make it possible for YJIT to run natively on the Apple M1/M2, AWS Graviton processors and the Raspberry Pi.
This talk will cover our objectives and constraints, the design of our new IR, the strategy we took to be able to support both x86-64 and ARM CPUs, the challenges we encountered, how we plan to optimize the quality of the generated machine code, and early performance results.