Google Research

RL4ReAl: Towards Optimal Register Allocation using Reinforcement Learning

  • S. VenkataKeerthy
  • Siddharth Jain
  • Rohit Aggarwal
  • Albert Cohen
  • Ramakrishna Upadrasta
arXiv (2022)


We propose a novel solution for the Register Allocation problem, leveraging multi-agent hierarchical Reinforcement Learning. We formalize the constraints that precisely define the problem for a given instruction-set architecture, while ensuring that the generated code preserves semantic correctness. We also develop a gRPC based framework providing a modular and efficient compiler interface for training and inference. Experimental results match or outperform the LLVM register allocators, targeting Intel x86 and ARM AArch64.

Learn more about how we do research

We maintain a portfolio of research projects, providing individuals and teams the freedom to emphasize specific types of work