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

    <tr>
        <th>Summary</th>
        <td>
            opt crashes in LoopLoadEliminationPass
        </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: 9e83d13c9f77e
Reproduce with:
```
opt -passes="function(require<access-info>,require<should-not-run-function-passes>),scc-oz-module-inliner,function(loop-load-elim)" bbi-80060.ll -o /dev/null
```
Result:
```
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=function(require<access-info>,require<should-not-run-function-passes>),scc-oz-module-inliner,function(loop-load-elim) bbi-80060.ll -o /dev/null
 #0 0x0000000002ef4cb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (../../main-github/llvm/build-all/bin/opt+0x2ef4cb8)
 #1 0x0000000002ef284e llvm::sys::RunSignalHandlers() (../../main-github/llvm/build-all/bin/opt+0x2ef284e)
 #2 0x0000000002ef5336 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f09d886e630 __restore_rt sigaction.c:0:0
 #4 0x0000000001d00273 llvm::AAResults::alias(llvm::MemoryLocation const&, llvm::MemoryLocation const&, llvm::AAQueryInfo&, llvm::Instruction const*) (../../main-github/llvm/build-all/bin/opt+0x1d00273)
 #5 0x0000000001d0c3a9 llvm::AliasSet::aliasesPointer(llvm::Value const*, llvm::LocationSize, llvm::AAMDNodes const&, llvm::BatchAAResults&) const (../../main-github/llvm/build-all/bin/opt+0x1d0c3a9)
 #6 0x0000000001d0cfe9 llvm::AliasSetTracker::getAliasSetFor(llvm::MemoryLocation const&) (../../main-github/llvm/build-all/bin/opt+0x1d0cfe9)
 #7 0x0000000001d0d2ea llvm::AliasSetTracker::add(llvm::Value*, llvm::LocationSize, llvm::AAMDNodes const&) (../../main-github/llvm/build-all/bin/opt+0x1d0d2ea)
 #8 0x0000000001e875ee void llvm::function_ref<void (llvm::Value*)>::callback_fn<llvm::LoopAccessInfo::analyzeLoop(llvm::AAResults*, llvm::LoopInfo*, llvm::TargetLibraryInfo const*, llvm::DominatorTree*)::$_4>(long, llvm::Value*) LoopAccessAnalysis.cpp:0:0
 #9 0x0000000001e7814c visitPointers(llvm::Value*, llvm::Loop const&, llvm::function_ref<void (llvm::Value*)>) LoopAccessAnalysis.cpp:0:0
#10 0x0000000001e7d50c llvm::LoopAccessInfo::analyzeLoop(llvm::AAResults*, llvm::LoopInfo*, llvm::TargetLibraryInfo const*, llvm::DominatorTree*) (../../main-github/llvm/build-all/bin/opt+0x1e7d50c)
#11 0x0000000001e8001f llvm::LoopAccessInfoManager::getInfo(llvm::Loop&) (../../main-github/llvm/build-all/bin/opt+0x1e8001f)
#12 0x00000000039c3bc2 llvm::LoopLoadEliminationPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x39c3bc2)
#13 0x000000000326585d llvm::detail::PassModel<llvm::Function, llvm::LoopLoadEliminationPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) crtstuff.c:0:0
#14 0x00000000027bc435 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x27bc435)
#15 0x0000000000b3386d 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>&) crtstuff.c:0:0
#16 0x00000000027c0982 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x27c0982)
#17 0x0000000000b3364d llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) crtstuff.c:0:0
#18 0x00000000027bb635 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x27bb635)
#19 0x0000000000734c53 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, 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+0x734c53)
#20 0x0000000000743252 main (../../main-github/llvm/build-all/bin/opt+0x743252)
#21 0x00007f09d5fa1555 __libc_start_main (/lib64/libc.so.6+0x22555)
#22 0x000000000072deb0 _start (../../main-github/llvm/build-all/bin/opt+0x72deb0)
Segmentation fault (core dumped)
```
[bbi-80060.ll.gz](https://github.com/llvm/llvm-project/files/10941907/bbi-80060.ll.gz)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWVFz4jjW_TXiRQUlJBvsBx5oEurr-jq72aRrXilZugZty5JXktOT_vVbsoHYBHqSJlM7u12dQCzp6pxzz5WE4N6rrQFYoPQTSm9GvAk76xaV-sZB76yuwIwKK58XWj9VWNiqUgGxJc4hY3LKRF7O54DIDSLLB6idlY0A_F2FHWLL7jGakf3_9k9bBzyuuffgEbtBlJaNEUFZg2jm4F-NcoDYigsB3o-VKS1it4iuXpr8zjZajo0NY9eY8WH4MeYtojmiKy_E2P4YV1Y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