Codes
Every diagnostic and optimizer decision the compiler can print.
The same text is available as mettle explain <CODE>; these
pages are generated from that table.
Compile diagnostics
Errors and warnings the compiler reports against your source. Every one is printed with a caret under the exact span, and every one is listed here.
- E0001Lexical error
- E0002Syntax error
- E0003Semantic error
- E0004Type mismatch
- E0005Scope error
- E0006I/O error
- E0007Internal compiler error
- M0101Use after free
- M0102Double free
- M0103Returning the address of a stack local
- M0104Storing a stack address in a global
- M0105Constant array index out of bounds
- M0106Memory operation overflows a stack array
- M0107Memory leak
- M0108Use after call-freed pointer
- M0109Double free via call
- M0110Borrowed interior pointer outlives its scope
- M0111Borrowed pointer invalidated by realloc
- M0112Borrowed pointer invalidated by free
- M0113Dereference of a null pointer
- M0114Dereference of an unmapped constant address
- M0115Shift count at or past the operand width
- M0116Division or modulo by a constant zero
- M0117Loop index runs past the end of the array
- M0118Integer out of range for its destination
- M0119Narrowing conversion needs a cast
- M0120Pointer cast to an integer and back to a pointer
Why a loop did not vectorize
The optimizer prints one of these in brackets after a NOT vectorized verdict. Each names the specific shape the loop had that no SIMD kernel could claim.
- 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
- int64-elements64-bit integer elements have no kernel
- reloaded-baseThe base pointer is re-read every iteration
- serial-recurrenceThe loop carries a serial recurrence
- mixed-float-widthsThe loop mixes float32 and float64
- byte-sum-narrow-accByte sum into an accumulator narrower than int64
- int32-sum-narrow-accint32 sum into an accumulator narrower than int64
- inlined-param-localAn inlined parameter copy survived in the body
- body-localA local is declared inside the loop body
- dot-shape-addressDot product with an address the kernel cannot follow
- store-only-fillFill loop the fill kernel could not claim
- extremum-shapeRunning minimum/maximum the kernel just missed
- predicated-countAn accumulator updated only on the taken arm
- clamp-storeA value clamped or selected before it is stored
- strided-accessThe loop steps more than one element at a time
- unbounded-shiftA right shift whose input cannot be bounded
- variable-shiftA shift by a distance read at run time
- unrecognized-shapeNo recognizer claimed this loop
Why a call was not inlined
Printed after a NOT inlined verdict. The inliner declines for reasons that are all budget, shape, or contract, and each has a name.
- callee-no-bodyThe callee has no body to inline
- callee-noinlineThe callee is marked @noinline
- callee-denylistedThe callee is on the compiler's inline denylist
- too-many-parametersThe callee takes more than 16 parameters
- callee-parameter-namesThe callee's parameter names are unavailable
- callee-over-budgetThe callee's body is over the inline size budget
- callee-call-countThe callee makes more calls than the inline call-count budget allows
- callee-inline-asmThe callee contains inline assembly
- callee-has-loopThe callee's loop body is over the inline size budget
- callee-no-returnThe callee has no return instruction to rewrite
- callee-has-kernelThe callee's loops became SIMD kernels
- recursiveThe call is directly recursive
- caller-over-budgetThe calling function is over its budget and this site is cold
- argument-countThe call's argument count does not match the callee
- rounds-exhaustedInlining rounds ran out before this call was revisited
What the optimizer applied
The positive verdicts. These say what the compiler did do, and what it had to prove first.
- vectorizedThe loop became a SIMD kernel
- vectorized-innerThe inner loop of a nest became a kernel
- outer-of-nestThe outer loop of a nest, reported for context
- eliminatedThe loop was removed
- inlinedThe call was inlined
- unrolledThe loop was unrolled
- hoistedA call was lifted out of the loop
- if-convertedA branch became branchless arithmetic
- prefetchedA prefetch was inserted
- layout-optimizedA data layout was reshaped
- noalloc-verifiedThe @noalloc contract holds