[PATCH] D63733: [IndVars] Use exit count reasoning to discharge obviously untaken exits

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 12:25:01 PDT 2019


reames created this revision.
reames added reviewers: sanjoy, apilipenko, nikic.
Herald added subscribers: bollu, mcrosier.
Herald added a project: LLVM.

Continue in the spirit of D63618 <https://reviews.llvm.org/D63618>, and use exit count reasoning to prove away loop exits which can not be taken since the backedge taken count of the loop as a whole is provably less than the minimal BE count required to take this particular loop exit.

As demonstrated in the newly added tests, this triggers in a number of cases where IndVars was previously unable to discharge obviously redundant exit tests.  And some not so obvious ones.

Suggestions on tests to exercise the backedge guard form would be very welcome.  I'm not sure is the isKnownPredicate version actually gives us anything, but it's reasonable for completeness sake?


Repository:
  rL LLVM

https://reviews.llvm.org/D63733

Files:
  lib/Transforms/Scalar/IndVarSimplify.cpp
  test/Transforms/IndVarSimplify/eliminate-exit.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63733.206276.patch
Type: text/x-patch
Size: 13959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190624/8b7f090a/attachment.bin>


More information about the llvm-commits mailing list