News for hackers. Stuff that matters.
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?
Re:LLVM Is Smarter Than Me by drtc on Monday April 22, 2024 @04:14AM (#40112317)
I wondered the same thing and found this to be interesting: https://stackoverflow.com/questions/74417624/how-does-clang-...
Re:LLVM Is Smarter Than Me by moomin on Monday April 22, 2024 @04:27AM (#40112397)
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.
Re:LLVM Is Smarter Than Me by moomin on Monday April 22, 2024 @07:48AM (#40113401)
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.
Re:LLVM Is Smarter Than Me by fooker on Monday April 22, 2024 @06:21AM (#40112936)
It's more like a hundred matched patterns, with more added once in a while.