indirect-callThe loop body calls through a function pointer
Reported by --explain after a verdict.
mettle explain indirect-call
The callee is not known until the loop runs, so there is nothing to inline and no kernel to match.
Fix: where the pointer holds the same function for the whole loop, switch on it once outside and write a direct call in each arm. Each arm then vectorizes on its own.
Related
- call-in-bodyThe loop body calls a function
- extern-call-in-bodyThe loop body calls an external function
- 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