arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2204.09191cs.SE
收藏

释放中间表示的力量以增强神经程序嵌入

Unleashing the Power of Compiler Intermediate Representation to Enhance Neural Program Embeddings

Zongjie Li, Pingchuan Ma, Huaijin Wang, Shuai Wang, Qiyi Tang, Sen Nie, Shi Wu

摘要:

神经程序嵌入在一系列程序分析任务中表现出相当大的前景,包括克隆识别、程序修复、代码完成和程序合成。然而,大多数现有的方法直接从程序源代码生成神经程序嵌入,通过学习令牌,抽象语法树和控制流图等特征。本文重新审视如何利用编译器中间表示(IR)来改进程序嵌入。我们首先展示了简单而高效的方法,通过训练嵌入模型以及源代码和由默认优化级别(例如,-O2)。然后,我们介绍IRGen,一个框架的基础上遗传算法(GA),以确定(近)最佳序列的优化标志,可以显着提高嵌入质量。

英文摘要:

Neural program embeddings have demonstrated considerable promise in a range of program analysis tasks, including clone identification, program repair, code completion, and program synthesis. However, most existing methods generate neural program embeddings directly from the program source codes, by learning from features such as tokens, abstract syntax trees, and control flow graphs. This paper takes a fresh look at how to improve program embeddings by leveraging compiler intermediate representation (IR). We first demonstrate simple yet highly effective methods for enhancing embedding quality by training embedding models alongside source code and LLVM IR generated by default optimization levels (e.g., -O2). We then introduce IRGen, a framework based on genetic algorithms (GA), to identify (near-)optimal sequences of optimization flags that can significantly improve embedding quality.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑