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

    <tr>
        <th>Summary</th>
        <td>
            [HLSL] Introduce a new address space for constant buffer declarations
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            HLSL
      </td>
    </tr>

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

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

<pre>
    Introduce a new address space `hlsl_constant(2)` for constant buffer declarations. Using separate address space will make it easier to distinguish constant globals from other global values. It will be used for all variants of constant buffers :
- `cbuffer` declarations blocks
- default `$Globals` constant bufffer
- `ConstantBuffer<T>`

Clang codegen will generate constant buffer accesses as global variable loads from with `hlsl_constant(2)` address space. These will be transformed to constant buffer load intrinsics later on in an LLVM pass.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEU81u2zwQfBrqsohAUZIVH3TIz-evAdxT016LFbmS2NCkwaUS9O0Lym7d-JCeBIx2Z2d2h8hsJ0_Ui_ZetI8FLmkOsZ_pJSQshmB-9k8-xWAWTYDg6Q3QmEjMwEfUBGIjZ8fuuw6eE_ok1K0Sais2EsYQ4TcMwzKOFMGQdhgx2eC5hK9s_QRMxwzRFfObdQ4O-EJgExCypQgpgLGcrJ8Wy_OFfXJhQMcwxnCAkGaKZwhe0S3EJTylE-FAsDCZVRy6_D9a9IkhjNdiGUR9J-TdTTapT1j29bcHGFzQL7xWGRpxcSlXC9X8f5KUG97xZpIz58MZvz9R1w_Pov4vd8s89sGhn0AHQxP5k_iJPK2bul4rak3MxIB8MR4tDo7ABTTnzbzZNH90sXcHKOF5JqY_a0sRPY8hHsjkO1xLyGPA-hStZ6sZHCaKEDxYD-hhv__2GY7IXBamr8223mJBfdXVXdXKrlLF3A9mrLu6pabaDKaWt11bSZRGj2owt42pCtsrqVpZVZ2q2qpV5Sjbbhi3usO62VSKRCPpgNaVzr0eyhCnwjIv1FeqbuSmcDiQ4zXqSn3af9kLpXLoY5_rb4ZlYtFIZznxhSHZ5NbnsTa0j_Dxe_hX6Islun5O6cg5XGon1G6yaV6GUoeDULs89_y5Ocbwg3QSarfaYKF2ZyevvfoVAAD__y9TQ-k">