Issue |
132850
|
Summary |
[mlir] Assertion `mightHaveTerminator()' failed
|
Labels |
mlir
|
Assignees |
|
Reporter |
wwy6191
|
git version: 59fd2878fce470f02058f43d4b818ed68ce04094
system: `Ubuntu 18.04.6 LTS`
reproduce with: `mlir-opt a.mlir`
a.mlir:
```
module {
spirv.func @foo(%arg0: i1, %arg2: i2) "None" {
spirv.mlir.selection {
spirv.BranchConditional %arg0, ^bb1, ^bb2
^bb2: // pred: ^bb0
spirv.mlir.merge
^bb1: // pred: ^bb0
spirv.mlir.selection {
spirv.BranchConditional %arg0, ^bb1, ^bb2
^bb2: // pred: ^bb0
spirv.mlir.merge
^bb1: // pred: ^bb0
spirv.mlir.merge
}
}
spirv.Return
}
}
```
stack trace:
```
mlir-opt: /data/szy/MLIR/llvm-project/mlir/lib/IR/Block.cpp:247: Operation *mlir::Block::getTerminator(): Assertion `mightHaveTerminator()' 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/szy/MLIR/llvm-project/install/bin/mlir-opt /data/szy/MLIR/seed/seed3/tmp.5QgpTOEve6.mlir
#0 0x000055e27657fdb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x11bddb8)
#1 0x000055e27657d8be llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x11bb8be)
#2 0x000055e276580736 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f00d5539420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f00d4b7600b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f00d4b55859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f00d4b55729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f00d4b55729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f00d4b66fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x000055e27966a56f mlir::Block::getTerminator() (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x42a856f)
#10 0x000055e278a6ed6e mlir::spirv::MergeOp::verify() (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x36acd6e)
#11 0x000055e27889391a mlir::Op<mlir::spirv::MergeOp, mlir::OpTrait::ZeroRegions, mlir::OpTrait::ZeroResults, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::ZeroOperands, mlir::OpTrait::OpInvariants, mlir::ConditionallySpeculatable::Trait, mlir::OpTrait::AlwaysSpeculatableImplTrait, mlir::MemoryEffectOpInterface::Trait, mlir::OpTrait::IsTerminator, mlir::detail::Interface<mlir::spirv::QueryMinVersionInterface, mlir::Operation*, mlir::spirv::detail::QueryMinVersionInterfaceTraits, mlir::Op<mlir::spirv::QueryMinVersionInterface>, mlir::OpTrait::TraitBase>::Trait, mlir::detail::Interface<mlir::spirv::QueryMaxVersionInterface, mlir::Operation*, mlir::spirv::detail::QueryMaxVersionInterfaceTraits, mlir::Op<mlir::spirv::QueryMaxVersionInterface>, mlir::OpTrait::TraitBase>::Trait, mlir::detail::Interface<mlir::spirv::QueryExtensionInterface, mlir::Operation*, mlir::spirv::detail::QueryExtensionInterfaceTraits, mlir::Op<mlir::spirv::QueryExtensionInterface>, mlir::OpTrait::TraitBase>::Trait, mlir::detail::Interface<mlir::spirv::QueryCapabilityInterface, mlir::Operation*, mlir::spirv::detail::QueryCapabilityInterfaceTraits, mlir::Op<mlir::spirv::QueryCapabilityInterface>, mlir::OpTrait::TraitBase>::Trait>::verifyInvariants(mlir::Operation*) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x34d191a)
#12 0x000055e2788920ee mlir::RegisteredOperationName::Model<mlir::spirv::MergeOp>::verifyInvariants(mlir::Operation*) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x34d00ee)
#13 0x000055e27974b34c (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#14 0x000055e27974b4a0 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#15 0x000055e27974b4a0 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#16 0x000055e27974a906 mlir::verify(mlir::Operation*, bool) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x4388906)
#17 0x000055e27c6e76f5 mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x73256f5)
#18 0x000055e279586f0f mlir::parseSourceFile(std::shared_ptr<llvm::SourceMgr> const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41c4f0f)
#19 0x000055e279585e8e mlir::parseSourceFileForTool(std::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41c3e8e)
#20 0x000055e27958567f performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#21 0x000055e2795853ed 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&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#22 0x000055e279630275 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) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x426e275)
#23 0x000055e27957f405 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41bd405)
#24 0x000055e27957f6af mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41bd6af)
#25 0x000055e27957f9de mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41bd9de)
#26 0x000055e27655e337 main (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x119c337)
#27 0x00007f00d4b57083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#28 0x000055e27655de9e _start (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x119be9e)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs