[InstCombine] Ensure constant folding in binop of select fold
When folding a binop into a select, we need to ensure that one of the select arms actually does constant fold, otherwise we'll create two binop instructions and perform the reverse transform. Ensure this by performing an explicit constant folding attempt, and failing the transform if neither side simplifies. A simple alternative here would have been to limit the fold to ImmConstants, but given the current representation of scalable vector splats, this wouldn't be ideal.
Loading
Please sign in to comment