[InstSimplify] look through vector select (shuffle) in min/max fold
This is an extension of the existing min/max+select fold (which already has a very large number of variations) to allow a vector shuffle because that's what we have in the motivating example from issue #42100. A couple of Alive2 checks of variants (I don't know how to generalize these in Alive): https://alive2.llvm.org/ce/z/jUFAqT And verify the PR42100 test: https://alive2.llvm.org/ce/z/3EcASf It's possible there is some generalization of the fold or a VectorCombine/SLP answer for the motivating test, but I haven't found a better/smaller solution yet. We can also add even more variants here as follow-up patches. For example, we can have shuffle followed by min/max; we also don't have this canonicalization or the reverse: https://alive2.llvm.org/ce/z/StHD9f Differential Revision: https://reviews.llvm.org/D134879
parent
5fc7bbfa
Please register or sign in to comment