@layout(SoA)
Data-Oriented Design for Vectorisation
The Problem
The default Array-of-Structures (AoS) layout creates strided memory access when iterating over a single field, destroying cache locality and completely preventing SIMD auto-vectorization.
The Contract
Instructs the compiler to physically transform the in-memory layout of an array of structs into a Structure-of-Arrays (SoA), achieving contiguous, unit-stride access.
LLVM Mechanism
The compiler rewrites the type definition into a 'handle' struct of pointers, and transforms single GEP (getelementptr) instructions into multi-step sequences that load the field base pointer before indexing.
