<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/146871>146871</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [DAG] SDPatternMatch m_Zero/m_One/m_AllOnes have inconsistent undef handling
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            llvm:SelectionDAG
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          RKSimon
      </td>
    </tr>
</table>

<pre>
    m_Zero/m_One uses ISD::isConstantSplatVector which allows undefs in the BUILD_VECTOR node by default
m_AllOnes uses isAllOnesOrAllOnesSplat which doesn't allow undefs in the BUILD_VECTOR node by default

All of these need to be consistent with their default and with/without undefs handling to be configurable

This needs to be handled in conjunction with #140745 which will revise m_Zero handling to be closed to m_AllOnes 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkk9v2zgQxT8NdSFiyKN_9kEHJVotgt3CRZzm0ItBiWOJAUUGnJGNfPtCktO06KmnkcQ3-vHNPEVkeodYiuxeZHWkJh58KJ_-O5rRu6j1-r0cT98xeAHNeDo4lBMhycdjLZJKJJWhB--IlePjm1X8gh37IK-D6QaprPVXkpPTeCZpnOQB5f23x__r08s_D8-HJ-m8Rtm-S41nNVkWcTWeKmsPDmnlGLq9HsLtYcHcANojOQEFr6i_I4m4qqyV_jyLCaVD1JK9bFF23pEhRsfyaniYBSZ8tErl9PJZQDMXP_EHeFBOW-P6z9-cTT8F1Vpcgc-DoQVEN8nSgXq-cufd6-Q6Nt6tVAHJNo2LNLu5vRprZcCLIZTrTv4AWk-ric8xRrpM9D7ZqwjLbZFtszTP0jwayvhc5NDu0y5RkGOc7fZ5AokuAPNCFxojU0IMWVzEyRZSgHyT624P7a4osNsViVYijXFUxm6svYwbH_rIEE1YbtN8V2wjq1q0tCQLoPdey7MJxHIRCQABDwJg7hVJdUSLi_e6-nc-y-oolPPZXTv1JNLYGmL6JLFhu6R21me1PNZfFTMG90VxN8jfM7vUj4EM6oLSuF92vGzv5yyjKdhyYH6jOeHQCGh6w8PUbjo_CmiWC6_l7i34V-xYQLOYIgHNzfylhB8BAAD__1tRIao">