call-in-bodyThe loop body calls a function
Reported by --explain after a verdict.
mettle explain call-in-body
A SIMD kernel runs eight lanes at once. A call runs one. So a loop that calls anything on every iteration cannot become a kernel until the call is gone.
The inliner runs first and removes most of these on its own, so a loop that still reports this one has a call the inliner declined. The remark for that call, on the same line, says which rule stopped it.
Fix: mark the callee @inline, or lift the call out of the loop when its result does not change between iterations.
Related
- 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
- int64-elements64-bit integer elements have no kernel