The counter stopped counting at -O2
A metrics library exposes `record(name)`, which increments a counter and returns the new count. Most call sites ignore the return value. After a compiler upgrade, the debug build reports traffic and the release build reports none.
record("requests"); as a statement produces no counter increment in the optimized build. let n = record("requests"); print(n); works. The generated IR for the first form contains no call at all — the instruction is simply absent between the two neighbouring instructions.
Commit to the phase, and then commit to the precondition. Dead-code elimination is a legal transformation; state the condition under which deleting an instruction whose result is unused preserves observable behavior. The bug is that this condition was not checked, so you need to be able to say what it is.