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

    <tr>
        <th>Summary</th>
        <td>
            Add `function_return` attribute and corresponding `-mfunction-return=` flag
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            new-feature,
            missing-feature
      </td>
    </tr>

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

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

<pre>
    GCC supports a`function_return("choice")` function attribute (https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html). This might be something clang should support.

> function_return("choice")
>> On x86 targets, the function_return attribute causes the compiler to convert function return with choice. ‘keep’ keeps function return unmodified. ‘thunk’ converts function return to call and return thunk. ‘thunk-inline’ converts function return to inlined call and return thunk. ‘thunk-extern’ converts function return to external call and return thunk provided in a separate object file.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNU01zmzAQ_TXiooHBwjZw4ODaSY-99N4R0gJqhMTow0n_fRdsajfJTDwDQsvuvn2rfWqt_NN8Px6pj9NkXfCUk33eRSOCsuaXgxCdIawijInBKgG4IazGGLoGUR6CU20MQDFwCGHypDgQ9oxPL0TWm5hZ16NljVYGpBX-4sL1rdqnz1eg9LAC-WwIo8Y6Gf05KE9H1Q-BtkC9HSEMyvRUaI6rH2zUciWfkfxE8sN1LZ7o132soXP0D0ORDg3c9RCQ4pGGAd5j3HUrePTglyBhx0lpcDRY3JszuHA7n2viqwoDvRTPKHlipMpJXb0ATKtR09nyHzKjGa1UnQJ5lxiGaF5umdeqH5NnRlxryo3892tOfQ-VqmU6jyFeYuWDyPAWAE__IeRLLNefQ9PJ2bOSWFnhJKiHiTuOo7DtbxB45DiD_0SQyKaQdVHzJKigoTlIST_RN6r5Nta5prDOgZ-skbPW0J-Oa056zSlOyyXQvE-i08073eOsY5uhLNDQ-rx-UuQ_M0VTeR9hvgi77TbfJkNTFrJq67zEl3eFELIouraAqmD7YrPfQqJ5C9o3ZPdtVvGsf6zXOWsCGLno-Yg3kBl4TTvgSBJuP0csh63cO3anRDUsZyxH-E29Ydsq2-z2rCqrsuRi13VlSbY5jFzpbCY_3-LENUsfbew9OrXywd-cHIv0BmDhiPg8hsG6RnluWu5ksvTcLA3_BZ9LfYU">