NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Efficient vectorization of SIMD programs with non-aligned and irregular data access hardware

Hoseok Chang, Wonyong SungCASES 2008

TL;DR

This paper tackles the challenge of efficiently vectorizing programs for SIMD processors, which often struggle with non-aligned and irregular data access. The authors introduce novel hardware components – a split line buffer and a packing buffer – to accelerate these problematic memory accesses. Their approach significantly boosts the number of vectorizable loops and overall performance, as demonstrated on an MPEG2 encoder.

What Problem Does This Paper Address?

Single Instruction, Multiple Data (SIMD) processors are powerful for applications with high data-level parallelism, like multimedia processing. They achieve efficiency by performing the same operation on multiple data elements simultaneously. However, a major hurdle in fully exploiting SIMD's potential is how data is organized in memory. Often, data isn't perfectly aligned on memory boundaries (non-aligned access) or is scattered in a non-sequential manner (irregular access). These situations force the processor to perform extra, time-consuming operations (like shifting, masking, or complex address calculations) to gather the data correctly. This overhead not only slows down execution but also makes it very difficult for automatic vectorization compilers to optimize code effectively. The paper aims to bridge this gap by proposing hardware solutions that directly address these memory access inefficiencies, thereby enabling compilers to vectorize more code and achieve higher performance.

Methods

The core of this paper's contribution lies in the introduction of two specialized hardware units designed to mitigate the performance penalties associated with non-aligned and irregular data access:

  • Split Line Buffer: This unit is designed to handle non-aligned memory accesses. When a data request straddles a cache line boundary, the split line buffer temporarily stores one cache line while the other is being accessed. A merge unit then combines the data from both lines to form the complete vector. This approach avoids the need for complex software-based alignment operations.
  • Packing Buffer: This unit is specifically designed to simplify irregular and stride data access. It's a small, multi-port memory block that uses a vector index register to manage multiple addresses. By storing array indices in this register, the packing buffer can efficiently fetch scattered data elements. The paper suggests this buffer can be implemented as an on-chip memory block or as a "packing cache" with tag comparison logic.

The authors also developed a compiler framework that leverages these hardware units. This framework, built upon the GCC compiler, analyzes code for vectorization opportunities and generates SIMD instructions that utilize the new hardware. The compiler's analysis steps are simplified because the hardware now handles many of the complex alignment and access pattern issues that previously hindered vectorization.

Datasets

The paper evaluates its approach using:

  • DSP Kernels: These include a 16-tap FIR filter, a 12th order IIR filter, a 16x16 2D-DCT, and a 1024-point FFT. These benchmarks are chosen for their complex data access patterns, including non-aligned, stride, and irregular accesses.
  • MPEG2 Encoder: This is a real-world multimedia application benchmark used to demonstrate the practical performance gains of the proposed hardware and compiler.

The paper does not introduce new benchmark datasets but rather uses established benchmarks to evaluate its proposed hardware and compiler modifications.

Key Insights and Ideas

  • Hardware is Key for Irregular/Non-aligned Access: The paper strongly argues that while software optimizations (like loop transformations) can help, they have limitations. True efficiency for irregular and non-aligned SIMD memory accesses requires dedicated hardware support.
  • Split Line Buffer for Non-Alignment: The split line buffer effectively addresses the common problem of data not starting on a cache line boundary, significantly reducing overhead compared to software-only solutions.
  • Packing Buffer for Irregularity: The packing buffer, with its index register mechanism, is crucial for efficiently handling scattered data accesses, which are prevalent in algorithms like DCT.
  • Compiler Simplification: The proposed hardware simplifies the job of auto-vectorization compilers. By offloading complex memory management to hardware, compilers can more easily identify and vectorize loops that were previously too difficult to optimize.
  • Performance Gains are Substantial: The combination of hardware and compiler support leads to significant improvements in both the number of vectorized loops and overall execution speed.

Key Results

The paper reports significant performance improvements:

  • MPEG2 Encoder: The proposed system (128-bit SIMD ALU with split line buffer and packing buffer) achieved a speed-up of 1.77x compared to a conventional SIMD processor with a standard memory system. The split line buffer alone provided a speed-up of 1.55x.
  • Vectorized Loops: The number of vectorized loops increased by 50% for the MPEG2 encoder benchmark.
  • DSP Kernels: Performance improvements were observed across various DSP kernels, with notable speed-ups for the FIR (1.78x with split buffer), IIR (2.92x with split buffer), and 2D-DCT (1.89x with split and packing buffers) benchmarks. The packing buffer was particularly effective for irregular access patterns in the 2D-DCT.
  • Reduced Overhead: The packing buffer/cache reduced the cycle count for a specific part of the Chen-Wang DCT loop by 171.4% compared to conventional SIMD instructions. It also reduced register usage.

Limitations and Future Work

  • Hardware Cost: While the paper claims the packing buffer requires "very small changes" and "small size," the exact hardware cost and complexity are not deeply analyzed. The packing cache, in particular, adds tag comparison logic.
  • Cache Coherency: The packing cache introduces coherency issues with the main cache, which needs to be managed.
  • Compiler Complexity for Non-Hardware Support: The paper notes that even with hardware support, compilers still need to be aware of it. The presented GCC modification is a step, but further integration and optimization might be needed.
  • Future Work: The authors suggest that the performance increase is dependent on the width of the SIMD ALU, implying that further exploration with wider ALUs and different cache configurations could yield even greater benefits. The paper also hints at the potential for dynamic memory management schemes for the packing buffer.

Summary updated

BibTeX
@inproceedings{chang2008efficient,
  author = {Hoseok Chang and Wonyong Sung},
  title = {{Efficient vectorization of SIMD programs with non-aligned and irregular data access hardware}},
  booktitle = {CASES},
  year = {2008},
  doi = {10.1145/1450095.1450121},
}
Figure