Compiler Inline Throttling for Mobile Code Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current inlining techniques in compilers for mobile devices lead to increased compile times, which consume significant battery power and limit battery life, as they are not optimized to manage register allocation efficiently and often result in excessive code expansion.
Innovation Solution
Implementing a method for compiler-based inline throttling that selects call sites for inlining based on a call-site threshold, determined by the total projected number of call sites, to balance compile time and code performance, thereby reducing power consumption and improving user experience.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If inlining is performed to optimize code execution speed, then runtime performance is improved, but compile time increases significantly
Solution Approach 1:
The patent changes the parameter of inlining by introducing a threshold-based selection criterion. Instead of inlining all call sites or using traditional frequency-based selection, the patent selects call sites for inlining based on whether they meet a specific threshold criterion, thereby controlling the degree of inlining to balance execution speed improvement against compile time increase.
2Quantity of substance
If inlining is performed to reduce memory usage, then memory consumption is reduced, but register allocation complexity increases
Solution Approach 1:
The patent applies local quality by selectively inlining only those call sites that meet the threshold criterion, rather than applying inlining uniformly throughout the code. This localized approach ensures that register allocation complexity is increased only in the specific regions where inlining occurs, rather than throughout the entire codebase, thereby managing the trade-off between memory usage and allocation complexity.
Data Source
AI summary
The various aspects leverage the novel observation that the number of call sites in code is directly correlated with the code's compile time and provide methods implemented by a compiler operating on a computing device (e.g., a smartphone) for performing inline throttling based on a projected number of call sites in the code that would exist after performing inline expansion. The various aspects enable the compiler to improve the performance of the generated code by aggressive inlining while carefully managing increases in compile time, thereby decreasing the power required to compile the code while increasing performance of the computing device. Thus, by inlining enough call sites to reduce the costs of handling calls while accounting for the costs of inlining, the various aspects provide for an effective balance of short compile times and effective code performance.


