Maxime Chevalier-Boisvert
Maxime Chevalier-Boisvert
  • @maximecb

Maxime Chevalier-Boisvert obtained a PhD in compiler design at the University of Montreal in 2016, where she developed Basic Block Versioning (BBV), a JIT compiler architecture optimized for dynamically-typed programming languages. She is currently leading a project at Shopify to build YJIT, a new JIT compiler built inside CRuby.

Building a Lightweight IR and Backend for YJIT

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.