can LLMs optimize anything?
It’s not perfect, but it understands lock-free algorithms, branch prediction, can tell you which memory order to use for atomic operations if you’re using too strong of an ordering, AND it will catch silly bugs at the same time. I had a bounds check in a lock-free algorithm I was optimizing, which equated to if(idx < start && idx >= end) return false, and it mentioned that error while optimizing.
This guy was really putting it through its paces on already highly optimized code in an esoteric architecture (Nintendo 64) and it still found a few things: https://youtu.be/20s9hWDx0Io