会议论文

DFA-Net: A Compiler-Specific Neural Architecture for Robust Generalization in Data Flow Analyses 收藏

DFA-Net:用于数据流分析鲁棒泛化的编译器专用神经网络结构
摘要
Data flow analysis is fundamental to modern program optimization and verification, serving as a critical foundation for compiler transformations. As machine learning increasingly drives compiler tasks, the need for models that can implicitly understand and correctly reason about data flow properties becomes crucial for maintaining soundness. State-of-the-art machine learning methods, especially graph neural networks (GNNs), face challenges in generalizing beyond training scenarios due to their limited ability to perform large propagations. We present DFA-Net, a neural network architecture tailored for compilers that systematically generalizes. It emulates the reasoning process of compilers, facilitating the generalization of data flow analyses from simple to complex programs. The architecture decomposes data flow analyses into specialized neural networks for initialization, transfer, and meet operations, explicitly incorporating compiler-specific knowledge into the model design. We evaluate DFA-Net on a data flow analysis benchmark from related work and demonstrate that our compiler-specific neural architecture can learn and systematically generalize on this task. DFA-Net demonstrates superior performance over traditional GNNs in data flow analysis, achieving F1 scores of 0.761 versus 0.009 for data dependencies and 0.989 versus 0.196 for dominators at high complexity levels, while maintaining perfect scores for liveness and reachability analyses where GNNs struggle significantly.
摘要译文
数据流分析是现代程序优化和验证的基础,是编译器转换的关键基础。 随着机器学习越来越多地驱动编译器任务,对能够隐含地理解和正确推理数据流属性的模型的需求对于保持稳健性变得至关重要。 最新的机器学习方法,特别是图神经网络(GNN),由于其执行大繁殖的有限能力,在推广超过训练场景方面面临挑战。 我们提出了DFA-Net,一个为编译器定制的神经网络结构,系统地概括。 它模拟了编译器的推理过程,方便了数据流分析从简单程序到复杂程序的通用化。 该体系结构将数据流分析分解为专门的神经网络,用于初始化、传输和满足操作,将编译器特定的知识明确地结合到模型设计中。 我们从相关工作的数据流分析基准上评估了DFA-Net,并证明我们的编译器特定的神经架构可以学习并系统地概括该任务。 DFA-Net在数据流分析中表现出了优于传统GNN的性能,在高复杂度水平下,数据依赖性的F1分数为0.761和0.009,支配者的F1分数为0.989和0.196,同时在GNNs极度困难的情况下,保持了活性和可达性分析的完美分数。
Alexander Brauckmann[1];Anderson Faustino da Silva[2];Gabriel Synnaeve[3];Michael F. P. O’Boyle[1];Jeronimo Castrillon[4];Hugh Leather[5]. DFA-Net: A Compiler-Specific Neural Architecture for Robust Generalization in Data Flow Analyses[C]//CC '25: Proceedings of the 34th ACM SIGPLAN International Conference on Compiler Construction, Las Vegas NV USA, March 1 - 2, 2025, US: ACM, 2025: 92 - 103