[LLVMdev] How to unroll loop with non-constant boundary

Duncan Sands baldrick at free.fr
Mon Feb 27 11:17:21 PST 2012


Hi Benjamin,

> LLVM misses this optimization because ScalarEvolution's ComputeExitLimitFromICmp doesn't handle signed<= (SLE) and thus can't compute the number of times the loop is executed. I wonder if there's a reason for this, it seems like something simple to add.

instsimplify could also be enhanced to clean it up in this particular case, but
it would be better to make scev smarter.

Ciao, Duncan.



More information about the llvm-dev mailing list