Two-Pass Local Commoning for Volatile Expressions

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Compiler optimizations for volatile fields in managed runtime environments, such as Java, face additional constraints due to volatile variables acting as memory barriers and loads/stores, limiting the effectiveness of local commoning optimizations.

Innovation Solution

A two-pass approach for enhanced local commoning optimization, where the first pass determines where to evaluate volatile expressions that can be commoned, and the second pass commones all remaining non-volatile expressions, ensuring compliance with the Java memory model and maintaining functional correctness.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If local commoning optimization is applied to volatile fields in managed runtime environments, then code efficiency is improved, but additional constraints due to volatile variables acting as memory barriers and loads/stores must be satisfied

Engineering Contradiction:
Improvecode efficiencyVSAvoidconstraint complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent segments the local commoning optimization process into two distinct passes: a first pass that identifies and evaluates volatile expressions subject to memory barrier constraints, and a second pass that handles non-volatile expressions. This segmentation allows the compiler to apply appropriate constraints to each type of expression separately, improving code efficiency while systematically managing the complexity of volatile field constraints.

Inventive Principle:
Principle #1Segmentation

2Loss of energy

If volatile expressions are commoned, then the number of memory accesses is reduced, but the memory model compliance must be maintained

Engineering Contradiction:
Improvememory access reductionVSAvoidmemory model compliance
Core Design Contradiction:
Loss of energyVSReliability

Solution Approach 1:

The patent performs preliminary evaluation of volatile expressions in the first pass before final code generation. By identifying and evaluating volatile expressions subject to memory barrier constraints in advance, the compiler can determine safe commoning opportunities that reduce memory accesses while ensuring compliance with the memory model. This preliminary action allows optimization without compromising reliability.

Inventive Principle:
Principle #10Preliminary action

3Device complexity

If a single-pass approach is used for local commoning, then the compilation process is simpler, but volatile and non-volatile expressions cannot be differentiated

Engineering Contradiction:
Improvecompilation process complexityVSAvoidexpression type handling
Core Design Contradiction:
Device complexityVSAdaptability or versatility

Solution Approach 1:

The patent divides the compilation process into two specialized passes: the first pass specifically handles volatile expressions with memory barrier constraints, while the second pass handles non-volatile expressions. This segmentation enables the compiler to apply different optimization strategies to different expression types, enhancing adaptability and versatility without making the overall process overly complex.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial action by focusing each pass on a specific subset of expressions. The first pass concentrates exclusively on volatile expressions, and the second pass on non-volatile expressions. This partial focus allows each pass to be optimized for its specific task, improving overall handling versatility while keeping individual pass complexity manageable.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS10379885B2Enhanced local commoning
Publication Date: 2019.08.13 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10379885B2 patent drawing
  • US10379885B2 patent drawing
  • US10379885B2 patent drawing

AI summary

A method and system for enhanced local communing optimization of compilation of a program. Within a first pass of a two pass approach, a determination is made as to where in the program to evaluate volatile expressions that can be commoned. In a second pass of the two pass approach, all remaining expressions that are not volatile expressions are commoned.