[IndVars] Remove exiting conditions that are trivially true/false
authorMax Kazantsev <mkazantsev@azul.com>
Tue, 29 Sep 2020 04:34:15 +0000 (11:34 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Tue, 29 Sep 2020 04:35:32 +0000 (11:35 +0700)
commitd266fd960e73e2ebdcc194564fc2554ff629d12a
tree52002fb03f76812ffd7da5ecf47859d15ac14cc1
parentc942095790decf525a445f3bd68fb9bcc9aa43c6
[IndVars] Remove exiting conditions that are trivially true/false

When removing exiting loop conditions, we only consider checks for
which we know the exact exit count. We could also eliminate checks for
which the condition is always true/false.

Differential Revision: https://reviews.llvm.org/D87344
Reviewed By: lebedev.ri, reames
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/eliminate-comparison.ll