<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58805>58805</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
convert-async-to-llvm pass crashed with error Message: 'func.func' isn't regisitered
</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/52516782972730ff065a34123a9d8876da08c254
Reproduced with:
I accidentally invoke `mlir-opt --convert-async-to-llvm temp.mlir ` on an empty mlir file `temp.mlir`. Then it crashed with the following trace:
```console
LLVM ERROR: Building op `func.func` but it isn't registered in this MLIRContext: the dialect may not be loaded or this operation isn't registered by the dialect. See also https://mlir.llvm.org/getting_started/Faq/#registered-loaded-dependent-whats-up-with-dialects-management
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 --convert-async-to-llvm 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 0x0000000104cdfa20 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 72
1 mlir-opt 0x0000000104cdff3c PrintStackTraceSignalHandler(void*) + 28
2 mlir-opt 0x0000000104cde04c llvm::sys::RunSignalHandlers() + 148
3 mlir-opt 0x0000000104ce180c SignalHandler(int) + 252
4 libsystem_platform.dylib 0x00000001a33254c4 _sigtramp + 56
5 libsystem_pthread.dylib 0x00000001a330dee0 pthread_kill + 288
6 libsystem_c.dylib 0x00000001a3248340 abort + 168
7 mlir-opt 0x0000000104b62088 llvm::report_fatal_error(llvm::Twine const&, bool) + 356
8 mlir-opt 0x000000010789a894 mlir::RegisteredOperationName mlir::OpBuilder::getCheckRegisteredInfo<mlir::func::FuncOp>(mlir::MLIRContext*) + 196
9 mlir-opt 0x00000001075c6a38 mlir::func::FuncOp mlir::OpBuilder::create<mlir::func::FuncOp, llvm::StringRef&, mlir::FunctionType&>(mlir::Location, llvm::StringRef&, mlir::FunctionType&) + 88
10 mlir-opt 0x00000001075c69a0 mlir::func::FuncOp mlir::ImplicitLocOpBuilder::create<mlir::func::FuncOp, llvm::StringRef&, mlir::FunctionType&>(llvm::StringRef&, mlir::FunctionType&) + 80
11 mlir-opt 0x00000001075c54c4 addAsyncRuntimeApiDeclarations(mlir::ModuleOp)::$_6::operator()(llvm::StringRef, mlir::FunctionType) const + 92
12 mlir-opt 0x00000001075c452c addAsyncRuntimeApiDeclarations(mlir::ModuleOp) + 168
13 mlir-opt 0x00000001075bd6c8 (anonymous namespace)::ConvertAsyncToLLVMPass::runOnOperation() + 100
14 mlir-opt 0x00000001087cb184 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 512
15 mlir-opt 0x00000001087cb854 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 364
16 mlir-opt 0x00000001087cda98 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) + 108
17 mlir-opt 0x00000001087cd870 mlir::PassManager::run(mlir::Operation*) + 864
18 mlir-opt 0x00000001087b2c84 performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 560
19 mlir-opt 0x00000001087b2818 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
20 mlir-opt 0x00000001087b25e0 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
21 mlir-opt 0x00000001087b24f4 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
22 mlir-opt 0x00000001089af1e8 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
23 mlir-opt 0x00000001089aeccc 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
24 mlir-opt 0x00000001087aff4c 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
25 mlir-opt 0x00000001087b0154 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
26 mlir-opt 0x00000001087b0d00 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 2888
27 mlir-opt 0x000000010451fe58 main + 148
28 dyld 0x000000012198d088 start + 516
zsh: abort mlir-opt --convert-async-to-llvm temp.mlir
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWVtv2zgW_jX2C2FDoq5-8IPjppgA8SZIggFmXwyKpGxtaVFDUul4fv0eUpItuUmqdre76WCMIJZF8ly-cyWZSXZcbm5vHlBWF8IgYhCVh0Nh0N6YSk-C1QR_hL9dYfZ1Nocx-CHEc_c1q5T8F6cGfjbr4CHCkR8nKV4kOAm8PPfiiAShjwOyYGmaxIx4KcVROPE-TLxV8_-BAyFWU87QZ2AFfFEzcIMIpQXjpSFCHFFRPstPHE1i7yAKNZOVQbMZleUzV2ZG9LGkMyNnVjJk-KGa21l2NpIlIiWCV-aI3Mu8EI7OaRo8z9HTnpcItKeK6H0rDDJ7jnIphPxclDtkFKHcAtOIH3vNHwihpeDN29vbXzfo-uHh7sFqcgXQMrtUVpZjXpd0bv9ZubLaWH6FLic4MUjxXaENV8C6KIFxoZG1zlqWhv9hLDErDCuIANDRgRxRKQ3KOBKSMFgkVbNIVlwRU4DWL1DOjn0qc_TIOSJCywubW1DmFsq5VDvrA9wY0GKrDVGGM3jzkfzupgZn4rNGkBnjFS-t2Waf98ToWV3NLJazlqmeHUhJdvwAMxrI7m-vV4_XSNeZ9T4CwOxA5koqg8ylZCO8sdC65hoewOwWSypqxp3azrQoI_STs-S8Yf9o4AVi9aE6mRbcwX3uldwpckB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