[PATCH] D22377: [SCEV] trip count calculation for loops with unknown stride

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 13:43:52 PDT 2016


eli.friedman added a comment.

Oh, right, missed the ControlsExit.  That doesn't help with the exception-throwing case, though.

Another potentially interesting case: what if the stride is zero?  Then you have an infinite loop.  I have no idea how to resolve this issue.

For the isLoopEntryGuardedByCond bit, I guess the issue is that you basically want "stride < 0 ? 0 : computedcount", and you can't write that in terms of SCEV expressions?  That's reasonable, but you should probably call that out specifically in a comment.


https://reviews.llvm.org/D22377





More information about the llvm-commits mailing list