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

    <tr>
        <th>Summary</th>
        <td>
            [DebugInfo][LoopDistribute] Removing instructions without salvaging the debug variable Info
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            question,
            debuginfo,
            llvm:transforms
      </td>
    </tr>

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

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

<pre>
    I found a case in LoopDistribute, where debug value informaiton is not salvaged when removing unused instructions in the distributed loops. Here is an example: https://godbolt.org/z/soc3YxGMe.

According to the documentation _How to Update Debug Info_, the debug value info should be salvaged. However, in LoopDistribute, although some of the debug value addresses inside a distributed loop become `poison`, the correct addresses of them can be obtained in other distributed loop. In addition, salvaging the debug value info will leads to some long `DIExpression`s in the given example. So, it seems that the current debug info maintenance in LoopDistribute works well.

I'm not sure whether the conclusion is right. So, this issue is currently a question. cc @OCHyams 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0VE1v4zYQ_TXUZbCCTFn2-qCDN64bAy0KtOihp4AiRxJbiuNySDvpry9IJ26bpCcDJjnvY96TYraTR-xF9010h0qlOFPo92fSM3quBjIv_QlGSt6AAq0YwXr4geh8sByDHVJEIR_gOmNAMDikCS7KpXxtpLAoG8mDZfAUgZW7qAlNvu0h4EIX6ydIPjEasJ5jSDpa8pxB4oxg7iAGHNGZa3jMQJZBecBntZwdinYPc4xnFu1eyKOQx4nMQC7WFCYhj38JeWTS7W_P3_-ItWj2otnvtaZgMnqkGxLptKCPKuPD0yNd88mvZ6MiwqHoOvmRnrLYcv-dVOCZkjMw4F1mDY90xQuG_OZT15SLM6VpBqYFgcYPk5UxAZkxG8LWIKgPlsCAOr8Wm-ZMlsmLTfNGUlMIqOO_xtwwFtDKZ6o0RGV9MR8ozhg-jK_h5PN7m33Jc2_qinOf2XC1zoFDZTj7V3Q58lOmdzh993zOPGwheV_yZC94X2YNv1DxKwIjLgxxVvEmJoWAPr5CFrBFWR_RK68_iSVcKfzBcEXnXpd-EnK73JKYAuYUFsk3p7x2KTPL2Qp2muMbkzhbBsucSuxeWbgXUPBnQs621KA1iHXz08Pji1oYKtO3ZtfuVIX9arvuZLPedm019-thGIbtRplxlF_b0TRthwr1Tn2Vu3GDY2V72ciuWctV0zZd19ad6YbduBo3K612Y7MV6wYXZV3t3GXJ-a4Ks37VbrpWVk4N6Li0Wco3ekJKIR-ElMW5bNz9nzxFtPsYlOdcV84n3aEKfT75MqSJxbpxliP_gxhtdOWLUWqRWyG6g-i-vct3d4Cf3yr-n25fbU59_J8kBasGh6VsVQquf9dsG-c01JoWIY-F_e3nyznQ76ijkMdiCAt5fPXk0su_AwAA__8XJbMc">