| Issue |
60922
|
| Summary |
[MLIR]LLVM ERROR with "can't create type 'mlir::async::TokenType'" when using `-convert-async-to-llvm`
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
sweead
|
I think there is no corresponding dialect in IR and this pass should not be effective. But it still triggers an error, is this a bug?
IR:
```func.func @multiple_conversion_casts(%arg0: i32, %arg1: i32) -> (i32, i32) {
%inputs:2 = builtin.unrealized_conversion_cast %arg0, %arg1 : i32, i32 to i64, i64
%outputs:2 = builtin.unrealized_conversion_cast %inputs#0, %inputs#1 : i64, i64 to i32, i32
return %outputs#0, %outputs#1 : i32, i32
}
```
Error message:
```
/home/compiler/tests/base# /home/llvm15/mlir/build/bin/mlir-opt ./canonicalize.mlir -convert-async-to-llvm
LLVM ERROR: can't create type 'mlir::async::TokenType' because storage uniquer isn't initialized: the dialect was likely not loaded, or the type wasn't added with addTypes<...>() in the Dialect::initialize() method.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/llvm15/mlir/build/bin/mlir-opt ./test.mlir -convert-async-to-llvm
#0 0x000000000048501a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/llvm15/llvm/lib/Support/Unix/Signals.inc:569:11
#1 0x00000000004851cb PrintStackTraceSignalHandler(void*) /home/llvm15/llvm/lib/Support/Unix/Signals.inc:636:1
#2 0x0000000000483846 llvm::sys::RunSignalHandlers() /home/llvm15/llvm/lib/Support/Signals.cpp:103:5
#3 0x00000000004858f5 SignalHandler(int) /home/llvm15/llvm/lib/Support/Unix/Signals.inc:407:1
#4 0x00007f2c08a70980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#5 0x00007f2c07960e87 raise /build/glibc-CVJwZb/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#6 0x00007f2c079627f1 abort /build/glibc-CVJwZb/glibc-2.27/stdlib/abort.c:81:0
#7 0x00000000004c4894 llvm::report_fatal_error(llvm::Twine const&, bool) /home/llvm15/llvm/lib/Support/ErrorHandling.cpp:125:5
#8 0x000000000092e47d std::enable_if<std::is_same<mlir::async::TokenType::ImplType, mlir::TypeStorage>::value, mlir::async::TokenType>::type mlir::detail::TypeUniquer::getWithTypeID<mlir::async::TokenType>(mlir::MLIRContext*, mlir::TypeID) /home/llvm15/mlir/include/mlir/IR/TypeSupport.h:210:12
#9 0x000000000092e3aa mlir::async::TokenType mlir::detail::TypeUniquer::get<mlir::async::TokenType>(mlir::MLIRContext*) /home/llvm15/mlir/include/mlir/IR/TypeSupport.h:170:12
#10 0x00000000008fe6c1 mlir::async::TokenType mlir::detail::StorageUserBase<mlir::async::TokenType, mlir::Type, mlir::TypeStorage, mlir::detail::TypeUniquer>::get<>(mlir::MLIRContext*) /home/llvm15/mlir/include/mlir/IR/StorageUniquerSupport.h:154:12
#11 0x00000000024dc12c (anonymous namespace)::AsyncAPI::createTokenFunctionType(mlir::MLIRContext*) /home/llvm15/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp:88:40
#12 0x00000000024db0b8 addAsyncRuntimeApiDeclarations(mlir::ModuleOp) /home/llvm15/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp:213:29
#13 0x00000000024dac59 (anonymous namespace)::ConvertAsyncToLLVMPass::runOnOperation() /home/llvm15/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp:1000:29
#14 0x00000000029c9c4a mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /home/llvm15/mlir/lib/Pass/Pass.cpp:471:21
#15 0x00000000029ca244 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /home/llvm15/mlir/lib/Pass/Pass.cpp:534:16
#16 0x00000000029cbb0c mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /home/llvm15/mlir/lib/Pass/Pass.cpp:837:10
#17 0x00000000029cba2c mlir::PassManager::run(mlir::Operation*) /home/llvm15/mlir/lib/Pass/Pass.cpp:817:60
#18 0x00000000029c306c performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>) /home/llvm15/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:84:17
#19 0x00000000029c2d93 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool*) /home/llvm15/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:124:12
#20 0x00000000029c2b9f mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool)::$_0::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const /home/llvm15/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:164:12
#21 0x00000000029c2abd mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) /home/llvm15/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#22 0x0000000002aef459 llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const /home/llvm15/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
#23 0x0000000002aeea35 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) /home/llvm15/mlir/lib/Support/ToolUtilities.cpp:28:12
#24 0x00000000029c1e29 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool) /home/llvm15/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:169:10
#25 0x00000000029c1f6a mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::PassPipelineCLParser const&, mlir::DialectRegistry&, bool, bool, bool, bool, bool) /home/llvm15/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:187:10
#26 0x00000000029c28d6 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) /home/llvm15/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:269:14
#27 0x0000000000417bbe main /home/llvm15/mlir/tools/mlir-opt/mlir-opt.cpp:239:7
#28 0x00007f2c07943c87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0
#29 0x0000000000417a5a _start (/home/llvm15/mlir/build/bin/mlir-opt+0x417a5a)
Aborted (core dumped)
```
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs