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.
翻译:我们的目标是使几十年来在登记册分配、利用机器学习方面的研究和经验自动化。我们通过在LLLVM内嵌入多剂强化学习算法来解决这一问题,并用最新技术对其进行培训。我们正式确定精确界定特定教学设置结构问题的限制,同时确保生成的代码保持语义正确性。我们还开发了一个基于GRPC的框架,为培训和推断提供一个模块化和高效的编译界面。我们的方法是独立的结构:我们展示针对Intelx86和ARM AArch64的实验结果。我们的结果匹配或优于高调的LLVM生产级别注册控制器。