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

    <tr>
        <th>Summary</th>
        <td>
            "Trip Count for Loop [...] Changed! Old: 6 New: 0 Delta: 6" with simple-loop-unswitch and -verify-scev
        </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: 6568062ff18
Reproduce with ```opt -S -passes="function(print<scalar-evolution>,loop-mssa(simple-loop-unswitch))" -verify-scev bbi-99125_2.ll```
Result:
```
Trip Count for Loop at depth 1 containing: %for.cond<header><exiting>,%for.body,%for.cond25.i<exiting>,%func_32.exit.i,%func_7.exit<latch>
 Loop at depth 2 containing: %for.cond25.i<header><exiting>,%func_32.exit.i<latch><exiting>
 Changed!
Old: 6
New: 0
Delta: 6
```
(Thanks to @nikic for reducing the testcase in
https://github.com/llvm/llvm-project/pull/106075#issuecomment-2348628220 )

[bbi-99125_2.ll.gz](https://github.com/user-attachments/files/16993706/bbi-99125_2.ll.gz)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2PpDYQ_TXFxQKZMqbhwGGne_sUJVKy95XbFI0zxkbY9GTz6yPDTLZ7MllpJYRVH3a9en4uFYK5OqIO5BPIU6bWOPqlm8yzIjt6O5HLLr7_1ll7m5j202QiiE-slnXDaxyGsgF-Av7pd5oX36-a2IuJI4Oa75-fI8v_YPmsQqAA4gSIw-p0NN4BNvNiXARxDFpZteR083bdQuIz4NF6P-dTCAqwCWaaLeWba3XhxUQ9Arbbhyy_0WKGb3nQdGOXi8nbtkT5FQtr_4XyBjSsNvWwm--iXxYzs6NfXWSDX9gv3s9MRdbTHEdWMu1dVMYZd00kAMrBL4X2rgdxHEn1tCTg4kh_mbglpS5e0xKN3620CWVhPkpenf4qsEj-wtz5DpsLxNGq1Lz4vGN-hxL_H-VrwR8ifSx-V-shdy98HJW7Ug9Y7o7fbL-JY7d-pZdkvTJ7IhvVXfQd8YDNl1G558CiZ1BxZ56N3u5goX7Vxl1ZHIlFClGrQMy4fd8Y4xzSbeIZ8Hw1cVwvhfYT4DlJ9nXJ58X_SToCnufVWsBzyWt-kIDChLBSEja5mKOomhobRM6SsHZk-18-PcqquP4N8gTY_ADBGmjJVYxKj-n4AHgejKW0lnXbigOvAc__PRfbrO9E34pWZdSVB6xRcC6qbOwaQqovTdtrPOiLLAep66EhoZtKSGx5ZjrkWPG2FCUiF1Whsed00KLVzSA4r6DiNClji0RM4ZdrtlHQlbyRlcysupAN2zxAdPTCtiggpvGwbHMgv6zXABW3JsTw_ZhooqUOED96RCCfiqIAeboTDXvTC3uTCrtTCeI-Sj56-Ey5_uHNZ-tiu5_Wwtbadht777cO_wkAAP__3q6LCA">