Machine-Level Intermediate Representation Merging for JIT Compilation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional link-time optimization (LTO) techniques increase memory footprint and computational overhead due to the generation and storage of high-level intermediate representations, which can degrade performance in just-in-time compilation scenarios like shader program compilation.
Innovation Solution
A computer device implements a machine-level intermediate representation optimization process that generates and merges machine-level intermediate representations, performing optimizations at link-time to reduce memory footprint and computational overhead, without storing high-level IRs in memory and avoiding traditional LTO pipelines.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If conventional link-time optimization techniques generate and store high-level intermediate representations, then interprocedural optimizations can be applied to eliminate duplicate calculations, but memory footprint and computational overhead increase
Solution Approach 1:
The patent extracts only the essential control flow information needed for optimization from the complete high-level intermediate representation. By taking out only the necessary control flow graph data at machine-level, the system maintains optimization capability while dramatically reducing memory footprint and avoiding storage of unnecessary high-level IR details.
Solution Approach 2:
The patent uses disposable machine-level intermediate representations that are generated, processed for control flow extraction, and then discarded. These temporary machine-level IRs serve their purpose for optimization analysis and are not stored long-term, reducing memory footprint while maintaining optimization effectiveness.
2Reliability
If conventional link-time optimization techniques store high-level intermediate representations, then whole program optimizations can be performed, but computational overhead increases
Solution Approach 1:
The patent replaces the heavy mechanical system of storing and processing complete high-level intermediate representations with a lighter approach that works directly at machine-level. This substitution eliminates the need for complex high-level IR manipulation while achieving the same optimization goals through control flow graph analysis on compiled code.
Solution Approach 2:
The patent introduces control flow graph data as an intermediary between the machine-level code and the optimization process. This intermediary structure provides the necessary control flow information for whole program optimizations without requiring storage or processing of complete high-level intermediate representations, reducing computational overhead.
3Quantity of substance
If machine-level intermediate representations are generated and merged, then memory footprint is reduced, but the complexity of the optimization process increases
Solution Approach 1:
The patent applies local quality by performing optimizations at the machine-level where the actual execution occurs, rather than at the higher-level abstract representation. This localized approach to optimization reduces memory footprint by working with concrete machine instructions and their control flow, rather than storing and manipulating high-level IR structures.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A computer device is provided that includes a processor configured to receive a source code for a program including at least two code files, and process the source code for the program to generate a machine-level code file for each of the at least two code files of the source code. The processor is further configured to generate control flow graph data for each machine-level code file generated for the at least two code files of the source code, generate a machine-level intermediate representation for each machine-level code file using a machine-level code file and the generated control flow graph data for that machine-level code file, merge the machine-level intermediate representations into a merged machine-level intermediate representation, and perform machine-level optimizations on the merged machine-level intermediate representation and output an optimized merged machine-level intermediate representation.