Just in Time Link Time Optimization for Runtime Code Inlining

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing link-time optimization (LTO) techniques do not account for execution flow transfers affected by run-time values of application parameters, leading to inefficiencies in executable code optimization.

Innovation Solution

Implementing just-in-time (JIT) link-time optimization (LTO) by merging intermediate representations of source code modules and performing in-lining based on run-time values of application parameters, allowing for conditional execution flow optimizations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional link-time optimization is performed at compile time, then code optimization can be done, but execution flow transfers affected by run-time values cannot be optimized

Engineering Contradiction:
Improvecode optimization effectivenessVSAvoidexecution time
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent performs link-time optimization at run-time by merging intermediate representations and performing in-lining based on actual run-time values of application parameters. This preliminary action at run-time allows the system to optimize execution flow transfers that are affected by parameter values, thereby reducing execution time while maintaining code optimization effectiveness.

Inventive Principle:
Principle #10Preliminary action

2Ease of manufacture

If in-lining is performed without considering run-time parameter values, then compilation is simpler, but execution flow control overhead remains

Engineering Contradiction:
Improvecompilation simplicityVSAvoidexecution flow control overhead
Core Design Contradiction:
Ease of manufactureVSLoss of energy

Solution Approach 1:

The patent changes the approach by performing in-lining based on actual run-time parameter values rather than static compile-time decisions. This allows the system to eliminate execution flow control overhead for parameterized functions by making informed in-lining decisions at run-time when the parameter values are known, thereby reducing energy loss from flow control while still maintaining relative compilation simplicity.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If optimization is performed at compile time, then development cycle is faster, but run-time performance is suboptimal

Engineering Contradiction:
Improvedevelopment speedVSAvoidexecution speed
Core Design Contradiction:
ProductivityVSSpeed

Solution Approach 1:

The patent implements a dynamic optimization approach where link-time optimization is performed at run-time based on actual parameter values. This dynamic approach maintains fast development cycles since the compilation process remains relatively simple, while simultaneously achieving optimal run-time performance by adapting optimization decisions to actual execution conditions.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS20240264853A1Just in time compilation using link time optimization
Publication Date: 2024.08.08 NVIDIA CORP
  • US20240264853A1 patent drawing
  • US20240264853A1 patent drawing
  • US20240264853A1 patent drawing

AI summary

A first intermediate representation of a first portion of a source code implementing an application and a second intermediate representation of a second portion of the source code is received by a processing device. The first intermediate representation and the second intermediate representation is merged, at run-time, into a merged intermediate representation, wherein the first intermediate representation includes a reference to a function in the second intermediate representation. An execution flow transfer instruction within the merged intermediate representation is identified based on a run-time value of a parameter of the application. The execution flow transfer instruction references the function. A set of executable instructions implementing the function is identified within the merged intermediate representation. The execution flow transfer instruction is replaced with a copy of the set of executable instructions implementing the function.