body-localA local is declared inside the loop body
Reported by --explain after a verdict.
mettle explain body-local
The recognizers match on a straight run of loads, arithmetic and stores. A local declared in the body adds a stack slot written every iteration, which none of the shapes cover.
Fix: declare the variable before the loop and assign it inside, or fold the expression into the statement that uses it.
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