Idempotent Slices with Applications to Code-Size Reduction

๐Ÿ“… 2026-03-10
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
Existing approaches struggle to accurately extract idempotent slices from general control flow graphs, limiting their applicability in code optimization. This work formally defines idempotent backward slicing for the first time and presents a sound and efficient slicing algorithm based on the Gated Static Single Assignment (GSA) representation, integrating precise control-flow and data-flow analyses. The proposed method enables merging of non-contiguous instructions across basic blocks and even across function boundaries, thereby overcoming the locality constraints inherent in traditional slicing techniques. Experimental evaluation demonstrates that, when applied to LLVM-optimized benchmark programs, the technique achieves up to a 7.24% reduction in code size.

Technology Category

Application Category

๐Ÿ“ Abstract
Given a value computed within a program, an idempotent backward slice with respect to this value is a maximal subprogram that computes it. An informal notion of an idempotent slice has previously been used by Guimaraes et al. to transform eager into strict evaluation in the LLVM intermediate representation. However, that algorithm is insufficient to be correctly applied to general control-flow graphs. This paper addresses these omissions by formalizing the notion of idempotent backward slices and presenting a sound and efficient algorithm for extracting them from programs in Gated Static Single Assignment (GSA) form. As an example of their practical use, the paper describes how identifying and extracting idempotent backward slices enables a sparse code-size reduction optimization; that is, one capable of merging non-contiguous sequences of instructions within the control-flow graph of a single function or across functions. Experiments with the LLVM test suite show that, in specific benchmarks, this new algorithm achieves code-size reductions up to -7.24% on programs highly optimized by the -Os sequence of passes from clang 17.
Problem

Research questions and friction points this paper is trying to address.

idempotent slice
code-size reduction
control-flow graph
GSA form
LLVM
Innovation

Methods, ideas, or system contributions that make the work stand out.

idempotent backward slice
code-size reduction
GSA form
sparse optimization
control-flow graph
๐Ÿ”Ž Similar Papers
No similar papers found.
R
Rafael Alvarenga de Azevedo
UFMG, Belo Horizonte, Brazil
D
Daniel Augusto Costa de Sa
UFMG, Belo Horizonte, Brazil
R
Rodrigo Caetano Rocha
Huawei, Edinburgh, United Kingdom
Fernando Magno Quintรฃo Pereira
Fernando Magno Quintรฃo Pereira
Professor of Computer Science, Universidade Federal de Minas Gerais
CompilersProgramming Languages