<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58702>58702</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Cached disposition of [...] is incorrect: cached Variant, actual Invariant with -verify-scev and indvars,loop-deletion,loop-unroll-full
</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: e18c2c5548f
Reproduce with:```opt -passes="loop(indvars,loop-deletion,loop-unroll-full)" bbi-75311.ll -S -o /dev/null -verify-scev```
Result:
```
Cached disposition of %xor3000.2 for loop Loop at depth 1 containing: %lbl_1342<header>,%for.body2928,%cleanup.cont3033,%lbl_1342.loopexit<latch>,%cleanup.cont3033.1,%cleanup.cont3033.2<exiting>
is incorrect: cached Variant, actual Invariant
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(indvars,loop-deletion,loop-unroll-full) bbi-75311.ll -S -o /dev/null -verify-scev
#0 0x0000000002e5a133 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (../../main-github/llvm/build-all/bin/opt+0x2e5a133)
#1 0x0000000002e57e4e llvm::sys::RunSignalHandlers() (../../main-github/llvm/build-all/bin/opt+0x2e57e4e)
#2 0x0000000002e5a4b6 SignalHandler(int) (../../main-github/llvm/build-all/bin/opt+0x2e5a4b6)
#3 0x00007f73d713d630 __restore_rt (/lib64/libpthread.so.0+0xf630)
#4 0x00007f73d4884387 raise (/lib64/libc.so.6+0x36387)
#5 0x00007f73d4885a78 abort (/lib64/libc.so.6+0x37a78)
#6 0x0000000001eaa40c llvm::ScalarEvolution::verify() const (../../main-github/llvm/build-all/bin/opt+0x1eaa40c)
#7 0x00000000038263ab llvm::FunctionToLoopPassAdaptor::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x38263ab)
#8 0x00000000031cd6fd 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+0x31cd6fd)
#9 0x000000000266983c llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x266983c)
#10 0x0000000000aef67d 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+0xaef67d)
#11 0x000000000266db1e llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x266db1e)
#12 0x0000000000aef45d 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+0xaef45d)
#13 0x0000000002668aec llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x2668aec)
#14 0x0000000000721599 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+0x721599)
#15 0x0000000000730a81 main (../../main-github/llvm/build-all/bin/opt+0x730a81)
#16 0x00007f73d4870555 __libc_start_main (/lib64/libc.so.6+0x22555)
#17 0x000000000071a200 _start (../../main-github/llvm/build-all/bin/opt+0x71a200)
Abort
```
[bbi-75311.ll.gz](https://github.com/llvm/llvm-project/files/9899039/bbi-75311.ll.gz)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlWMlu4zgU_Br5QliQSK0HH5zFmGC6MUEn6KtBSZTMaVoUSMqdzNfPoyQnpuN0ZxvMZhi2xaVevXolymQhq_uFELstKuV2y41HloiFWYnLOI6y2gsuvGD5hXVKVn3J0HduNjDES4LxLTuD5h3VmmmPXHgYCyk7D2e8rXZUaQ-f24Z5xQQzXLb7675VUoh53Qvh4RymoaLg8zQmYegLgeY3aC6Rh1cV28Fn29u2HVO8vp_rEtr24ff0dC8s8_HyqPeclhtWoYrrTmpuWSBZA3h8JxUJgsDHqJYKWV7ok_2gBlWsMxsUgiatobzlbWN1gTmiEOuQRNgj5xtGK6Y8cglJQQ9g-AWIiXOcjS2lYLTtO9-CkICQsXWP4NuA7M4qfi6oKTcPSMfz_PCZdsvCIgz0LsdsEdeIt6VUipVDMcsx_a9UcdoaQEK0ND0V6KrdTW3DxOtPl8ubS6T7AlyAKCr6BinWSWWQkWhjTKetwngF7wZc0BdAZAsX1jzT1xxs8ruNi1dc6x48gVeItpVlJPqKIbNhqFRUb1BBy29G0ZL5Y_gbAw2o6rfdQx0D6MqvlWwU3SKqmn7LWmNJIN8H4OFjC9WZj3QeqRQ9F9WcWm-tCg6mW7k2fYtHX2nQsRYeJgEK7oL9C7OYhoSggSekSZb6Xo8_rhVvzSDCrVUF6D0OUvT7WmqjGIXsEltCbiuZA372Fik8fBbcTVzs7fdANjwim7KInSL7pW9veNNS8QsUVzCrYfYBfGw4hw8-Fi8qEuREHsr4IVoAtBObTLHTOiVVG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