[InstCombine] use logical-or matcher to avoid crash
This should prevent crashing for the example in issue #58552 by not matching a select-of-vectors-with-scalar-condition. A similar change is likely needed for the related fold to properly fix that kind of bug. The test that shows a regression seems unlikely to occur in real code. This also picks up an optimization in the case where a real (bitwise) logic op is used. We could already convert some similar select ops to real logic via impliesPoison(), so we don't see more diffs on commuted tests. Using commutative matchers (when safe) might also handle one of the TODO tests.
parent
29661fe9
Please register or sign in to comment