Skip to content

[MLIR] Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed. #116367

@xisang0

Description

@xisang0

Test on commit: 6548b63
steps to reproduce:

mlir-opt test.mlir --tosa-optional-decompositions

test case:

module {
  func.func @main(%arg3: tensor<1xf32>, %arg4: tensor<?x?xf32>) -> () {
    %213 = tosa.table %arg4, %arg3 : (tensor<?x?xf32>, tensor<1xf32>) -> tensor<*xf32>
    return
  }
}

crash trace:

mlir-opt: /home/llvm-project/llvm/include/llvm/Support/Casting.h:566: decltype(auto) llvm::cast(const From &) [To = mlir::RankedTensorType, From = mlir::TensorType]: 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: build/bin/mlir-opt test.mlir
 #0 0x0000000001119717 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build/bin/mlir-opt+0x1119717)
 #1 0x000000000111726e llvm::sys::RunSignalHandlers() (build/bin/mlir-opt+0x111726e)
 #2 0x000000000111a0ea SignalHandler(int) Signals.cpp:0:0
 #3 0x000077e73a09a520 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000077e73a0ee9fc pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x000077e73a09a476 gsignal (/usr/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x000077e73a0807f3 abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x000077e73a08071b (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x000077e73a091e96 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00000000045cf204 (build/bin/mlir-opt+0x45cf204)
#10 0x000000000363303f mlir::tosa::TableOp::verify() (build/bin/mlir-opt+0x363303f)
#11 0x00000000036fd963 mlir::Op<mlir::tosa::TableOp, mlir::OpTrait::ZeroRegions, mlir::OpTrait::OneResult, mlir::OpTrait::OneTypedResult<mlir::TensorType>::Impl, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::NOperands<2u>::Impl, mlir::OpTrait::OpInvariants, mlir::InferShapedTypeOpInterface::Trait, mlir::OpTrait::InferShapedTypeOpAdaptor, mlir::ConditionallySpeculatable::Trait, mlir::OpTrait::AlwaysSpeculatableImplTrait, mlir::MemoryEffectOpInterface::Trait, mlir::tosa::TosaOp::Trait>::verifyInvariants(mlir::Operation*) (build/bin/mlir-opt+0x36fd963)
#12 0x00000000036fcd8f mlir::RegisteredOperationName::Model<mlir::tosa::TableOp>::verifyInvariants(mlir::Operation*) (build/bin/mlir-opt+0x36fcd8f)
#13 0x000000000466a37b (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#14 0x000000000466a4d0 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#15 0x000000000466a4d0 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#16 0x0000000004669a83 mlir::verify(mlir::Operation*, bool) (build/bin/mlir-opt+0x4669a83)
#17 0x00000000065f50ac mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) (build/bin/mlir-opt+0x65f50ac)
#18 0x00000000044564cf mlir::parseSourceFile(std::shared_ptr<llvm::SourceMgr> const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) (build/bin/mlir-opt+0x44564cf)
#19 0x0000000004454d8a performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#20 0x0000000004454aa4 llvm::LogicalResult llvm::function_ref<llvm::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&)::$_2>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#21 0x0000000004543018 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (build/bin/mlir-opt+0x4543018)
#22 0x000000000444fe4f mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (build/bin/mlir-opt+0x444fe4f)
#23 0x00000000044500ed mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (build/bin/mlir-opt+0x44500ed)
#24 0x00000000044504c7 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (build/bin/mlir-opt+0x44504c7)
#25 0x00000000010fb097 main (build/bin/mlir-opt+0x10fb097)
#26 0x000077e73a081d90 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#27 0x000077e73a081e40 __libc_start_main (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#28 0x00000000010fac15 _start (build/bin/mlir-opt+0x10fac15)
Aborted (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashPrefer [crash-on-valid] or [crash-on-invalid]mlir:tosa

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions