RL4ReAl: Towards Optimal Register Allocation using Reinforcement Learning

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

Abstract

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.