LLVM21 is a stinker and has worse codegen in general, and a bug forced disabled loop auto-vectorization. Turned out to be a blessing: we clearly identified areas we were over-reliant on implicit compiler optimizations and were able to explicitly restructure our code to what we really wanted.
The result is that we now have clean generic SIMD subroutines in places we previously relied on auto-vectorization. And we did it better and as a result produced faster code (see below). Pure ASCII throughput improved more than 20% (30% on Linux) which is insane and is purely because we wrote better SIMD than an auto-vectorizer can. Lit.
We also found it stopped inlining automatically in certain places which destroyed some benchmarks based on real world corpuses. As a result, we now explicitly inline those backed by benchmarks. Wonderful.
"Exotic"-sized integers (e.g. u13) also cause poor LLVM codegen and some performance pitfalls were fixed by adding padding to power-of-two sizes. I know Zig is working on a sema fix for this to avoid LLVM ever seeing these.
Note when I said "in general" above I mean that this was consistently across macOS aarch64, Linux aarch64, and Linux x86_64. Just across the board bad codegen.
Some things slowed down more than can be attributed to noise. I'm looking into that now but they're minor benchmarks. The important ones are parity or better.