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

    <tr>
        <th>Summary</th>
        <td>
            [HLSL] Support exported functions for library shaders
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    HLSL libraries allow qualifying a function with `export` to make it a non-entry function that doesn't get inlined and is callable from other shaders that get linked with the library shader.

### Deliverables

* Documentation on how export affects compilation
* Compiler support for parsing and applying `export` to user functions to generate separate functions in the DXIL or SPIR-V output.
* Tests that verify an assortment of user functions with different attributes, semantics, and qualifiers that verify they are maintained as they should be.

### Acceptance Criteria

* Documentation should cover all cases of callable functions and how they should be preserved.
* Output should have non-inlined functions that can be called from linked shaders
* Annotations of parameters and return values should be maintained as appropriate
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VF2P6jYQ_TXOy2hRMBDCQx7oItQrrdSqW1V9nSQT4q5jp54JlH9f2cldliu1EiKJPR9nzpwZZDYXR1Sp3U9qd8pwkt6HavQ33diPrPbtvfr57f0NrKkDBkMMaK2_wd8TWtPdjbsAQje5Rox3cDPSgypy-mf0QVSRg3gY8IPACCA4717ISbg_PKRHgdYTO6X3AhcSMM4aRy2ga8EwNGgt1pagC34ALz0F4B5bCjx7Rx9r3Ae1c37paYF7XwxXKj-p_Lj86838gxNZc6UQg_OzxRFOvpkGcoIJpXfQ-xvMZQF2HTXC0PhhNDZZPBxf02HEOI3JuvMBRgycqHIt4DjaxNuPPE1M4ZMYjicXchRQCJhGTC-Pa-NSoac_v72BD_D-67ffXv4AP8k4yeoB53diWXi6UjDdHdABMvsgsTzw3Y95E4et6ToK0QBFgqknIVb6FZgGdGKa9BGrmXVgPpuxJJGe7oCBYEDjBOd-8nzMvZ9sCzX9R1uOTUOjoGsIXoMRCgb_vztLwMZfKUR5QoNMHEt7aOezvAg69vIZCoyBmMKV2i_c_ZLI_G7U45WSgr_r80urYuUNuhgopoyXUayLKhe1PgIfnfMz9oQy9nYgiRxGdIFkCg6uaCfiLxCfqcRxDH4MBoWyttq0h80BM6rW-_XmkK9LXWR9Rftid6Cu2Be7Xan1Wu_3O9IH2tRFh1S0mal0rrf5Vm_Wh12ui1VXbuu8LEpqi3Zf1nu1zWlAY1fWXoeVD5fMME9UlYdyXWQWa7KcdofWjm6QLpXWcZWEKvq81NOF1Ta3hoUfUcSITUsnLhe1O8H7Mi3zRDyxGwfoeZ45m4KtepGR1eao9Fnp88VIP9Wrxg9Kn2Oe5fEyBv8XNaL0OaFjpc8J_b8BAAD__0H9tVY">