[InstCombine] Fold icmp of select with implied condition
authorNikita Popov <npopov@redhat.com>
Fri, 6 May 2022 14:48:02 +0000 (16:48 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 6 May 2022 15:13:32 +0000 (17:13 +0200)
commit82190f917ac4813e22a334b805e84dba8ed4f47d
tree237e49999a69fac4a7af3eac020394b72839e56b
parenta94589d52f0cc7b64284c4372ab55ec93e4fb1a5
[InstCombine] Fold icmp of select with implied condition

When threading the icmp over the select, check whether the
condition can be folded when taking into account the select
condition.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-select.ll
llvm/test/Transforms/InstCombine/minmax-fold.ll