pub fn recognize_matmul(
stmts: &[Stmt<'_>],
_interner: &Interner,
) -> Result<MatmulSpec, MatmulReject>Expand description
Recognize a row-major GEMM idiom anywhere in a LOGOS statement list and extract its MatmulSpec.
Structure required: three nested counted While loops over induction variables i, k, j, with an
accumulating store Set item _ of C to (item _ of C) + (item _ of A) * (item _ of B) in the innermost
body. The three index expressions must be affine and match the row-major layout — verified against the
loop bounds — i.e. C indexed i·N + j, A indexed i·K + k, B indexed k·N + j. Loops that are
not the matmul nest (e.g. an array-build loop) are skipped; the search returns the most-specific refusal
if nothing matches.