<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64070>64070</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] test-written-to Pass crashed with assertion failure "Can't derive arg mapping for yield-like op."
</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 585cbe3f
Reproduced with:
` mlir-opt --test-written-to temp.mlir`
temp.mlir:
```
milr module {
func.func @func1(%arg0: vector<23x23xi1>, %arg1: f32, %arg2: f32) -> memref<23x23xf16> {
%c2 = arith.constant 2 : index
%c3 = arith.constant 3 : index
%c12 = arith.constant 12 : index
%c14 = arith.constant 14 : index
%c17 = arith.constant 17 : index
%c28 = arith.constant 28 : index
%6 = tensor.empty() : tensor<14xi64>
%30 = index.maxs %c12, %c28
%55 = scf.parallel (%arg3, %arg4) = (%c14, %c3) to (%30, %c2) step (%c28, %c17) init (%6) -> tensor<14xi64> {
%131 = tensor.empty() : tensor<14xi64>
scf.reduce(%131) : tensor<14xi64> {
^bb0(%arg5: tensor<14xi64>, %arg6: tensor<14xi64>):
%139 = tensor.empty() : tensor<14xi64>
scf.reduce.return %139 : tensor<14xi64>
}
scf.yield
}
%alloc_35 = memref.alloc() : memref<23x23xf16>
return %alloc_35 : memref<23x23xf16>
}
}
```
trace:
```console
Assertion failed: (results.size() == operands.size() && "Can't derive arg mapping for yield-like op."), function visitOperation, file SparseAnalysis.cpp, line 474.
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
#0 0x0000000102d3cf18 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspace/build/bin/mlir-opt+0x1002f8f18)
#1 0x0000000102d3b1b4 llvm::sys::RunSignalHandlers() (/workspace/build/bin/mlir-opt+0x1002f71b4)
#2 0x0000000102d3d5c4 SignalHandler(int) (/workspace/build/bin/mlir-opt+0x1002f95c4)
#3 0x00000001be7894c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
#4 0x00000001be771ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
#5 0x00000001be6ac340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
#6 0x00000001be6ab754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
#7 0x00000001072f4f74 mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitOperation(mlir::Operation*) (.cold.5) (/workspace/build/bin/mlir-opt+0x1048b0f74)
#8 0x000000010537d7d8 mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visitOperation(mlir::Operation*) (/workspace/build/bin/mlir-opt+0x1029397d8)
#9 0x000000010537d8ac mlir::dataflow::AbstractSparseBackwardDataFlowAnalysis::visit(mlir::ProgramPoint) (/workspace/build/bin/mlir-opt+0x1029398ac)
#10 0x0000000105351928 mlir::DataFlowSolver::initializeAndRun(mlir::Operation*) (/workspace/build/bin/mlir-opt+0x10290d928)
#11 0x0000000104e908c0 (anonymous namespace)::TestWrittenToPass::runOnOperation() (/workspace/build/bin/mlir-opt+0x10244c8c0)
#12 0x000000010538c2a8 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/build/bin/mlir-opt+0x1029482a8)
#13 0x000000010538c998 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/build/bin/mlir-opt+0x102948998)
#14 0x000000010538e82c mlir::PassManager::run(mlir::Operation*) (/workspace/build/bin/mlir-opt+0x10294a82c)
#15 0x0000000105386d14 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x102942d14)
#16 0x0000000105386368 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>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_1>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) (/workspace/build/bin/mlir-opt+0x102942368)
#17 0x000000010540434c 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) (/workspace/build/bin/mlir-opt+0x1029c034c)
#18 0x0000000105380d1c mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x10293cd1c)
#19 0x000000010538118c mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/workspace/build/bin/mlir-opt+0x10293d18c)
#20 0x0000000102a47510 main (/workspace/build/bin/mlir-opt+0x100003510)
#21 0x000000010e4a9088
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWV9v4yoW_zTuC2qEAcf2Qx8y6VQ70lRTtSPtY4XhOGEHgxfwtL2ffoXtJHaa3JnJjvaublXFMRzO-Z2_HAj3Xm0MwE2SfUiy2yveha11N2urtW2tC53HV5WVbzf3nz89oqpTOiAekLBNowJCWZGJCmid4N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