<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVMtu2zAQ_BrpsohgPRzXBx3SpAECFGgOAXqmqKW4LUUKJGXD_fou6SQ2AuTSAoYsLfcxOzPS4MZT_6IRitvNjwW9iOTsswihaO9fivYbhyHivBgRsWgeBxEQpOFzoABrQLUaUM6DAIVH8CiCsyFHRlRkyU6wcDYGOGqSGrQ4IEQHLs9CcJZLw4KSFMnXKCMo2rti81Bs3q7NHTxFIBvRW2HMCaRG-TtA1CLyBS-VCZdTOTbRAS3E08LI72Hx7kBjAiRgcm4E9J5hkgLrYnWZcxdgdHKd0cYzFK6lCIEmnhxyY8k7Ri8YTlpFMiD0AYI7w-HkhGE4kFsDaHdMSQHjuvBkiyHimDmBWVgxob-a_VMz4DUkkMSck-ReqYIDrzCOZEwOgVijmxlhGn-qrtlKcirynBOPDE8LLyQTR9xHsg5uNSPwKg4GvJbQ8Wr-stsrynfl5pUbXsn2zjgnUNSJ1TPfXMyJ_qyWEhIrePZucewcMWYB2FQvKeuDz4Qd09HTW91HGyaql7h6NpCmUMGTvYkes7hJle_EAk0PGNEG5-kPnlk-7zugZT9GUN7NOTsTVJVj3477di9KplM737M6xiTCJI3sgHL1ptcxLiE5snnk38TLrkMl3cwPxhze_m7YYL9QRn6kEFYMfLNt9vVtqfu6q9tdJ74IUavdTqlG1qjUVrX7HTaqVqURA5rQF9uvRdPMhjyPk87zbk2xfSj_HwP1zaap64Yf9m3XtVXXNZ0a1QY7sd0M9bboNjgLMlXqUzk_lb7PLYd1Cnxo2D7hcsjM8guBmCEzwkjRYH_PH4CI_67vTPmd_PxbVOa1-rzTXxRPmv0>52916</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Create `TraitPass<T>` and `InterfacePass<T>` to mirror `OperationPass<T>`
        </td>
    </tr>

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

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

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

<pre>
    The `OperationPass<T>` template/base class is useful for a few reasons for defining passes which have to operate on a specific operation:

* It internally checks that the operation is of the given type, providing a good error if not.
* As documentation, it signals the constraint to callers so that it is obvious how to setup a nested pass manager.
* When using implicit nesting, it will nest automatically.

The first two characteristics would also be useful for other constrained passes which must operate on operations with a given trait or interface. Propose adding `TraitPass<T>` and `InterfacePass<T>` to capture this. In-tree, the LinalgDetensorize pass would benefit from the first.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydU01r3DAQ_TX2ZYjxZxoffEiTBgKF5hDoWZZH9rSyZCR5l-2v70ibZJdAL4XFa4_m4817T6OdTsPrgpDdlj82dCKQNS_C-6x5eM2abxyGgOumRcCsfhqFR5Caz4E87B7VrkFZBwIUHsGh8Nb4FJlQkSEzw8bZ6OG4kFxgEQeEYMGmWQjWcKnfUJIi-RZlBFlzn5WPWfn-rO_hOQCZgM4IrU8gF5S_PYRFBH7gpTLisirFZjqggXDaGPkDbM4eaIqABMzWToDOMUxSYGwoLnPuPUxW7iuacIbCtRTA08yTfWosecfgBMOJq0gGhM6Dt2c4nBwxjAeyu4fFHmOSx7BvPNmgDzglTmAVRszormb_XBjw7iNIYs5Jcq9YwYE3GEfSOoVA7MGujDCOPxXXbEU5FTnOCUeGtwgnJBNH3EeyDnbXE_AqFka8ltDyau6y2xvKD-XWnRteyfbBOCdQWCKrZ765mBPdWS0lJBbw4uxm2TliSgKwqV5j1iefCTPFo-f3us82jFRvYXdsoIV8Ac_mJjhM4kZVvhMLND9iQOOtoz94Zvm874iG_RhAObum7ERQkU9DM_VNL_JAQePwwA4O-P8AV0qm-vdlynenhyWEzUeL10_8m5m9fSykXflD68P73w079hfKwJ_k_Y6eX7q6r27zZSj7rvpyJ9VU1m2nbitV9tiPZTdi26vursq1GFH7Ieu-ZnW9anI8TlrHZNVZ95jTUJd1VdXcrm_atinatm7VpEpsRVeOVZe1Ja6CdBGRFNbNuRsSqHGfPR9qdpO_HPKOfD8Q00Duz-ZcrBvY61pH-0ma-D7laY8hLfEXL_-EzQ">