[SCEV] Fold umin_seq using known predicate
authorNikita Popov <npopov@redhat.com>
Mon, 9 May 2022 14:15:09 +0000 (16:15 +0200)
committerNikita Popov <npopov@redhat.com>
Mon, 9 May 2022 14:35:08 +0000 (16:35 +0200)
commit68e1ba818869d6312a2774ccc320c0de86a8249c
tree70180615fd5b36b1ba2cd49bfb51eeee0a8415d8
parent7dddf12f448d7ed7e2e35a4de69b53bd140f12c0
[SCEV] Fold umin_seq using known predicate

Fold %x umin_seq %y to %x if %x ule %y. This also subsumes the
special handling for constant operands, as if %y is constant this
folds to umin via implied poison reasoning, and if %x is constant
then either %x is not zero and it folds to umin, or it is known
zero, in which case it is ule anything.
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll