Return "[LoopDeletion] Break backedge if we can prove that the loop is exited on...
authorMax Kazantsev <mkazantsev@azul.com>
Wed, 26 May 2021 09:52:57 +0000 (16:52 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Wed, 26 May 2021 12:23:21 +0000 (19:23 +0700)
commit43d2e51c2e86788b9e2a582fdd3d8ffa7829328a
tree62d678ba7850318f3a74eb7d7c7e8ac3c7ccb1cd
parentdee46d08293f2ff693893d85c472029207ce750e
Return "[LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration"

The patch was reverted due to compile time impact of contextual SCEV
queries. It also appeared that it introduced a miscompile on irreducible CFG.

Changes made:
1. isKnownPredicateAt is replaced with more lightweight isKnownPredicate;
2. Irreducible CFG in live code is now detected and excluded from processing.

Differential Revision: https://reviews.llvm.org/D102615
llvm/lib/Transforms/Scalar/LoopDeletion.cpp
llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
llvm/test/Transforms/LoopDeletion/zero-btc.ll