[InstCombine] Fold binop of `select` and cast of `select` condition
Simplify binary operations, whose operands involve a `select` instruction and a cast of the `select` condition. Specifically, the binop is canonicalized into a `select` with folded arguments as follows: (Binop (zext C), (select C, T, F)) -> (select C, (binop 1, T), (binop 0, F)) (Binop (sext C), (select C, T, F)) -> (select C, (binop -1, T), (binop 0, F)) Proofs: https://alive2.llvm.org/ce/z/c_JwwM Differential Revision: https://reviews.llvm.org/D153963
Loading
Please sign in to comment