Mettle

extern-call-in-bodyThe loop body calls an external function

Reported by --explain after a verdict.

mettle explain extern-call-in-body

The body calls a function declared extern. The compiler has no body for it, so it can never inline the call away, and the loop can never vectorize while the call is there.

Fix: move the extern call out of the loop. Where the loop computes the values and the extern call only consumes them, split it in two: a vectorizable loop that fills a buffer, then one call.

Related