HomePhabricator

[InstCombine] Fold select -> and/or using impliesPoison

Authored by nikic on Tue, Jan 12, 1:11 PM.

Description

[InstCombine] Fold select -> and/or using impliesPoison

We can fold a ? b : false to a & b if is_poison(b) implies that
is_poison(a), at which point we're able to reuse all the usual fold
on ands. In particular, this covers the very common case of
icmp X, C && icmp X, C'. The same applies to ors.

This currently only has an effect if the
-instcombine-unsafe-select-transform=0 option is set.

Differential Revision: https://reviews.llvm.org/D94550

Details

Committed
nikicWed, Jan 13, 8:45 AM
Differential Revision
D94550: [InstCombine] Fold select -> and/or using impliesPoison
Parents
rGe433ca28ec92: [SLP] add reduction test for FMF; NFC
Branches
Unknown
Tags
Unknown