Profile-Guided Temporal Prefetching

Mengming Li, Qijun Zhang, Yichuan Gao, Wenji Fang, Yao Lu, Yongqing Ren, Zhiyao Xie · DOI

Abstract

Temporal prefetching is a critical technique for mitigating the "memory wall" in workloads with irregular memory access patterns. However, the significant metadata required for these predictions often leads to cache pollution or inefficient on-chip storage utilization. This paper introduces Prophet, a hardware-software co-designed framework that leverages Profile-Guided Optimization (PGO) to enhance temporal prefetching. By using lightweight hardware performance counters to generate management "hints," Prophet offloads complex decision-making to a software profiling stage. Evaluation on SPEC CPU and CRONO benchmarks shows that Prophet achieves a 14.23% performance improvement over state-of-the-art hardware prefetchers with negligible overhead and robust cross-input adaptability.

Introduction

The performance gap between CPU and DRAM, often called the "memory wall," remains a primary bottleneck in modern computing. Temporal prefetching addresses this by recording correlations between memory addresses to predict future accesses. This is particularly effective for irregular patterns, such as pointer-chasing in graph processing or linked-list traversals, where spatial prefetchers often fail.

The central challenge for temporal prefetching is managing metadata. Storing address correlations requires substantial space; while modern designs utilize the Last Level Cache (LLC) for this purpose, they often struggle with efficient allocation. Hardware-only heuristics typically rely on short-term recency (LRU), which fails to capture long-term program behavior or distinguish between "solvable" and "unsolvable" prefetch patterns. Prophet addresses these limitations by integrating software-level insights into hardware prefetching logic through a hint-based interface.

The Prophet Framework

Prophet shifts the burden of metadata management from hardware to a lightweight software profiling and analysis pipeline. The framework operates in three distinct phases: Profiling, Analysis, and Learning.

The three-step workflow of Prophet: Profiling, Analysis, and Learning.

1. Profiling

Unlike traditional trace-based profiling that generates gigabytes of data and incurs high overhead, Prophet utilizes standard Performance Monitoring Unit (PMU) counters (e.g., Intel PEBS). It tracks prefetching accuracy at the instruction level (Program Counter or PC), identifying which specific loads are consistently predictable. This approach keeps profiling overhead below 2%, making it viable for production environments.

2. Analysis

An offline analysis script processes the collected counters to generate "hints" for the hardware. These hints guide three critical aspects of metadata management:

  • Insertion Policy: Identifying "unsolvable" instructions that should not occupy space in the metadata table.
  • Replacement Policy: Prioritizing metadata entries based on historical prefetching accuracy rather than simple recency.
  • Resizing: Determining the optimal cache allocation for the metadata table based on the application's specific footprint.

3. Learning

To ensure robustness across different execution environments, Prophet can merge profiling data from multiple program inputs. This allows the creation of a single optimized binary that remains effective even when encountering unseen data, solving a common pitfall of static profile-guided systems.

Hardware Integration and Logic

On the hardware side, Prophet introduces a Multi-path Victim Buffer to handle complex branching where one memory access might lead to several different future paths (Markov targets). The core hardware contribution is the logic that interprets software hints to manage the metadata table dynamically.

Hardware logic flow showing how software hints guide runtime resizing, insertion, and replacement policies.

As shown in the architecture diagram, demand requests trigger updates to the metadata table guided by both runtime state and Prophet-provided hints. The system dynamically compares Prophet's suggested policies against runtime heuristics, choosing the most effective path for resizing and insertion. This hybrid approach ensures that the prefetcher remains efficient even if profiling data is slightly stale or the input changes significantly.

Evaluation and Results

The researchers evaluated Prophet using the SPEC CPU 2017/2006 suites and the CRONO graph benchmark suite on the Gem5 simulator.

  • Performance Gains: Prophet achieves a 34.58% speedup over a baseline without temporal prefetching. Crucially, it outperforms Triangel, the previous state-of-the-art hardware prefetcher, by 14.23%, and RPG², a state-of-the-art software PGO scheme, by 34.48%.
  • Miss Reduction: The framework reduces demand memory misses by 42.75%, a significant improvement over Triangel's 28.08% reduction.
  • Operational Efficiency: Despite its performance gains, Prophet adds negligible energy overhead (1.6% relative to Triangel) and maintains a minimal instruction footprint in the final binary.

Conclusion

Prophet demonstrates that the principles of Profile-Guided Optimization can be effectively extended to hardware structure management. By using lightweight software hints to filter "unsolvable" patterns and prioritize accurate metadata, Prophet overcomes the capacity and intelligence limitations of traditional hardware-only temporal prefetchers. This co-design approach paves the way for more intelligent, application-aware hardware structures in future processor generations.

Summary updated

BibTeX
@inproceedings{li2025profile,
  author = {Mengming Li and Qijun Zhang and Yichuan Gao and Wenji Fang and Yao Lu and Yongqing Ren and Zhiyao Xie},
  title = {{Profile-Guided Temporal Prefetching}},
  booktitle = {ISCA},
  year = {2025},
  doi = {10.1145/3695053.3731070},
}
Figure