Multi-Pass Compiler Profiling for Cache Miss Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The increasing disparity between CPU clock speed and system memory speed, known as memory latency, hampers the efficiency of compiled computer programs, as compilers struggle to optimize execution times and reduce cache misses effectively.

Innovation Solution

A multi-pass profiler is used to instrument code regions with annotations, generating profile data to identify delinquent code regions with excessive cache misses, allowing for refined profiling and optimization through multiple instrumentation cycles, which improve cache utilization and reduce profiling overhead.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If a compiler performs traditional single-pass optimization, then the compilation process is simple and fast, but it cannot effectively reduce cache misses and improve execution efficiency due to memory latency

Engineering Contradiction:
Improveexecution efficiencyVSAvoidcompiler complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent divides the compiler into multiple passes, where each pass performs specific optimization tasks. The first pass collects profile data about cache misses and memory access patterns, while subsequent passes use this data to apply targeted optimizations. This segmentation allows the compiler to systematically address memory latency issues without requiring complete reanalysis in a single complex pass.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary profiling in the first compilation pass to gather data about cache misses and memory access patterns before applying optimizations in subsequent passes. This preliminary action enables the compiler to make informed optimization decisions based on actual runtime behavior rather than static analysis alone, effectively reducing cache misses in the optimized code.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If the compiler instruments all code regions for profiling, then complete profile data is obtained, but profiling overhead increases significantly

Engineering Contradiction:
Improveprofile data accuracyVSAvoidprofiling overhead
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent applies profiling instrumentation selectively to specific code regions identified as potentially problematic, rather than uniformly to all code. By using heuristics and static analysis to identify regions with high memory access intensity or complex access patterns, the compiler concentrates profiling efforts where they are most needed, reducing overall overhead while maintaining sufficient accuracy for effective optimization.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent performs profiling on a subset of code regions that are most likely to benefit from optimization, rather than profiling every single region. This partial action approach focuses computational resources on critical paths and memory-intensive operations, achieving acceptable profile data accuracy for the most important optimization opportunities while significantly reducing the total profiling overhead.

Inventive Principle:
Principle #16Partial or excessive action

3Speed

If the compiler applies aggressive optimization strategies, then execution speed improves, but cache utilization may deteriorate and cause more cache misses

Engineering Contradiction:
Improveexecution speedVSAvoidcache utilization
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent uses profile data collected from the first compilation pass as feedback to guide optimization decisions in subsequent passes. The compiler analyzes actual cache miss patterns and memory access behavior observed during profiling, then applies targeted optimizations such as loop tiling, data prefetching, or memory access reordering specifically to regions showing poor cache performance. This feedback-driven approach ensures that optimizations improve both execution speed and cache utilization simultaneously.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent changes compilation parameters and optimization strategies based on profile data from previous passes. Rather than applying fixed aggressive optimization rules, the compiler adjusts optimization intensity and type according to observed runtime behavior, selecting parameters that balance execution speed with cache utilization for each specific code region and workload pattern.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS9946523B2Multiple pass compiler instrumentation infrastructure
Publication Date: 2018.04.17 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US9946523B2 patent drawing
  • US9946523B2 patent drawing
  • US9946523B2 patent drawing

AI summary

A code region of an application is instrumented by a multi-pass profiler with first annotations for generating profile data. The application is executed with the first annotations, wherein executing the application with the first annotations generates first profile data for the code region. The multi-pass profiler identifies, from the first profile data, the code region as a delinquent code region. The multi-pass profiler determines second annotations based, at least in part, on the first profile data and the at least one of the first annotations that defines the delinquent code region. The multi-pass profiler instruments, based on the first profile data, a code sub-region of the delinquent code region with the second annotations for generating profile data. The application is executed with second annotations, wherein executing the application with the second annotations generates second profile data for the code sub-region.