Op0 <u (zext i1 X) --> Op0 == 0 && X
https://alive2.llvm.org/ce/z/avQDRY
This is a generalization of 4069cccf3b4ff4a based on the post-commit suggestion.
This also adds the i1 type check and tests that were missing from the earlier attempt; that commit caused several bot fails and was reverted.
Might make sense to use m_c_ICmp instead? Something along these lines:
if (match(I, m_c_ICmp(Pred, m_Value(X), m_OneUse(m_ZExt(m_Value(Y))))) && Y->getType()->isIntOrIntVectorTy(1) && Pred == ICmpInst::ICMP_ULT)That would probably make it easier to extend this to the conjugate sext pattern: https://alive2.llvm.org/ce/z/2JTkdF