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

04/20/2022
by   Zongjie Li, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/13/2019

IR2Vec: A Flow Analysis based Scalable Infrastructure for Program Encodings

We propose IR2Vec, a Concise and Scalable encoding infrastructure to rep...
research
11/20/2017

Dynamic Neural Program Embedding for Program Repair

Neural program embeddings have shown much promise recently for a variety...
research
02/05/2022

Source Matching and Rewriting

A typical compiler flow relies on a uni-directional sequence of translat...
research
09/09/2023

FAIR: Flow Type-Aware Pre-Training of Compiler Intermediate Representations

While the majority of existing pre-trained models from code learn source...
research
06/19/2018

Neural Code Comprehension: A Learnable Representation of Code Semantics

With the recent success of embeddings in natural language processing, re...
research
03/23/2021

Unleashing the Hidden Power of Compiler Optimization on Binary Code Difference: An Empirical Study

Since compiler optimization is the most common source contributing to bi...
research
02/07/2020

What You See is What it Means! Semantic Representation Learning of Code based on Visualization and Transfer Learning

Recent successes in training word embeddings for NLP tasks have encourag...

Please sign up or login with your details

Forgot password? Click here to reset