[IndVars] Use knowledge about execution on last iteration when removing checks
authorMax Kazantsev <mkazantsev@azul.com>
Tue, 3 Nov 2020 06:18:46 +0000 (13:18 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Tue, 3 Nov 2020 06:38:58 +0000 (13:38 +0700)
commitf847094c246810d698d3d6d476f066e9b8779456
tree4372e77d0e1dddd4d8f40c60cb13a892469f953f
parentb969dfe26f41ce0373a9e1542ebd4cfb0e6a2c25
[IndVars] Use knowledge about execution on last iteration when removing checks

If we know that some check will not be executed on the last iteration, we can use this
fact to eliminate its check.

Differential Revision: https://reviews.llvm.org/D88210
Reviwed By: ebrevnov
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/predicated_ranges.ll