[IndVars] Support different types of ExitCount when optimizing exit conds
authorMax Kazantsev <mkazantsev@azul.com>
Wed, 18 Nov 2020 10:56:34 +0000 (17:56 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Wed, 18 Nov 2020 11:20:05 +0000 (18:20 +0700)
commitf33118c61ce051f13515f5c9b862302fc4fdb89e
tree242e626c31680c354a41fb915786b23e593cdaa6
parent1e6fc2fa532c280abec04f83410dfdb3760dfc0f
[IndVars] Support different types of ExitCount when optimizing exit conds

In some cases we can handle IV and iter count of different types. It's a typical situation
after IV have been widened. This patch adds support for such cases, when legal.

Differential Revision: https://reviews.llvm.org/D88528
Reviewed By: skatkov
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/test/Transforms/IndVarSimplify/predicated_ranges.ll