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

    <tr>
        <th>Summary</th>
        <td>
            AMDGPU should implement TargetLowering::hasAndNot
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            backend:AMDGPU
      </td>
    </tr>

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

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

<pre>
    AMDGPU should implement this optimization hook: https://github.com/llvm/llvm-project/blob/b333edd0d6da744c099ad3ff3b5fbd2d4e4dd45a/llvm/include/llvm/CodeGen/TargetLowering.h#L797

This is available on the SALU for i32 and i64 (s_andn2_b32 and s_andn2_b64).  The implementation therefore should be approximately !N->isDivergent() && (N->getValueType() == i32 || i64).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUkkFvnD4QxT_NcLGygjEs6wMH_st_c0mjSt30Gtl4ADfGRrbZNv30FZukqx566IUR4yfPm-efjNGMjqiB6j-oukyuafKhkSGSmzPl9WvTfuruPz-xOPnVambmxdJMLrE0mcj8ksxsfspkvGOT9y_AWzaltETgLeAJ8DSaNK1q1_sZ8GTt5aPcLcF_oz4BnpT1aiucc9I613st67LscyGk5sPAVTUojbqkUuuykrd7jOvtqunWOHpN9-QAT2cZRkoP_jsF48bdBMgfalFD3kHevn3P2wYmMnmRxkpliXnH0kTsS_vwxAYfmOHIpNPM7EsGeIjP0mmHz-q9_ft_XwKKHWPniW4JvYWSJgo0-EAfCSpiclmC_2Fmmci-MsDi8Q74_yZ25kJhJJcAD4CCAe4B99vkq2Ck9FXalc6vC30oeAe8u_qE-gj1cbO6ecl0w7XgQmbUFDWK_FDXhyKbmpLnvTiQpprXWmBRH_qq52LYl-LABdaZaTDHssiLfVHmghe7Xg1KK14LUagKeQFlTrM0drdlvvNhzEyMKzVFgVWVZ1YqsvEKFOLovWaDCTGxqwgQAY-AqGT_Qk4Db9_42g6qLgvNFQ21jhHK3JqY4m1MMsnSX3n888E3_Hg7ydg6_ehTtgbb_DOXV8sR8PS-2qXBXwEAAP__rDkB5g">