4 ms·
Is the LLVM optimisation pass that does this hyper-specialised for this one particular trick, and, if so, is it valuable in practice? Here's an example where (
by spatulon 5y ago
Is the LLVM optimisation pass that does this hyper-specialised for this one particular trick, and, if so, is it valuable in practice?
Here's an example where (I think) the two functions are equivalent, so I'm a little disappointed it couldn't make the same optimisation on the second one. (At least it still optimised the tail call to a jump.)
https://godbolt.org/z/K9rMajsjK https://godbolt.org/z/K9rMajsjK
- Someone 5y agoNo, it is very generic. See https://kristerw.blogspot.com/2019/04/how-llvm-optimizes-geometric-sums.html https://kristerw.blogspot.com/2019/04/how-llvm-optimizes-geo..., https://blog.matthieud.me/2020/exploring-clang-llvm-optimization-on-programming-horror/ https://blog.matthieud.me/2020/exploring-clang-llvm-optimiza... (discussed at https://news.ycombinator.com/item?id=28207207 https://news.ycombinator.com/item?id=28207207) (I remember reading a page with more examples, but cannot find it)