[IndVars] Use isLoopBackedgeGuardedByCond for last iteration check
authorMax Kazantsev <mkazantsev@azul.com>
Thu, 26 Nov 2020 05:34:55 +0000 (12:34 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Thu, 26 Nov 2020 05:37:21 +0000 (12:37 +0700)
commitf10500e220e354a80c53490158933ca2ede3be20
tree49bbea46a0e282a56a0c18a97f9f5f241b1fb4e6
parentf78ad68b6d8ccfd6e082e6430528751376084726
[IndVars] Use isLoopBackedgeGuardedByCond for last iteration check

Use more context to prove contextual facts about the last iteration. It is
only executed when the backedge is taken, so we can use `isLoopBackedgeGuardedByCond`
to make this check.

Differential Revision: https://reviews.llvm.org/D91535
Reviewed By: skatkov
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Transforms/IndVarSimplify/predicated_ranges.ll