Re:LLVM Is Smarter Than Me
by echoangle on Monday April 22, 2024 @02:43AM
(#40111926)
Does someone know how the compiler comes up with the closed form solution? Is there a hardcoded list of common patterns and their solution in the compiler, or is this really generated from the code itself?
[ Parent
| on HN ]
I wondered the same thing and found this to be interesting: https://stackoverflow.com/questions/74417624/how-does-clang-...
Yeah, one suspects this is a dumb micro-optimisation to make benchmark figures look better with little practical application.
Re:LLVM Is Smarter Than Me
by lambdaxyzw on Monday April 22, 2024 @05:29AM
(#40112687)
Doing micro optimizations is precisely the compiler's job - so I don't have to worry about it.
Yeah, but all micro optimisations come with costs, from compiler time to maintenance overhead. Someone's still got to ask if it's worth it. And in this case, I just can't see many regular programs containing code likely to trip this, but benchmarks? All the time.