Shopify

Understanding Programs Using Graphs - Shopify

Jun 2, 2020
Understanding Programs Using Graphs - Shopify
SummaryAI, from the source post

This post introduces the concept of sea-of-nodes graphs as an intermediate representation used by the TruffleRuby JIT compiler. It explains the structure of these graphs, differentiating between control flow (red arrows) and data flow (green arrows), and between imperative (red boxes) and pure (green boxes) operations. It demonstrates how these graphs enable optimizations like de-duplication of common expressions (global value numbering) and floating expressions, and how they represent loops. The post also discusses the challenges of programming directly with graphs and highlights Shopify's efforts to build tools for visualizing and decompiling these graphs back to Ruby code to aid developer understanding of compiler optimizations.

More from the YJIT Compiler for Ruby trail