2014 · 25 citations · 23 references
EngineeringComputer EngineeringComputer ScienceCompilersComputer ArchitectureEmbedded SystemsCode GenerationHardware AccelerationCache-aware Code GenerationCode Optimization For Embedded SystemsCode Size OptimizationCompiler DesignDuplication MechanismsFunction-level SimilarityMergingMicroarchitectural Optimization
For cost-sensitive or memory constrained embedded systems, code size is at least as important as performance. Consequently, compact code generation has become a major focus of attention within the compiler community. In this paper we develop a pragmatic, yet effective code size reduction technique, which exploits structural similarity of functions. It avoids code duplication through merging of similar functions and targeted insertion of control flow to resolve small differences. We have implemented our purely software based and platform-independent technique in the LLVM compiler frame work and evaluated it against the SPEC CPU2006 benchmarks and three target platforms: Intel x86, ARM based Qualcomm Krait(TM), and Qualcomm Hexagon(TM) DSP. We demonstrate that code size for SPEC CPU2006 can be reduced by more than 550KB on x86. This corresponds to an overall code size reduction of 4%, and up to 11.5% for individual programs. Overhead introduced by additional control flow is compensated for by better I-cache performance of the compacted programs. We also show that identifying suitable candidates and subsequent merging of functions can be implemented efficiently.
23
Compiler techniques for code compaction
Saumya Debray, William Evans, Robert Muth et al. · ACM Transactions on Programming Languages and Systems · 2000 · 275 citations · Full text
Structural Comparison of Executable Objects
Halvar Flake · 2004 · 188 citations · Full text
Graph-based comparison of Executable Objects
Thomas Dullien · 2005 · 134 citations