Idempotent Slices with Applications to Code-Size Reduction
Rafael Alvarenga de Azevedo, Daniel Augusto Costa de Sa, Rodrigo Caetano Rocha, Fernando Magno Quint\~ao Pereira

TL;DR
This paper formalizes idempotent backward slices in programs, introduces a sound algorithm for their extraction, and demonstrates their application in reducing code size in LLVM-compiled programs.
Contribution
It provides a formal definition and a sound, efficient algorithm for extracting idempotent slices from GSA form programs, enabling code-size optimization.
Findings
Achieves up to -7.24% code size reduction in LLVM benchmarks.
Addresses limitations of previous informal approaches.
Demonstrates practical application in code optimization.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Software Testing and Debugging Techniques · Parallel Computing and Optimization Techniques
