Post Pass Optimization in Dynamic Compilers

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Dynamic compilers like the CDC Hotspot implementation generate inefficient machine code due to lack of effective optimizations during runtime, leading to suboptimal performance in executing dynamically compiled code.

Innovation Solution

A post pass processor performs optimizations on dynamically compiled code by creating an abstract representation using an abstraction engine and conducting data flow analysis, which identifies and removes redundant instructions, thereby generating more efficient machine code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If dynamic compilers generate machine code at runtime without extensive optimization, then compilation speed and adaptability are improved, but code efficiency and execution performance deteriorate

Engineering Contradiction:
Improveruntime adaptabilityVSAvoidcode execution efficiency
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The optimization process is segmented into multiple passes: a first pass performs basic optimizations, while a second pass performs additional optimizations on code marked for further processing. This segmentation allows the system to achieve comprehensive optimization without requiring all optimizations to be performed simultaneously in a single complex pass, thus maintaining runtime adaptability while improving code efficiency.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary data flow analysis and identifies optimization candidates before final code generation. By conducting analysis in advance and marking code segments for optimization, the system prepares the code structure ahead of time, enabling efficient optimization without significantly delaying runtime compilation speed.

Inventive Principle:
Principle #10Preliminary action

2Manufacturing precision

If data flow analysis is performed on abstract representations, then optimization accuracy is improved, but processing time and system complexity increase

Engineering Contradiction:
Improveoptimization accuracyVSAvoidprocessing time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The data flow analysis is applied locally to specific basic blocks and code segments rather than performing a complete global analysis. The system identifies and optimizes only those regions where data flow dependencies indicate optimization opportunities, thereby achieving high optimization accuracy for critical sections without the time cost of analyzing entire codebases.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system performs partial data flow analysis sufficient to identify optimization candidates without exhaustively analyzing all possible code paths. By applying analysis to representative samples and using heuristics to identify likely optimization targets, the system achieves adequate optimization accuracy with reduced processing time.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS7721275B2Data-flow based post pass optimization in dynamic compilers
Publication Date: 2010.05.18 SAP SE
  • US7721275B2 patent drawing
  • US7721275B2 patent drawing
  • US7721275B2 patent drawing

AI summary

A system and method to perform post pass optimizations in a dynamic compiling environment. A dynamic compiler emits machine code. Responsive to the emission of the machine code a post pass processor creates an abstract representation of the code from the dynamic compiler. Data flow analysis is then conducted on the abstract representation. Redundant instructions in the machine code are identified and eliminated as a result of the data flow analysis.