Issue 92064
Summary Crash when using --pass-pipeline="builtin.module(func.func(tosa-to-linalg))"
Labels new issue
Assignees
Reporter wangyongj1a
    I have the following MLIR program:
test.mlir:
```
module {
  func.func nested @func1() {
    %33 = tensor.empty() : tensor<1x1x1xi1>
    %output_real, %output_imag = "tosa.rfft2d"(%33) : (tensor<1x1x1xi1>) -> (tensor<1x1x1xi1>, tensor<1x1x1xi1>)
    return
  }
}
```
The above MLIR program will cause a crash when using the following command:
```
mlir-opt --pass-pipeline="builtin.module(func.func(tosa-to-linalg))" test.mlir
```
And the crash backtrace is:
```
mlir-opt: /data/tmp/v0514/llvm-project/llvm/include/llvm/Support/Casting.h:566: decltype(auto) llvm::cast(const From&) [with To = mlir::FloatType; From = mlir::Type]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /data/tmp/v0514/llvm-project/build/bin/mlir-opt --pass-pipeline=builtin.module(func.func(tosa-to-linalg)) test.mlir
 #0 0x0000556fdf39c6ef llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x15946ef)
 #1 0x0000556fdf399744 SignalHandler(int) Signals.cpp:0:0
 #2 0x00007fa27c8c7420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #3 0x00007fa27c39400b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #4 0x00007fa27c373859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #5 0x00007fa27c373729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #6 0x00007fa27c384fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #7 0x0000556fe1bf7a2e (anonymous namespace)::RFFT2dConverter::matchAndRewrite(mlir::tosa::RFFT2dOp, mlir::PatternRewriter&) const TosaToLinalg.cpp:0:0
 #8 0x0000556fe1bc552f mlir::detail::OpOrInterfaceRewritePatternBase<mlir::tosa::RFFT2dOp>::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x3dbd52f)
 #9 0x0000556fe52d41a8 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x74cc1a8)
#10 0x0000556fe23ab396 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) DialectConversion.cpp:0:0
#11 0x0000556fe23acb9e mlir::OperationConverter::convert(mlir::ConversionPatternRewriter&, mlir::Operation*) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x45a4b9e)
#12 0x0000556fe23b289b mlir::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x45aa89b)
#13 0x0000556fe23b2eed mlir::applyFullConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x45aaeed)
#14 0x0000556fe1bba34d (anonymous namespace)::TosaToLinalg::runOnOperation() TosaToLinalgPass.cpp:0:0
#15 0x0000556fe230d881 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x4505881)
#16 0x0000556fe230dd6a mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x4505d6a)
#17 0x0000556fe230e6fc mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::'lambda'(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&)::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const Pass.cpp:0:0
#18 0x0000556fe230cdd5 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x4504dd5)
#19 0x0000556fe230d606 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x4505606)
#20 0x0000556fe230dd6a mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x4505d6a)
#21 0x0000556fe230e524 mlir::PassManager::run(mlir::Operation*) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x4506524)
#22 0x0000556fe22ff9ab performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#23 0x0000556fe2300364 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#24 0x0000556fe2300514 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>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#25 0x0000556fe2405d6e 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&, llvm::StringRef, llvm::StringRef) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x45fdd6e)
#26 0x0000556fe22f8114 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x44f0114)
#27 0x0000556fe230066c mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x44f866c)
#28 0x0000556fe2300b36 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x44f8b36)
#29 0x0000556fdf2bc3fb main (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x14b43fb)
#30 0x00007fa27c375083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#31 0x0000556fdf36b73e _start (/data/tmp/v0514/llvm-project/build/bin/mlir-opt+0x156373e)
Aborted (core dumped)
```
My git version is 4c79d38f82e1f6fe8575d88d8c74f2f1806b19ce.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to