strided-accessThe loop steps more than one element at a time
Reported by --explain after a verdict.
mettle explain strided-access
rgb[i * 3 + 1], dst[i * 2], and any other non-unit stride. Every kernel walks its arrays one contiguous vector per iteration, so a strided access has no kernel to land in. There is no gather or scatter form.
The stride is usually the data layout, not an accident, so there is often nothing to change. When the layout IS free, splitting an interleaved array into one array per component makes every loop over it unit-stride:
// instead of rgb[i*3+0], rgb[i*3+1], rgb[i*3+2]
r[i], g[i], b[i] // three loops, all vectorized
Related
- call-in-bodyThe loop body calls a function
- extern-call-in-bodyThe loop body calls an external function
- indirect-callThe loop body calls through a function pointer
- alloc-in-bodyThe loop body allocates
- inline-asmThe loop body contains inline assembly
- control-flowThe loop body branches
- early-exitThe loop can leave before its trip count
- int16-elements16-bit integer elements have no kernel