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

    <tr>
        <th>Summary</th>
        <td>
            clang: generates extra assembly code when it should not
        </td>
    </tr>

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

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

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

<pre>
    In a real example, I examined with @philnik777, we came across a libc++ function that could be rewritten in a better way.
We dug deeper and found out that the 'new' function which is meant to be faster and cleaner, somehow generates a larger assembly code than it should be (by 2 asm instructions on x64).

Godbolt example:
https://godbolt.org/z/1a3YfTEhf

I opened this issue as advised by philnik777

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxckkGPmzAQhX-NuYw2AkOAHDjsdku190pVj4M9YLfGjuxhSfrrK0jajfYCGjTz3se8wZTs5Ik6cXwRx9cMFzYhdtrijJ4pz4s2G4K-dm8eECKhA7rgfHYk5Bd42wvrScNq2YCo8rOxztvfTdNsDSuBwpkAVQwpAYKzgxLyRcgXGBev2AYPbJBBhcVpGAgirdEykwe7WQ7ETBFWvB5E_iry5x8EeplAE50pAnoNY1i8hrDwTYkNgZCNp1XI5sNlNVYZsAlmQs_AYTMbMfFdRTlCT3GjTmEmE1aYyFNEph0c47R1pkTz4K6ggqbNz4NlSOYfvZDtcAUJmGawPnFcdvcEwcOlroQ83X_j9vwW9BAc_99pef9umM9pq2QvZD_dug4hTkL2f4TsCyx_jt-_mvFR7A3CmbYs2NgENqWFABOgfreJNAxXeAhnn8h0V-pTecKMuqI-FceiKGqZma5sGiw1yUbjeJKtktSooi2pzIe8VTlltpO5LPM2b4u6kJU8tCNWbaU11W1ZqRZFldOM1h2ce5838mwH6urqWNaZw4Fc2o9OSk_rjVZIud1g7LaZp2GZkqhyZxOnDxW27KhTDv0kyueHiOjCET_lsxp6zMcHzpbouk_btWyW4aDCLGS_-dxfT-cYfpFiIfudLgnZ7_R_AwAA__-M2Q0s">