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

    <tr>
        <th>Summary</th>
        <td>
            opt -passes="aggressive-instcombine" output depends on debug info
        </td>
    </tr>

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

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

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

<pre>
    llvm commit: 324d1bb35aefe
Reproduce with:
```
opt -mtriple aarch64 -aggressive-instcombine-max-scan-instrs=1 -passes="aggressive-instcombine" bbi-87915.ll -S -o -
```
With the dbg.value present aggressive-instcombine does nothing and leaves the two loads from @e be.
If we remove the dbg.value call aggressive-instcombine optimizes the function to
```
define void @y() {
entry:
  %0 = load i32, ptr @e, align 1
  store i32 %0, ptr @l, align 1
  ret void
}
```
[bbi-87915.ll.gz](https://github.com/llvm/llvm-project/files/13070265/bbi-87915.ll.gz)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUk8GOozgQhp_GXEogKMckPnDo3ijSXncPezZ2Ad4xNrJNMt1PP4JkZlqtjDQjgTB2Vf2fy_5VSnb0RB0Tr0ycC7XmKcRutl8UuSm4mXzRB_PWOXedQYd5tpnxF-B4ME3fc6FoIFafWf3yDy0xmFUT3GyeGH-5T7O2fjz7b1gylHOOdnEESkU9tQco1ThGSsleqbQ-ZR3m3noqZ_W1TFr5fTImxs8NlItKibYxQ3yexxCh7215OspGVM5B-S-UAcqnQP_ZPEGeCEw_VlflVoIlUiKf4Xl1MIES-JAn60dQ3oAjdaW0F8m3AC4ok2CIYQZ2qAl6qu5Sfw9wI4g0hyt9ktTKuV_phSXb2b4_FIbV62yDhxye7sfQsCVdgzWb_BvDE0MJ7Ph6Xyef49uP0wFgKGpg_Lxjg-XI8C9YctzZt7FydvTQfI9POUTa4vbMD8HuSXCkvJM8SI_np8hMvH48rmp8Z-LM8DTlvKQNFS8ML6PN09pXOswML9t1fHzKJYb_SWeGl8E6SgwvDa-PNbaC4eVzYZR3zcJ03EguVUFd08pT3YpjzYupE6e-biQ1ehCyVY2WvD5IkrohrU7tURe2wxp5s70oRM0rLaWqSUuN7cloM2yNm5V11UZXhTgWNqWVulZKFIVTPbm0-w3R0w32RYa42S_uPiv7dUxbR23K6WeVbLOjbjfQ73kgrHlZMxhayJsEwYOhfh3B-iEUa3TdHzd4Z906vO_lWwAAAP__WClRdA">