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

    <tr>
        <th>Summary</th>
        <td>
            [LLD] [X86] Link-time SSE2AVX support
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lld
      </td>
    </tr>

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

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

<pre>
    `-march=x86-64-v3` is very fashionable now, and GAS and IAS support `-Wa,-msse2avx` to convert old-style SSE to VEX prefix variants to avoid AVX-SSE transition penalties, but this approach has some limitations:
- If the assembly code is built with NASM instead of gcc/clang, there is no sse2avx support
- If the assembly code is hand-coded using .byte, sse2avx does not work, see https://github.com/openssl/openssl/issues/27054
- Some runtime libraries may be built without `-Wa,-msse2avx`, but then used to build x86-64-v3 programs

The result is that old-style SSE code is still present in typical x86-64-v3 builds, leading to potential penalties, so I propose to implement link-time SSE2AVX in LLD for generality and reliability.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U8Fy4zYM_Rr6gpFHoiTHPuigXcedzLi9uJPmComwxC5FagjIif--Q03SzbazexIpAg_Aew_IbAdP1Kj6i6qPG1xkDLFpvcH4av3ytumCuTdql2cTxn5U5fFtv8t2VXYr1S4Hy3CjeIcr8miDx84R-PCq9FdAb-C39rJ-n9oL8DLPIQokrL9Q6a_ZxEwab28JSAL0wd8oCgRnMpa7I7hcHtPD8-MLzJGu9g1uGC164fQbb8EaaJ9fsjUuomcrNniYyaMTS5za6BYBGS0DznMM2I8wIgOHicDZyQqmFFZlq_I2g6cryEiAzDR17g59MJSG7BbrBF6tjPBHe_kdrGchNBCuMPS90qfeoR9SPRkprik-wPt8H6P_ssKI3mTpYmBh6wfYdnehhPiBYgIlVIHXEL-tD0Qwisxr9_qk9GmwMi7dtg-T0qcwk2d2P5ws85J4OemHvK7Whi6Jirh4sSslXcRoiWHCO3T0afCw_ES77yyTh4XJJHFSnoF_vQJzDEPEiVWeiP5zJIjEi5M0uoz4X9U_WGGxziXxmbyA9SD32fboPiGvlVapHaFJzEmAOQh5seh-NAMHeEqtzIEphdlpdjQlaGf9t2yl4HJ51O3zSyp2Ph_hGiIM5Cmis3Jf3RzJWexsum9V3m5MU5pDecANNcVDVRzquqirzdjU13L_0NemwF3dGVOg2Ztq35Gp0PTFgTa20bmu87KoCq3rutzq8tDrLt9jZ3bl7nBVVU4TWrd17jZtQxw2q4BNURalrjYOO3K87q7WzhmldVri2KTwrFsGVlXuLAt_BxArbl338_mo6iOo-svLfpdO5_9R8O7bzRJd8wujJez3TzbH8Df18tlq783eGv1PAAAA__9ANXlE">