[InstCombine] Fix infinite recursion in ashr/xor vector fold.
The added test has poison lanes due to the vector shuffle. This can cause an infinite loop of combines in instcombine where it folds xor(ashr, -1) -> select (icmp slt 0), -1, 0 -> sext (icmp slt 0) -> xor(ashr, -1). We usually prevent this by checking that the xor constant is not -1, but with vectors some of the lanes may be -1, some may be poison. So this changes the way we detect that from "!C1->isAllOnesValue()" to "!match(C1, m_AllOnes())", which is more able to detect that some of the lanes are poison. Fixes PR52397
parent
341cc1b4
Please register or sign in to comment