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

    <tr>
        <th>Summary</th>
        <td>
            [mlir] Special handling for pattern rewrite on maskable op
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

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

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

<pre>
    Pattern rewrite on maskable ops requires special handing when they are in `vector.mask` region as the `vector.mask` region only allows a single maskable op (https://discourse.llvm.org/t/rfc-vector-masking-representation-in-mlir/64964)

In https://github.com/llvm/llvm-project/pull/76468 we add some special checks in related pattern rewrites to skip those cases. But as the comment https://github.com/llvm/llvm-project/pull/76468#issuecomment-1897699116, we can provide a specialized pattern rewrite base class to help writing patterns for maskable op
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykk8FunDAQhp_GXEa7MgYMHDgkjZB6q9QnMPYsuDE29ZiskqevzKZp0qqHqhc42J755v_nV0R29ogDa-5Z81CoPS0hDttLRGWKKZjn4YtKCaOHiNdoE0LwsCp6VJNDCBtBxO-7jUhAG2qrHCzKG-tnuC7oIS34DCoiWA9M8ifUKcRzLsAkh4izDR4U5Xt_Pw_ePYNyLlwJFJD1s8P3EMBEt6S0EavumBiZGI0lHfZIeHbuaT2HODMxJibGeNGnW5NTLmD9fIq4RST0SSUb_Mn60-psZGKUdS9rJnrGHxi_u30_e_jYabZp2aezDisTY272-jttMXxDnXtuu3NMjK2sZQdXBGUMUFjxTTG9oH6kLFFEpxIa2D6KTpAC0KPdIC2BELQipDPc7-mndjqsK_r0f3BMVJZox9dip7LrW9n3ZSmZ-JTJtfKwxfBkDWYjbvj25U9gmFTGdIoO9AXdBvkg78XrVYJLiO9dLMxQmb7qVYFD2fJG9j3v62IZajnVnTHS1EZyhVxXmkvRVNVFykuvmsIOgoual2UvyrIr63NVITZlg0I07TRdGlZzXJV1b9tQHHMObdd2beHUhI6OCAhx817kMMTh0GraZ2I1d5YS_SqQbHJHbI4HzQN8fbf-Ls-Zx_tdlo_hKfbohn927ECn7Fmm_xEAAP__nGpEeg">