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

    <tr>
        <th>Summary</th>
        <td>
            LICM drop call instruction metadata
        </td>
    </tr>

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

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

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

<pre>
    In LICM.cpp::cloneInstructionInExitBlock, we have a special treatment for call instructions. However, in the end, when we do `New = CallInst::Create(CI, OpBundles);`, therefore original call instruction metadata isn't cloned. We probably need to add `New->copyMetadata(*CI);` after the call instruction creation.

Reproducer:
https://godbolt.org/z/MqTY63KW7

You can see that the 'alias.scope' and 'noalias' metadata were lost.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0kl9vmzAUxT_N5eWqCOwA4YGH_ClatHWTqklVH419E7w5NrNNs-zTT6bROq3aC4iDzrm_Y18Rgj5Zog6qLVT7TMxxdL57dHYvRmHLoswGp67dweKnw-4hl9MEfAN8I42zdLAh-llG7ezB3v_UcWuc_A5shxfCUbwQCgwTSS0MRk8inslGPDqPUhiD-s0ecvzgLvRCPrm1xTgSklVL1kg2BSqHUBef6YLA97gTxqT5rzi7lE7A1rtDsnyZtrNVhgKwFvgW6iKpcSRPR-cJndcnbYV5x4FnikKJKFAHC6yJuBRVOT4RTt4NYjBXtEQKo0Oh1A3pDvi9dNP14WYHtga2STC3-SiOkfxS691MmeC1szkUeyg2r89HmrxTsySfGi7SGOMU0hfrgfUnpwZnYu78CVj_C1j_8OPrc80_PjV_5zy7GaWwGIgwjiIuCMAaYbQIeZBuImANCquSat2iJ-XPSVzIExoXYp6pjquWtyKjrmzKqlpzxqts7JRsK1k1dXFs-IrV7LjipeRctkq0daPaTHesYKuiKnlRV7yq8mLVSFUNFV8XAy8Zg1VBZ6FNbszLOXXKdAgzdW3Zlm1mxEAmLEvKmKULLj-BsbSzvkueu2E-BVgVRocY3lKijoa6tLuovJv-f-HZ7E33zwnrOM5DLt0ZWJ8Sb6-7ybtvJCOwfuEIwPqF83cAAAD__zClEKA">