Mettle

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