Loop Rolling for Code Size Reduction
02 Apr 2022
TL;DR: RoLAG as mentioned in this paper identifies isomorphic code by aligning SSA graphs in a bottom-up fashion, then the aligned code is later rolled into a loop, and an analysis is used to estimate the profitability of the rolled loop before deciding which version should be kept in the code.
read more
Abstract: Code size is critical for resource-constrained devices, where memory and storage are limited. Compilers, therefore, should offer optimizations aimed at code reduction. One such optimization is loop rerolling, which transforms a partially unrolled loop into a fully rolled one. However, existing techniques are limited and rarely applicable to real-world programs. They are incapable of handling partial rerolling or straight-line code. In this paper, we propose RoLAG, a novel code-size optimization that creates loops out of straight-line code. It identifies isomorphic code by aligning SSA graphs in a bottom-up fashion. The aligned code is later rolled into a loop. In addition, we propose several optimizations that increase the amount of aligned code by identifying specific patterns of code. Finally, an analysis is used to estimate the profitability of the rolled loop before deciding which version should be kept in the code.Our evaluation of RoLAG on full programs from MiBench and SPEC 2017 show absolute reductions of up to 88 KB while LLVM’s technique is hardly distinguishable from the baseline with no rerolling. Finally, our results show that RoLAG is highly applicable to real-world code extracted from popular GitHub repositories. RoLAG is triggered several orders of magnitude more often than LLVM’s rerolling, resulting in meaningful reductions on real-world functions.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
babble: Learning Better Abstractions with E-Graphs and Anti-unification
TL;DR: The authors propose library learning modulo theory (LLMT), a library learning algorithm that takes as input an equational theory for a given problem domain, and uses e-graphs and equality saturation to compactly represent the space of programs equivalent modulo the theory.
Lasagne: a static binary translator for weak memory model architectures
Rodrigo C. O. Rocha,Dennis Sprokholt,Martin Fink,Redha Gouicem,Tom Spink,Soham Chakraborty,Pramod Bhatotia +6 more
- 09 Jun 2022
TL;DR: Lasagne is proposed, an end-to-end static binary translator with precise translation rules between x86 and Arm concurrency semantics and a concurrency model for Lasagne’s intermediate representation (IR) and formally proved mappings between the IR and the two architectures.
RollBin: reducing code-size via loop rerolling at binary level
Tianao Ge,Zewei Mo,Kan Wu,Xianwei Zhang,Yutong Lu +4 more
- 14 Jun 2022
TL;DR: A novel code-size optimization RollBin to reroll loops at binary level is presented, which effectively shrinks code size by 1.7% and 2.2% on average and outperforms the state-of-the-arts by 31% and 38%.
7
Optimizing Function Layout for Mobile Applications
Ellis Hoag,Kyung-Tae Lee,Julián Mestre,Sergey Pupyrev +3 more
- 17 Nov 2022
TL;DR: In this article , a principled solution for optimizing function layouts in the mobile space is developed, which reduces the compressed code size and improves the cold start-up time of a mobile application.
Towards a universal and portable assembly code size reduction: a case study of RISC-V ISA
Jianfeng Liu,Wangrong Gao,Ting Wang +2 more
2
References
Constant propagation with conditional branches
Mark N. Wegman,F. Kenneth Zadeck +1 more
TL;DR: Four algorithms, all conservitive in the sense that all constants may not be found, but each constant found is constant over all possible executions of the program, are presented.
Exploiting superword level parallelism with multimedia instruction sets
Samuel Larsen,Saman Amarasinghe +1 more
- 01 May 2000
TL;DR: This paper has developed a simple and robust compiler for detecting SLPP that targets basic blocks rather than loop nests, and is able to exploit parallelism both across loop iterations and within basic blocks.
Compiler techniques for code compaction
TL;DR: This article explores the use of compiler techniques to accomplish code compaction to yield smaller executables and shows that careful, aggressive, interprocedural optimization, together with procedural abstraction of repeated code fragments, can yield significantly better reductions in code size than previous approaches.
Beyond induction variables
Michael Wolfe
- 01 Jul 1992
TL;DR: A simple algorithm based on the Static Single Assignment form of a program that finds all linear induction variables in a loop and gives a unified approach to induction variable analysis, improves the speed of compilers and allows a more general classification scheme.
134
Partial redundancy elimination in SSA form
TL;DR: Measurement statistics are provided that characterize the instances of the partial redundancy problem from a set of benchmark programs and compare optimization time spent by an implementation of SSAPRE aganist a classical partial redundancy elimination implementation.
98
Related Papers (5)
02 Apr 2022