LLVM IR Gains Byte Type: Native Support for Raw Memory Operations

2025-09-09

A Google Summer of Code 2025 project under the LLVM Compiler Infrastructure successfully added a new byte type to the LLVM IR, representing raw memory values. This enables native implementation of memory intrinsics like memcpy, memmove, and memcmp, fixes unsound transformations, and unlocks new optimizations, all with minimal performance overhead. The project addressed LLVM's longstanding lack of a type for representing raw memory, improving compiler correctness and optimization through pointer provenance tracking and precise poison bit representation. Clang's handling of C/C++ raw memory access types was also improved, along with fixes for several unsound optimizations.

Read more
Development

LLVM Fortran Compiler Flang: A Decade in the Making, Officially Released

2025-03-12

After nearly a decade of development, the LLVM Fortran compiler, Flang, has finally been officially renamed from "flang-new" to "flang." This article recounts Flang's journey, from its initial development by the US National Labs and NVIDIA, to its adoption of LLVM's Multi-Level Intermediate Representation (MLIR), and its eventual integration into the LLVM project. Flang's creation aimed to provide a long-term, non-proprietary Fortran compiler, mitigating risks associated with single-point failures, and fostering growth within the Fortran community. Flang's journey also showcases advancements in compiler technology, such as the use of MLIR for optimizing Fortran code. Now mature and stable, with support from vendors like AMD, Flang stands as a powerful tool for Fortran developers.

Read more
Development

Lightstorm: A Minimalistic Ruby Compiler Boosts Performance with MLIR

2024-12-31

The DragonRuby team developed Lightstorm, a minimalistic Ruby compiler aimed at improving the performance of their cross-platform game engine. Leveraging MLIR, Lightstorm translates mruby VM bytecode into C code, optimizing performance by eliminating load/store and branch operations within the VM's interpreter loop. Benchmark results show performance improvements ranging from 1% to 1200%, with an average reduction of roughly 30% in execution time and cycles. While currently supporting a subset of Ruby, the project validates the feasibility of pre-compiling Ruby code for performance gains. Future plans include replacing critical C components of the engine with compiled Ruby code.

Read more
Development Ruby compiler