Compiler Profiling via Persistent Memory Storage

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing profiling techniques generate separate profiling files for each run of a program, making it complex to combine profiling information from multiple runs and limiting the efficiency of code optimization, as they require file access operations and do not allow for shared profiling information between runs.

Innovation Solution

Storing profiling information in a persistent memory region that can be shared and updated across multiple runs, allowing profiling instructions to gather and store execution characteristics, such as instruction frequencies, in a memory location accessible by both the program and the optimizer, eliminating the need for file-based profiling.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If file-based profiling is used to store profiling information for each program run, then profiling information can be preserved across runs, but the build process becomes complex and file access operations reduce profiling efficiency

Engineering Contradiction:
Improveprofiling information preservationVSAvoidbuild process complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent replaces the mechanical file-based storage system with a memory-based storage system. Profiling information is stored in memory during program execution and directly accessed by the optimizer, eliminating file I/O operations and reducing build process complexity while preserving profiling information across runs.

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

Solution Approach 2:

The patent introduces memory as an intermediary between the program execution and the optimizer. Instead of directly reading from files, the optimizer accesses profiling information stored in memory, which simplifies the build process and improves access efficiency.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Quantity of substance

If separate profiling files are generated for each program run, then profiling information from multiple runs can be collected, but combining this information becomes complex and time-consuming

Engineering Contradiction:
Improveprofiling information collectionVSAvoidprofiling information combination time
Core Design Contradiction:
Quantity of substanceVSLoss of time

Solution Approach 1:

The patent merges multiple profiling information sources into a single memory-based storage location. Instead of generating separate files for each run that need to be combined, all profiling information from multiple runs is stored in the same memory location, allowing the optimizer to access consolidated information without additional combination steps.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent enables continuous profiling information collection in memory across multiple program runs without interruption. The memory-based system allows profiling information to be accumulated continuously and made immediately available to the optimizer, eliminating the time loss associated with file-based combination operations.

Inventive Principle:
Principle #20Continuity of useful action

3Loss of information

If file access operations are used to retrieve profiling information, then profiling data can be obtained, but the efficiency of code optimization is reduced due to additional I/O overhead

Engineering Contradiction:
Improveprofiling information retrievalVSAvoidcode optimization efficiency
Core Design Contradiction:
Loss of informationVSProductivity

Solution Approach 1:

The patent substitutes file I/O operations with memory access operations. Profiling information is retrieved from memory rather than from files, eliminating the I/O overhead and significantly improving code optimization efficiency while maintaining complete access to profiling information.

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

Data Source

PatentEP4083785B1Profiling and optimization of compiler-generated code
Publication Date: 2024.05.08 RED HAT INC
  • EP4083785B1 patent drawingFigure 1
  • EP4083785B1 patent drawingFigure 2
  • EP4083785B1 patent drawingFigure 3A~3C

AI summary

The technology disclosed herein enables a processor to receive program code comprising a plurality of program code instructions generated by a compiler in view of source code, identify, among the program code instructions, one or more optimizable instructions, wherein at least one of the optimizable instructions is associated with an execution characteristic, and the execution characteristic is associated with an optimization decision, identify a profiling instruction location associated with the at least one of the optimizable instructions, and add a profiling instruction to the program code at the profiling instruction location. The at least one profiling instruction comprises a profiling identifier, and causes the processing device to: generate a profiling information item in view of the execution characteristic of the optimizable instructions, and store the profiling information item in a persistent memory region at a memory location corresponding to the profiling identifier.