Compiler Inline Throttling for Mobile Code Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering Contradiction Analysis

1Speed

If inlining is performed to optimize code execution speed, then runtime performance is improved, but compile time increases significantly

Engineering Contradiction:
Improvecode execution speedVSAvoidcompile time
Core Design Contradiction:
SpeedVSLoss of time

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.

Inventive Principle:
Principle #35Parameter changes

2Quantity of substance

If inlining is performed to reduce memory usage, then memory consumption is reduced, but register allocation complexity increases

Engineering Contradiction:
Improvememory usageVSAvoidregister allocation complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

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.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS9304748B2Method for controlling inlining in a code generator
Publication Date: 2016.04.05 QUALCOMM INC
  • US9304748B2 patent drawing
  • US9304748B2 patent drawing
  • US9304748B2 patent drawing

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.