[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 10:47:27 PDT 2018


jgalenson added a comment.

In https://reviews.llvm.org/D49602#1170059, @lebedev.ri wrote:

> Out of general curiosity, why is this needed?
>  The optimization passes won't be able to/are not allowed to  drop the extra unneeded checks?


The goal is to improve the performance of code that uses the bounds checker.

Why can't other passes drop the unneeded checks?  Once they're added, they're just comparisons and branches that can be removed if a pass can figure out that the path to a trap will never be taken.  That said, the goal of this patch isn't to enable other passes to remove the checks (that was my old approach) but instead not to insert them when they're not needed.


https://reviews.llvm.org/D49602





More information about the llvm-commits mailing list