]> granicus.if.org Git - llvm/commit
Exploit a zero LoopExit count to eliminate loop exits
authorPhilip Reames <listmail@philipreames.com>
Sat, 22 Jun 2019 17:54:25 +0000 (17:54 +0000)
committerPhilip Reames <listmail@philipreames.com>
Sat, 22 Jun 2019 17:54:25 +0000 (17:54 +0000)
commit32acc1f62e2758a575e460ae9b2b06b7a33ea4a3
tree20340c3edd0c9b49a520ec03f7790ffad82dec10
parent4130c915bbb1643ec1d5297f2a1a20ad623f73f4
Exploit a zero LoopExit count to eliminate loop exits

This turned out to be surprisingly effective. I was originally doing this just for completeness sake, but it seems like there are a lot of cases where SCEV's exit count reasoning is stronger than it's isKnownPredicate reasoning.

Once this is in, I'm thinking about trying to build on the same infrastructure to eliminate provably untaken checks. There may be something generally interesting here.

Differential Revision: https://reviews.llvm.org/D63618

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364135 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/IndVarSimplify.cpp
test/Transforms/IndVarSimplify/eliminate-comparison.ll
test/Transforms/IndVarSimplify/eliminate-trunc.ll