3 ms·
Not 100% sure but this precise optimization for LLVM is probably part of ScalarEvolution, which tries to figure out how values in a loop evolve: http://llvm.org
by Gankro 11y ago
Not 100% sure but this precise optimization for LLVM is probably part of ScalarEvolution, which tries to figure out how values in a loop evolve: http://llvm.org/devmtg/2009-10/ScalarEvolutionAndLoopOptimization.pdf http://llvm.org/devmtg/2009-10/ScalarEvolutionAndLoopOptimiz...
LLVM also has a pass dedicated to detecting loop idioms: http://llvm.org/docs/doxygen/html/LoopIdiomRecognize_8cpp_source.html http://llvm.org/docs/doxygen/html/LoopIdiomRecognize_8cpp_so...
(I'm not at all familiar with how GCC is architected, sorry)
- schoen 11y agoCool, thanks for the references!