Compiler Prefetch for Indirect Memory Access Chains

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The disparity between increasing processor data processing rates and memory data transfer rates leads to memory latency issues, particularly in systems where cache misses occur frequently due to the limited sophistication of hardware-based prefetching mechanisms, which struggle with complex memory access patterns.

Innovation Solution

A compiler-based method for generating prefetch information for multi-block indirect memory access chains by identifying chains of dependent memory accesses, determining prefetch-ahead values, and generating load operations that specify target memory addresses, thereby optimizing data prefetching.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If hardware-based prefetching mechanisms are used, then simple linear memory access patterns can be handled adequately, but complex memory access patterns exhibited by applications employing complex data or control structures cannot be processed effectively

Engineering Contradiction:
Improveability to handle complex memory access patternsVSAvoidcomplexity of prefetching mechanism
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent introduces a compiler as an intermediary between the application code and the hardware prefetching mechanism. The compiler analyzes complex memory access patterns and generates software prefetch instructions that guide the hardware prefetcher, effectively bridging the gap between simple hardware capabilities and complex access patterns.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent implements software-generated prefetch instructions that load data into the cache before it is actually needed by the application. This preliminary action allows the system to anticipate future memory access needs based on compiler analysis of access patterns, reducing latency for complex access scenarios.

Inventive Principle:
Principle #10Preliminary action

2Loss of time

If cache memory is used to reduce memory latency, then frequently used data can be stored in high-bandwidth low-latency storage, but cache misses still necessitate accesses to slower external memory

Engineering Contradiction:
Improvememory access latencyVSAvoidcache hit rate
Core Design Contradiction:
Loss of timeVSReliability

Solution Approach 1:

The patent generates software prefetch instructions that load data into the cache before it is needed by the application. This preliminary action increases the likelihood of cache hits by ensuring that frequently accessed data is already resident in the cache when needed, thereby reducing memory access latency and improving cache effectiveness.

Inventive Principle:
Principle #10Preliminary action

3Productivity

If the processor operates at high speed with superscalar architecture, then peak data processing bandwidth can reach 32 GB/s, but memory transfer bandwidth is limited to 3-6 GB/s

Engineering Contradiction:
Improvedata processing bandwidthVSAvoidmemory transfer rate
Core Design Contradiction:
ProductivityVSSpeed

Solution Approach 1:

The patent implements software-generated prefetch instructions that load data into the cache before the processor needs it. This preliminary data loading ensures that the processor can maintain its high processing speed by having data ready in the cache, effectively hiding the slower memory transfer rate from the critical processing path.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent ensures continuous data supply to the processor by generating prefetch instructions that keep the pipeline full. The compiler analyzes memory access patterns and generates appropriate prefetch operations to maintain continuous data flow, preventing processor stalls and maintaining high productivity despite memory bandwidth limitations.

Inventive Principle:
Principle #20Continuity of useful action

Data Source

PatentUS7383402B2Method and system for generating prefetch information for multi-block indirect memory access chains
Publication Date: 2008.06.03 ORACLE AMERICAN INC
  • US7383402B2 patent drawing
  • US7383402B2 patent drawing
  • US7383402B2 patent drawing

AI summary

Prefetch information is generated for multi-block indirect memory access chains. A method may include selecting a chain of indirect memory accesses of a procedure, the chain comprising a head access that does not depend for its address on another prefetch candidate memory access within the procedure and an indirect access that depends for its address on the head access. The method may further include determining a prefetch-ahead value for the chain, and generating a load operation corresponding to the head access that specifies a target memory address that is dependent upon the prefetch-ahead value and an address of the head access. The method may further include, for a terminal indirect access of the chain, generating a respective prefetch operation that is dependent for its address computation on results of preceding load operations in the same manner as its corresponding terminal indirect access depends upon preceding accesses in the chain.