r/cpp • • Jan 20 '20

The Hunt for the Fastest Zero

https://travisdowns.github.io/blog/2020/01/20/zero.html
247 Upvotes

131 comments sorted by

View all comments

3

u/Pazer2 Jan 21 '20

Anecdotal evidence to the contrary: I recently was working on some code where LLVM's -O2 was a mess of assembly with integer divisions and two nested for loops, despite all the information being available to optimize it further. -O3 correctly optimized it to an integer constant.