<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59445>59445</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] BufferDeallocation crashed with assertion failure "Invalid entry region without an attached successor region"
</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/0ee6bad6a6725c2913116a8fa7769b067c219f0
Reproduced with:
`mlir-opt --buffer-deallocation temp.mlir`
temp.mlir:
```mlir
#map = affine_map<(d0) -> (d0)>
#map1 = affine_map<(d0) -> (d0 + 1)>
module {
func.func @func1() {
affine.for %arg2 = 0 to 72 {
affine.for %arg3 = #map(%arg2) to #map1(%arg2) {
}
}
return
}
}
```
trace:
```console
Assertion failed: (entrySuccessor.getSuccessor() && "Invalid entry region without an attached successor region"), function operator(), file BufferViewFlowAnalysis.cpp, line 91.
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 --buffer-deallocation 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 0x00000001050aa568 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 72
1 mlir-opt 0x00000001050aaa84 PrintStackTraceSignalHandler(void*) + 28
2 mlir-opt 0x00000001050a8b34 llvm::sys::RunSignalHandlers() + 148
3 mlir-opt 0x00000001050ac6f0 SignalHandler(int) + 252
4 libsystem_platform.dylib 0x000000019970d4c4 _sigtramp + 56
5 libsystem_pthread.dylib 0x00000001996f5ee0 pthread_kill + 288
6 libsystem_c.dylib 0x0000000199630340 abort + 168
7 libsystem_c.dylib 0x000000019962f754 err + 0
8 mlir-opt 0x000000010576b0e8 mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2::operator()(mlir::RegionBranchOpInterface) const + 240
9 mlir-opt 0x000000010576afe8 std::__1::enable_if<!llvm::is_one_of<mlir::RegionBranchOpInterface, mlir::Operation*, mlir::Region*, mlir::Block*>::value && std::is_same<void, void>::value, void>::type mlir::detail::walk<(mlir::WalkOrder)1, mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2, mlir::RegionBranchOpInterface, void>(mlir::Operation*, mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2&&)::'lambda'(mlir::Operation*)::operator()(mlir::Operation*) const + 92
10 mlir-opt 0x000000010576af80 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<std::__1::enable_if<!llvm::is_one_of<mlir::RegionBranchOpInterface, mlir::Operation*, mlir::Region*, mlir::Block*>::value && std::is_same<void, void>::value, void>::type mlir::detail::walk<(mlir::WalkOrder)1, mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2, mlir::RegionBranchOpInterface, void>(mlir::Operation*, mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2&&)::'lambda'(mlir::Operation*)>(long, mlir::Operation*) + 52
11 mlir-opt 0x0000000108f9fbf8 llvm::function_ref<void (mlir::Operation*)>::operator()(mlir::Operation*) const + 68
12 mlir-opt 0x00000001092e66d8 mlir::detail::walk(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) + 404
13 mlir-opt 0x00000001092e6688 mlir::detail::walk(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) + 324
14 mlir-opt 0x00000001092e6688 mlir::detail::walk(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) + 324
15 mlir-opt 0x000000010576aeb4 std::__1::enable_if<!llvm::is_one_of<mlir::RegionBranchOpInterface, mlir::Operation*, mlir::Region*, mlir::Block*>::value && std::is_same<void, void>::value, void>::type mlir::detail::walk<(mlir::WalkOrder)1, mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2, mlir::RegionBranchOpInterface, void>(mlir::Operation*, mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2&&) + 76
16 mlir-opt 0x00000001057683fc std::__1::enable_if<llvm::function_traits<std::__1::decay<mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2>::type>::num_args == 1, void>::type mlir::Operation::walk<(mlir::WalkOrder)1, mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2, void>(mlir::BufferViewFlowAnalysis::build(mlir::Operation*)::$_2&&) + 48
17 mlir-opt 0x0000000105767c70 mlir::BufferViewFlowAnalysis::build(mlir::Operation*) + 92
18 mlir-opt 0x0000000105767bd0 mlir::BufferViewFlowAnalysis::BufferViewFlowAnalysis(mlir::Operation*) + 48
19 mlir-opt 0x0000000105767cb4 mlir::BufferViewFlowAnalysis::BufferViewFlowAnalysis(mlir::Operation*) + 36
20 mlir-opt 0x0000000105763234 mlir::bufferization::BufferPlacementTransformationBase::BufferPlacementTransformationBase(mlir::Operation*) + 36
21 mlir-opt 0x000000010572b5d0 (anonymous namespace)::BufferDeallocation::BufferDeallocation(mlir::Operation*) + 36
22 mlir-opt 0x0000000105726de0 (anonymous namespace)::BufferDeallocation::BufferDeallocation(mlir::Operation*) + 36
23 mlir-opt 0x0000000105726bc8 mlir::bufferization::deallocateBuffers(mlir::Operation*) + 312
24 mlir-opt 0x000000010573bd4c (anonymous namespace)::BufferDeallocationPass::runOnOperation() + 68
25 mlir-opt 0x0000000108e10c58 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 512
26 mlir-opt 0x0000000108e11328 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 364
27 mlir-opt 0x0000000108e24690 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const + 240
28 mlir-opt 0x0000000108e24358 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&) + 180
29 mlir-opt 0x0000000108e12c98 mlir::LogicalResult mlir::failableParallelForEach<std::__1::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::__1::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>&, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext*, std::__1::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::__1::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>&, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) + 84
30 mlir-opt 0x0000000108e12040 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) + 984
31 mlir-opt 0x0000000108e10f44 mlir::detail::OpToOpPassAdaptor::runOnOperation(bool) + 68
32 mlir-opt 0x0000000108e10c40 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 488
33 mlir-opt 0x0000000108e11328 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 364
34 mlir-opt 0x0000000108e1356c mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) + 108
35 mlir-opt 0x0000000108e13344 mlir::PassManager::run(mlir::Operation*) + 864
36 mlir-opt 0x0000000108df861c performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 560
37 mlir-opt 0x0000000108df81b0 processBuffer(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, bool, bool, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool*) + 496
38 mlir-opt 0x0000000108df7f78 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::operator()(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const + 204
39 mlir-opt 0x0000000108df7e8c 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&) + 80
40 mlir-opt 0x0000000109003440 llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::operator()(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const + 96
41 mlir-opt 0x0000000109002f24 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) + 128
42 mlir-opt 0x0000000108df58cc 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) + 320
43 mlir-opt 0x0000000108df5ad4 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::PassPipelineCLParser const&, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool, bool) + 296
44 mlir-opt 0x0000000108df6698 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 2912
45 mlir-opt 0x00000001048c0f50 main + 148
46 dyld 0x0000000122bf5088 start + 516
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsG1tvqzj619AX60TG3B_6kN40lVo1ao9mtfsSGfhIvDU2a5t2Mr9-hYGE3FrOmWamM2pVJcHY3_3zdwFTrdlCAJw7wYUTXJ3R2iylOr-UnMtKKlNrfJbKfHV-f3f7iNKacYOoQZksS2bQ0phKO97UITcOuVkws6zTSSZLh9xw_tJ_fauU_C9kxiE37TqH3GCAMKV5SMOIBBlJXM91QxoXNIrCJMVh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