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

    <tr>
        <th>Summary</th>
        <td>
            [mlir] `mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitOperation` crashes with segmentation fault
        </td>
    </tr>

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

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

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

<pre>
    MLIR built at commit https://github.com/llvm/llvm-project/commit/a0dab4950
Reproduced with: 
`mlir-opt --test-written-to temp.mlir`

temp.mlir:
``` milr 
llvm.func @func1(i64)

llvm.func @func(%lb : i64, %ub : i64, %step : i64) -> () {
  omp.wsloop schedule(dynamic) ordered(0)
  for (%iv) : i64 = (%lb) to (%ub) step (%step) { 
    llvm.call @func1(%iv) : (i64) -> ()
    omp.yield
  }
  llvm.return

```
 
trace:
```console  
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: mlir-opt --test-written-to temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mlir-opt 0x00000001041c46b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt                 0x00000001041c3720 llvm::sys::RunSignalHandlers() + 112
2  mlir-opt 0x00000001041c4d50 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001aad414c4 _sigtramp + 56
4  mlir-opt 0x0000000105837118 mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitOperation(mlir::Operation*) + 1196
5  mlir-opt                 0x0000000105836b70 mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) + 36
6  mlir-opt                 0x0000000105836c04 mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) + 184
7  mlir-opt                 0x0000000105836c04 mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) + 184
8  mlir-opt                 0x0000000105836c04 mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::initializeRecursively(mlir::Operation*) + 184
9  mlir-opt                 0x000000010581fc14 mlir::DataFlowSolver::initializeAndRun(mlir::Operation*) + 352
10 mlir-opt 0x00000001055afc84 (anonymous namespace)::TestWrittenToPass::runOnOperation() + 368
11 mlir-opt 0x0000000105840428 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 428
12 mlir-opt                 0x0000000105840958 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
13 mlir-opt                 0x00000001058422d4 mlir::PassManager::run(mlir::Operation*) + 1148
14 mlir-opt 0x000000010583b698 performActions(llvm::raw_ostream&, bool, bool, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 504
15 mlir-opt                 0x000000010583b268 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 704
16 mlir-opt                 0x00000001058a5f5c mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) + 656
17 mlir-opt 0x0000000105839690 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) + 216
18 mlir-opt                 0x0000000105839b84 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
19 mlir-opt 0x0000000104066ae4 main + 108
20 dyld 0x0000000109019088 start + 516

```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWFtv47oR_jX0yyABRV0sPfjBueEskCCBE7RoXwxKpG12KVIlqeS4v74gJdmyHXd9DgJ0t6gRRDY5nPnmytFQa8VacT5D6Q1K7ya0dRttZrdaSt1o41qLJ6Vm29nT47cFlK2QDqiDSte1cLBxrrEoniPygMjDWrhNW15XukbkQcr34XHVGP0PXjlEHrpziDxQzGiZFClG-A7h-YI3RrO24gw-hNugeA7dBspwLYW50o2DqyvHrbv6MMI5rq6cBsfr5trvo6xn1P3fr8fzHZ_uD2ohTc_cg7tetaoClGD_jBDJRZYgUoy5nZAhkiOSyhI8zkB_C4ik7fGCdbzZLxVwheJ7CIcLQNObjjuArpvrDyu1bsBWG85ayRHJ2VbRWlSeVhvGDWeI5HgHDWClTccsFe-BYycIUHwHA0K_7nT_sw0_O1BhwX_tscDAFSCoW1Epx1Y5kLKz0lijPQOvz1ZwyYYlNL0bvgbmhrvWqN7E0zs4clFP27vS0IqfurHSymrJoad6ebyfv96DbUsflhTKdg2G-wD26v_hMBXWttwi8gBUMRCqki3j4DYcKkPtBkpafQ_Arjvxr45W34G1d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