[SCEV] Add false->any implication
authorMax Kazantsev <mkazantsev@azul.com>
Fri, 19 Mar 2021 04:29:48 +0000 (11:29 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Fri, 19 Mar 2021 04:29:48 +0000 (11:29 +0700)
commitfff1363ba0ae50da3f8f7b732c90e47e504f18a9
tree852e98c785f2bd37c0df8634220449d69ea72f30
parentd8ab7ad317305d80e405ffdb4f33983f743a6ca2
[SCEV] Add false->any implication

By definition of Implication operator, `false -> true` and `false -> false`. It means that
`false` implies any predicate, no matter true or false. We don't need to go any further
trying to prove the statement we need and just always say that `false` implies it in this case.

In practice it means that we are trying to prove something guarded by `false` condition,
which means that this code is unreachable, and we can safely prove any fact or perform any
transform in this code.

Differential Revision: https://reviews.llvm.org/D98706
Reviewed By: lebedev.ri
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/max-backedge-taken-count-guard-info.ll
llvm/test/Transforms/IndVarSimplify/2011-10-27-lftrnull.ll
llvm/test/Transforms/IndVarSimplify/X86/pr35406.ll
llvm/test/Transforms/IndVarSimplify/trivial-guard.ll