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

    <tr>
        <th>Summary</th>
        <td>
            Add the tablegen mechanism to lower intrinsics to DXIL ops with extra enum arguments.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:DirectX,
            HLSL
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            adam-yang
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          adam-yang
      </td>
    </tr>
</table>

<pre>
    Some DXIL ops are generic operations that take additional enums to specify the actual type of operation. Here's a quick list of operations that fit the pattern:

```
WaveActiveOp          _, WaveOpKind, SignedOpKind
WaveActiveBit         _, WaveBitOpKind
WavePrefixOp _, WaveOpKind, SignedOpKind
QuadOp                _, QuadOpKind
WaveMultiPrefixOp     _, mask0, mask1, mask2, mask3, WaveMultiPrefixOpKind, SignedOpKind
QuadVote              _, _, QuadVoteOpKind
Barrier               BarrierMode

AtomicBinOp _, AtomicBinOpCode, off0, off1, off2, _
WaveMatrix_ScalarOp   _, WaveMatrixScalarOpCode
```

We need a tablegen solution to easily declare:
- What intrinsic should lower to this DXIL op
- What arguments should come from the original intrinsic and what order should they be
- What additional enum arguments should the specific intrinsic map to.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVM1u4zYQfhrpQsSgKEexDzrYDowtmkVaBOjubTEmR9I0lKiSoyR--4K2JNvZoljDEH-G3zf_AyFQ3SGWyf02UQoMtHdH6OpEqeT-MYWBG-fL-To9OHMsX1yL4vH7b0_C9UGAR1Fjh560cD16YHJdENwAC4ZXFGAMxTuwAruhDYKdCD1qqo6CGxSgeQAr-NijcNWFYyG-oMdEPQQB4p-B9KuwFPjmzainIj5R9cCMvkvyTSIfEzl9Czn-T8dv8IYbzfSGz72Yfz8StRNR9Nz_Tp2Jp5cYGjOeP0G3xD9Dt8SfX__hsaKP5_7X-P8cwFwbdcV_Ft2Sfx0s06xhftpCeJXTJps2atrkkyU38P836i_H-B9GzZZF-TVmC94T-k-OjLdfncHr_GzYtaS31E1hurrYxbdqJ1xVyXHNxlWdLbhEA9jTx48XDRb8KR5zzM-iSbK76L-tjJELRYdoBAiGg8UaOxGcHWK5xdJFCGSPwqC24HEutTvxLVYideypC6RFaNxgjbDuHX3EcUNh6pobCPh6aLHjMEF07K_Ku_ZU085TTbF5LtTQGfEeoc4b9BOMGzyKA95y3_bez7qihnMzkr7S0EIv2C3OXKkpc7PO15BimT2otVrlxUqmTVng8gFArgptMpSFXuerByzWeV4B3heVTKlUUi0zma2UzJdLuSgQ10tVKCXXmJlMJkuJLZBdWPvWLpyvUwphwDLL1PphmVo4oA3jcDqAfsXOJPnmkTxq_h6HlNolSn15enkaJ5YvI9PdYahDspRxXoQLNxNbLDfm7Pac3RZ1Ax2FNqbpnK85EqdpNc-6d-JG4Ad7-BTORTp4WzbMfYgVofaJ2tfEzXBYaNcmah9tGJe73ru_UXOi9idnQ6L2o79vpfo3AAD__2sByfM">