[PATCH] D49602: Use SCEV to avoid inserting some bounds checks.

Joel Galenson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 20 11:07:19 PDT 2018


jgalenson added a comment.

In https://reviews.llvm.org/D49602#1170109, @eugenis wrote:

> >> Do the tests cover cases where only one or two of the checks can be omitted, but not all of them? Does not look that way.
>
> Consider a loop where offset is always inbounds, but offset + access size may be not. Bounds checks is still needed, but it should be cheaper, because Size <= Offset will be constant false.


Do you mean something like an off-by-one test, e.g., for (int i = 0; i <= 1000; i++)?


https://reviews.llvm.org/D49602





More information about the llvm-commits mailing list