<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60021>60021</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] Affine-pipeline-data-transfer Pass trigger Assertion Failure "(ubMap.getNumInputs() == ubOperands.size())"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</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/a5ddd920
Reproduced with:
`mlir-opt temp.mlir --affine-pipeline-data-transfer`
temp.mlir:
```
#map = affine_map<() -> (1)>
#map1 = affine_map<(d0) -> (d0 )>
func.func @func(%arg0: index, %arg1: index) {
%c0 = arith.constant 0 : index
%alloc = memref.alloc() : memref<1xf32>
%alloc_0 = memref.alloc() : memref<100x100xf32, 2>
%0 = affine.apply #map()
%1 = affine.apply #map1(%0)
affine.for %arg2 = 0 to %1 {
affine.dma_start %alloc[%arg0, %arg0], %alloc_0[%arg0, %arg0], %alloc[%c0], %c0, %c0, %c0 : memref<1xf32>, memref<100x100xf32, 2>, memref<1xf32>
affine.dma_wait %alloc[%c0], %c0 : memref<1xf32>
}
return
}
```
trace:
```console
Assertion failed: (ubMap.getNumInputs() == ubOperands.size()), function generateShiftedLoop, file LoopUtils.cpp, line 189.
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 temp.mlir --affine-pipeline-data-transfer
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 0x00000001007d05bc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 mlir-opt 0x00000001007cf624 llvm::sys::RunSignalHandlers() + 112
2 mlir-opt 0x00000001007d0c54 SignalHandler(int) + 344
3 libsystem_platform.dylib 0x00000001a56894c4 _sigtramp + 56
4 libsystem_pthread.dylib 0x00000001a5671ee0 pthread_kill + 288
5 libsystem_c.dylib 0x00000001a55ac340 abort + 168
6 libsystem_c.dylib 0x00000001a55ab754 err + 0
7 mlir-opt 0x0000000101d30b98 generateShiftedLoop(mlir::AffineMap, mlir::AffineMap, std::__1::vector<std::__1::pair<unsigned long long, llvm::ArrayRef<mlir::Operation*>>, std::__1::allocator<std::__1::pair<unsigned long long, llvm::ArrayRef<mlir::Operation*>>>> const&, unsigned int, mlir::AffineForOp, mlir::OpBuilder) (.cold.16) + 0
8 mlir-opt 0x0000000100855df8 generateShiftedLoop(mlir::AffineMap, mlir::AffineMap, std::__1::vector<std::__1::pair<unsigned long long, llvm::ArrayRef<mlir::Operation*>>, std::__1::allocator<std::__1::pair<unsigned long long, llvm::ArrayRef<mlir::Operation*>>>> const&, unsigned int, mlir::AffineForOp, mlir::OpBuilder) + 960
9 mlir-opt 0x00000001008556c4 mlir::affineForOpBodySkew(mlir::AffineForOp, llvm::ArrayRef<unsigned long long>, bool) + 1856
10 mlir-opt 0x0000000100842a7c (anonymous namespace)::PipelineDataTransfer::runOnOperation() + 3604
11 mlir-opt 0x00000001019db4dc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 420
12 mlir-opt 0x00000001019dba0c mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
13 mlir-opt 0x00000001019dfa90 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const + 176
14 mlir-opt 0x00000001019df90c mlir::LogicalResult mlir::failableParallelForEach<std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext*, std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) + 360
15 mlir-opt 0x00000001019dc6d4 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) + 1396
16 mlir-opt 0x00000001019db60c mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 724
17 mlir-opt 0x00000001019dba0c mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
18 mlir-opt 0x00000001019dd388 mlir::PassManager::run(mlir::Operation*) + 1148
19 mlir-opt 0x00000001019d6840 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
20 mlir-opt 0x00000001019d6410 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
21 mlir-opt 0x0000000101a4102c 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
22 mlir-opt 0x00000001019d4838 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
23 mlir-opt 0x00000001019d4d2c mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
24 mlir-opt 0x00000001006730a0 main + 108
25 dyld 0x0000000105105088 start + 516
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWltv2zoS_jXKCxGDoi6WHvLgS4ITIN4ESXeB3ReDEimbW4rUklRbn1-_ICnJ8q11u-1BsGjh2jI1M-R8880MaQVrzTaC0rsgmQfJ8ga3ZivV3UJyLhupTKvhTSHJ7m719PgKipZxA7ABpaxrZsDWmEYH0SxADwF62DCzbYtJKesAPXD-qf-4bZT8Ny1NgB68XoAecEIIyREM4DKAs1faKEnakhLwmZltEM2AvxGksOZM3crGAEPrZmK_gdtbXFVM0NuGNZTbC4INvjUKC11RFaSdWf8-6NmF9lb9q58FRTVuQBAtgTe8rnETRIsAZQHKwW0Q3YMAZWGA8iC6H-uEZ5UItGqDHoHAa4JuvqoV5cS-gSCG9tNNlGC1gdZ1Jgj9EqAF8GPhaCwHwXTujQB7u4R-AYqZ7aSUQhssDLCDvYqXtZY4l6WTrmmtaDVxA52LVt4PB9Ei_FJFaHAUDMpreJ06hF_sf2sELQByKOxNwRFkE9w0fAc8lr2tvWh4STT0gMGxfCdWSdXhhpw2BEZ2tqZzMEgP8qTGa22wMoObNhO6YAwxgEGy7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