IT lexicon › Programming › Strip-mining

Strip-mining

Programming På svenska → Updated: 2026-11-07

Cutting a loop into fixed-length strips: an outer loop over the strips and an inner one over the elements of each strip.

The transform comes from vector machines. The Cray-1 had 64-element vector registers, so a loop over ten thousand elements could never be a single vector instruction. The compiler rewrote it as an outer loop stepping by 64 and an inner loop that matched exactly one register's worth. Ten thousand doesn't divide evenly by 64, so the leftovers went into a shorter final strip. The name borrows from surface mining, where the ground is dug away in parallel bands.

On its own, strip-mining doesn't change the order in which work happens, only how it's grouped. The point is what it enables. Today's auto-vectorizers do the same thing with the SIMD width, and strip-mining several dimensions and then interchanging the loops gives you loop tiling. ARM's SVE and RISC-V's vector extension let the hardware report the strip length itself, which makes the remainder loop disappear.

← Back to the lexicon