Learning to compile smartly for program size reduction

01/09/2023
by   Youwei Liang, et al.
1

Compiler optimization passes are an important tool for improving program efficiency and reducing program size, but manually selecting optimization passes can be time-consuming and error-prone. While human experts have identified a few fixed sequences of optimization passes (e.g., the Clang -Oz passes) that perform well for a wide variety of programs, these sequences are not conditioned on specific programs. In this paper, we propose a novel approach that learns a policy to select passes for program size reduction, allowing for customization and adaptation to specific programs. Our approach uses a search mechanism that helps identify useful pass sequences and a GNN with customized attention that selects the optimal sequence to use. Crucially it is able to generalize to new, unseen programs, making it more flexible and general than previous approaches. We evaluate our approach on a range of programs and show that it leads to size reduction compared to traditional optimization techniques. Our results demonstrate the potential of a single policy that is able to optimize many programs.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/05/2021

Accelerating XOR-based Erasure Coding using Program Optimization Techniques

Erasure coding (EC) affords data redundancy for large-scale systems. XOR...
research
09/28/2021

Learning to Superoptimize Real-world Programs

Program optimization is the process of modifying software to execute mor...
research
11/02/2022

Synthesizing Programs with Continuous Optimization

Automatic software generation based on some specification is known as pr...
research
05/06/2020

A Collaborative Filtering Approah for the Automatic Tuning of Compiler Optimisations

Selecting the right compiler optimisations has a severe impact on progra...
research
05/06/2020

A Collaborative Filtering Approach for the Automatic Tuning of Compiler Optimisations

Selecting the right compiler optimisations has a severe impact on progra...
research
06/03/2020

Controlling the Size of Supercompiled Programs using Multi-result Supercompilation

Supercompilation is a powerful program transformation technique with num...
research
10/12/2021

NetRep: Automatic Repair for Network Programs

Debugging imperative network programs is a challenging task for develope...

Please sign up or login with your details

Forgot password? Click here to reset