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

    <tr>
        <th>Summary</th>
        <td>
            Cached disposition of %cmp229 for block % is incorrect! with opt -verify-scev and loop-rotate
        </td>
    </tr>

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

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

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

<pre>
    llvm commit: 
Reproduce with:```opt -passes="loop-mssa(indvars,loop-rotate)" bbi-74605.ll -verify-scev -o /dev/null```
Result:
```
Cached disposition of %cmp229 for block % is incorrect! 
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: ../../main-github/llvm/build-all/bin/opt -passes=loop-mssa(indvars,loop-rotate) bbi-74605.ll -verify-scev -o /dev/null
 #0 0x0000000002e5e323 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (../../main-github/llvm/build-all/bin/opt+0x2e5e323)
 #1 0x0000000002e5c03e llvm::sys::RunSignalHandlers() (../../main-github/llvm/build-all/bin/opt+0x2e5c03e)
 #2 0x0000000002e5e6a6 SignalHandler(int) (../../main-github/llvm/build-all/bin/opt+0x2e5e6a6)
 #3 0x00007fe210d82630 __restore_rt (/lib64/libpthread.so.0+0xf630)
 #4 0x00007fe20e4c9387 raise (/lib64/libc.so.6+0x36387)
 #5 0x00007fe20e4caa78 abort (/lib64/libc.so.6+0x37a78)
 #6 0x0000000001e8e8c6 llvm::ScalarEvolution::verify() const (../../main-github/llvm/build-all/bin/opt+0x1e8e8c6)
 #7 0x00000000037ec04b llvm::FunctionToLoopPassAdaptor::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x37ec04b)
 #8 0x00000000031c946d llvm::detail::PassModel<llvm::Function, llvm::FunctionToLoopPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x31c946d)
 #9 0x000000000264448c llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x264448c)
#10 0x0000000000aea3ed llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0xaea3ed)
#11 0x000000000264876e llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x264876e)
#12 0x0000000000aea1cd llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0xaea1cd)
#13 0x000000000264373c llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x264373c)
#14 0x000000000071fec9 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::ArrayRef<llvm::PassPlugin>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool) (../../main-github/llvm/build-all/bin/opt+0x71fec9)
#15 0x0000000000731c71 main (../../main-github/llvm/build-all/bin/opt+0x731c71)
#16 0x00007fe20e4b5555 __libc_start_main (/lib64/libc.so.6+0x22555)
#17 0x0000000000718c10 _start (../../main-github/llvm/build-all/bin/opt+0x718c10)
Abort
```
[bbi-74605.ll.gz](https://github.com/llvm/llvm-project/files/9756138/bbi-74605.ll.gz)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlWNtu4zYQ_Rr5hbCh--XBD94kRhdNUCMJ-mpQFGWzoUSBpLzrfn2HkuyIjrNN4hS9GYYu5HDmzJkhxWEuiv2c812FiKgqpp1ggRz32nEX97SRomgJRd-Y3kK7E7v9XzQaTRusFFVOcO34PheimVZKYcdPWV3ssFSOf9W1SqGxpo6fgRjKczZNwtiNZpyj6Y5KVu6nitAdmgrk-MuC7uBat5wfbR2wqJYbbP3rSe8VJltaoIKpRiimmaiRKEFfRKrG9zNUColyLsiTaUNMIVYTISUl2vG9wdvV7c3i4QapNgcSEEZ5u0GSNkJqpAXaat0oY95fwn8DfLT5DAiDF8PdcJsCYb91WpdMqRbY8ZcI14Wxx9uCIr2liEistijH5ElLTOisN_-goQEVbdUcnXShK1tJsZG4Qlhu2orW2oBAsxko7i4VZvW0h_MMJW8ZL6YYSIRnVsPVDthbovWeUHVooS1wkfvdPfx8GtHAD1AHCnwKFmqv-oeVZLXuPH40FACMZyGJv62F0pJicCUGXECeNoBA6iN-O_4X9_uAxWThEax3Apa4AT0H9r6tH9imxvwniCSnhqv0E_AYcxYe_5S8GMfIstyF61O4ANWW7WCwnZTU99wi9WOI5XotqdJC0jXMgc7pJWd5HPb3Rm8hRsVMiZnb6S1hjKU0HCl1aUiyIE2QxEzRl9qI0RN3eoIY5CxF0YkijJMU4VycgzVWlICcpSgeU-zRlKYkHoX8gWCO5c1O8NasIX1jn_lDzImolb6I_cGqBSsZwwoSStwwH8FatjUxeB7FLUzRFcziRYEbCMwwYdramkAH8WH2PHcsIJP2iqk7XOMNZFNwdWZQcNONuyzFBh8sJ1PLSY9kYVyMwBVUY8aH5QFcvBMF5echWk69To4ltoJUpnJ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