Profile-Guided Compiler Optimization for Reduced Compilation Time
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing compiler optimization techniques are inefficient and resource-intensive, as they often perform optimizations that do not improve the program, consuming significant time and processor resources without enhancing performance.
Innovation Solution
A compiler system that profiles optimizations based on their impact on intermediate representations (IR) of program code, selectively applying optimizations that have previously improved the IR, and omitting those that did not, thereby optimizing resource usage and compilation time.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If compiler optimizations are applied to improve program performance, then executable instruction performance is improved, but compilation time and processor resource consumption increase
Solution Approach 1:
The patent applies preliminary action by performing a trial compilation with optimizations enabled to generate profile data before the actual production compilation. This preliminary run identifies which optimizations are beneficial for the specific program, allowing the production compilation to skip ineffective optimizations and only apply proven beneficial ones, thus reducing overall compilation time while maintaining performance improvements.
Solution Approach 2:
The patent implements partial action by selectively applying only those optimizations that demonstrated beneficial impact during the trial compilation, rather than applying all possible optimizations. The compiler generates a profile indicating specific optimizations to apply, enabling partial optimization application that balances performance improvement with compilation efficiency.
2Power
If comprehensive compiler optimizations are performed, then program execution efficiency is enhanced, but processor resource consumption during compilation increases
Solution Approach 1:
The system performs partial optimization by using profile data from trial compilation to determine which specific optimizations to apply during production compilation. This selective approach ensures that only optimizations beneficial to the specific program are applied, reducing unnecessary processor resource consumption while maintaining execution efficiency improvements.
Solution Approach 2:
The patent implements feedback through profile data generated during trial compilation that informs the production compilation process. The profile indicates which optimizations were beneficial, creating a feedback loop that guides the compiler to apply only effective optimizations, thereby reducing processor resource consumption while maintaining execution efficiency.
3Reliability
If all optimization passes are applied to every program version, then potential performance improvements are maximized, but compilation productivity decreases
Solution Approach 1:
The patent applies partial action by generating a profile that identifies specific optimizations beneficial for particular program versions or modules. During production compilation, only these identified optimizations are applied rather than all possible optimizations, maintaining performance improvement potential while significantly improving compilation throughput and productivity.
Solution Approach 2:
The system segments the optimization process by applying optimizations at different levels (program-level, module-level, function-level) based on profile data. This segmentation allows the compiler to selectively apply optimizations where they are most beneficial, improving overall compilation productivity while maintaining performance improvement potential across different program segments.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Apparatuses, systems, and techniques to select optimizations to be performed by compilers. In at least one embodiment, a processor includes one or more circuits to perform a compiler to select one or more optimizations to one or more first versions of a program based, at least in part, on a result of performing said one or more optimizations on one or more second versions of said program.