Machine-Level Intermediate Representation Merging for JIT Compilation

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

VSEngineering 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

Engineering Contradiction:
Improveoptimization effectivenessVSAvoidmemory footprint
Core Design Contradiction:
ReliabilityVSQuantity of substance

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.

Inventive Principle:
Principle #2Taking out (Extraction)

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.

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

2Reliability

If conventional link-time optimization techniques store high-level intermediate representations, then whole program optimizations can be performed, but computational overhead increases

Engineering Contradiction:
Improveoptimization capabilityVSAvoidcomputational overhead
Core Design Contradiction:
ReliabilityVSPower

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.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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

Engineering Contradiction:
Improvememory footprintVSAvoidoptimization process complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

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.

Inventive Principle:
Principle #3Local quality

Data Source

PatentEP4275115B1Merged machine-level intermediate representation optimizations
Publication Date: 2024.10.23 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP4275115B1 patent drawingFigure 1
  • EP4275115B1 patent drawingFigure 2
  • EP4275115B1 patent drawingFigure 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.