[ScalarEvolution] Fold %x umin_seq %y if %x cannot be zero
authorNikita Popov <npopov@redhat.com>
Mon, 9 May 2022 13:01:27 +0000 (15:01 +0200)
committerNikita Popov <npopov@redhat.com>
Mon, 9 May 2022 13:11:05 +0000 (15:11 +0200)
commit18eaff1510525a2226e1fd0c31c6b176f07ae0a7
tree87275d90b809c20163da3fac9aaa217edd0cf057
parentec6024d0811b3116e0a29481b01179d5081a3b92
[ScalarEvolution] Fold %x umin_seq %y if %x cannot be zero

Fold %x umin_seq %y to %x umin %y if %x cannot be zero. They only
differ in semantics for %x==0.

More generally %x *_seq %y folds to %x * %y if %x cannot be the
saturation fold (though currently we only have umin_seq).
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll