about
RL4ReAl: Reinforcement Learning for Register Allocation (arxiv.org)
1 point by NoraCodes on Apr 7, 2022 | hide | past | pdf | discuss on HN

In plain words: Trains a learning agent inside the LLVM compiler to decide which CPU registers hold each value, with rules that keep the generated code correct. It matches or beats LLVM's hand-tuned allocators on both Intel x86 and ARM chips.

Abstract

We aim to automate decades of research and experience in register allocation, leveraging machine learning. We tackle this problem by embedding a multi-agent reinforcement learning algorithm within LLVM, training it with the state of the art techniques. 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. Our approach is architecture independent: we show experimental results targeting Intel x86 and ARM AArch64. Our results match or out-perform the heavily tuned, production-grade register allocators of LLVM.

S. VenkataKeerthy, Siddharth Jain, Anilava Kundu, Rohit Aggarwal, Albert Cohen, Ramakrishna Upadrasta
arXiv:2204.02013 · cs.LG, cs.AR, cs.PL · submitted Apr 5, 2022 · updated Feb 6, 2023
abstract · pdf · html · Published in CC'23

add comment on HN
Also discussed: Apr 2022 (1 point, 0 comments)