This paper provides a behind-the-scenes look at the High-Level Optimizer (HLO) within the Intel production compiler for the Itanium processor family. It details how complex loop and memory transformations were integrated and ordered to exploit the unique Explicitly Parallel Instruction Computing (EPIC) architecture, ultimately delivering world-class floating-point performance.
The Memory Wall and EPIC Architecture
As processor speeds have historically outpaced memory latency, the "memory wall" became a primary bottleneck for high-performance computing. This is especially true for the Itanium (EPIC) architecture, which relies heavily on the compiler—rather than hardware out-of-order execution—to find and exploit instruction-level parallelism (ILP).
The challenge addressed here is twofold: first, how to best use Itanium’s specific features, such as its 128 general-purpose registers, rotating registers, and predication; and second, how to organize a vast repertoire of optimizations into a stable, efficient "phase-order" that works for real-world production code without exploding compile times.
Methods: The HLO Optimization Pipeline
The HLO module focuses on transformations that operate on high-level structures like loops and arrays. The authors categorize their approach into four main areas:
- Locality Optimizations: Using linear loop transformations (interchange), loop fusion, and loop distribution to ensure data stays in the cache.
- ILP Enhancements: Techniques like "unroll-and-jam" and "load-pair insertion" (which loads two floating-point numbers in a single instruction) to keep execution units busy.
- Resource Management: Scalar replacement of memory references, which moves array elements into registers to reduce memory traffic.
- Data Prefetching: Issuing
lfetchinstructions to bring data into the cache before it is needed.
A core contribution of the paper is the Phase-Ordering Logic. Instead of running optimizations in a random sequence, the authors developed a specific pipeline to ensure that earlier stages "prime" the code for later, more aggressive optimizations.
 Source, p. 4
Key Insights and Engineering Pragmatism
- The Power of Interaction: Optimizations are rarely independent. For example, loop unrolling isn't just about reducing branch overhead; it's a "helper" that exposes opportunities for load-pair insertion and better data prefetching.
- Register Wealth: Unlike x86 architectures of the time, Itanium’s 128 registers allowed the compiler to be incredibly aggressive with loop fusion and unrolling without worrying about "register pressure" (running out of registers and having to "spill" data back to slow memory).
- Rotating Registers for Prefetching: The paper highlights a clever use of Itanium’s rotating registers to manage prefetch addresses, which eliminates the need for complex predicate calculations and saves memory slots.
- Production Constraints: In a production compiler, "perfect" isn't always better. The authors moved "affine-condition unswitching" later in the pipeline to avoid expensive, repetitive updates to the program's dependence graph, prioritizing compile-time efficiency.
Key Results
The HLO module delivered substantial performance gains across the SPECfp2000 suite, which consists of 14 compute-intensive programs. Testing was performed on an 800MHz Itanium processor system with a 4MB L3 cache.
- Massive Serial Speedups: Several benchmarks saw speedups between 2x and 5x compared to a baseline that already included standard global optimizations. The geometric mean speedup across the suite was over 2x.
- Prefetching Synergy: While data prefetching alone provided a ~20% gain, its interaction with other HLO optimizations (like unrolling) increased its contribution to nearly 40% in some cases.
 Source, p. 2
Conclusion
The integration of HLO into the Intel production compiler demonstrates that a carefully ordered sequence of high-level transformations is essential for extracting performance from EPIC architectures. While compile-time costs and heuristic dependencies remain challenges, the synergy between locality, ILP, and prefetching optimizations provides a robust framework for overcoming the memory wall.
Summary updated