Issue |
128313
|
Summary |
[MLIR]`-test-bytecode-roundtrip=test-kind=2` triggers Assertion Failure `succeeded( ConcreteT::verifyInvariants(getDefaultDiagnosticEmitFn(ctx), args...))'
|
Labels |
mlir
|
Assignees |
|
Reporter |
xisang0
|
Test on commit: https://github.com/llvm/llvm-project/commit/a9882bda96228ca23e166a817f93a7dbc99763cb
steps to reproduce:
```
mlir-opt test.mlir -test-bytecode-roundtrip=test-kind=2
```
test case:
```
module {
func.func @switch_missing_case_value(%flag : i32, %caseOperand : i32) {
cf.switch %flag : i32, [
default: ^bb1(%caseOperand : i32),
45: ^bb2(%caseOperand : i32),
0: ^bb3(%caseOperand : i32) // Added a case value (0) for bb3
]
^bb1(%bb1arg : i32):
return
^bb2(%bb2arg : i32):
return
^bb3(%bb3arg : i32):
return
}
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/mlir/include/mlir/IR/StorageUniquerSupport.h:180: static ConcreteT mlir::detail::StorageUserBase<mlir::DenseArrayAttr, mlir::Attribute, mlir::detail::DenseArrayAttrStorage, mlir::detail::AttributeUniquer>::get(MLIRContext *, Args &&...) [ConcreteT = mlir::DenseArrayAttr, BaseT = mlir::Attribute, StorageT = mlir::detail::DenseArrayAttrStorage, UniquerT = mlir::detail::AttributeUniquer, Traits = <>, Args = <mlir::Type &, unsigned int &, llvm::ArrayRef<char> &>]: Assertion `succeeded( ConcreteT::verifyInvariants(getDefaultDiagnosticEmitFn(ctx), args...))' failed.
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 /home/workdir/test.mlir -test-bytecode-roundtrip=test-kind=2
#0 0x00005ee0b6545998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x108a998)
#1 0x00005ee0b65434be llvm::sys::RunSignalHandlers() (./mlir-opt+0x10884be)
#2 0x00005ee0b65463a8 SignalHandler(int) Signals.cpp:0:0
#3 0x00007d5ce70b7520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007d5ce710b9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007d5ce70b7476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007d5ce709d7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007d5ce709d71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007d5ce70aee96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00005ee0b98fb5d0 mlir::DenseArrayAttr::getChecked(llvm::function_ref<mlir::InFlightDiagnostic ()>, mlir::Type, unsigned int, llvm::ArrayRef<char>) (./mlir-opt+0x44405d0)
#10 0x00005ee0b98fb4fa mlir::DenseArrayAttr::get(mlir::Type, unsigned int, llvm::ArrayRef<char>) (./mlir-opt+0x44404fa)
#11 0x00005ee0b9939c99 (anonymous namespace)::BuiltinDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const BuiltinDialectBytecode.cpp:0:0
#12 0x00005ee0bb8ed3e4 (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#13 0x00005ee0bb8ec777 (anonymous namespace)::DialectReader::readAttribute(mlir::Attribute&) BytecodeReader.cpp:0:0
#14 0x00005ee0b65ff1f4 llvm::LogicalResult mlir::DialectBytecodeReader::readAttribute<mlir::detail::DenseArrayAttrImpl<int>>(mlir::detail::DenseArrayAttrImpl<int>&) (./mlir-opt+0x11441f4)
#15 0x00005ee0b6b39a94 mlir::cf::SwitchOp::readProperties(mlir::DialectBytecodeReader&, mlir::OperationState&) (./mlir-opt+0x167ea94)
#16 0x00005ee0bb8ea0c8 mlir::BytecodeReader::Impl::parseRegions(std::vector<mlir::BytecodeReader::Impl::RegionReadState, std::allocator<mlir::BytecodeReader::Impl::RegionReadState>>&, mlir::BytecodeReader::Impl::RegionReadState&) (./mlir-opt+0x642f0c8)
#17 0x00005ee0bb8e5adb mlir::BytecodeReader::Impl::parseIRSection(llvm::ArrayRef<unsigned char>, mlir::Block*) (./mlir-opt+0x642aadb)
#18 0x00005ee0bb8e2f3d mlir::BytecodeReader::Impl::read(mlir::Block*, llvm::function_ref<bool (mlir::Operation*)>) (./mlir-opt+0x6427f3d)
#19 0x00005ee0bb8eb8be readBytecodeFileImpl(llvm::MemoryBufferRef, mlir::Block*, mlir::ParserConfig const&, std::shared_ptr<llvm::SourceMgr> const&) BytecodeReader.cpp:0:0
#20 0x00005ee0bb8eb74e mlir::readBytecodeFile(llvm::MemoryBufferRef, mlir::Block*, mlir::ParserConfig const&) (./mlir-opt+0x643074e)
#21 0x00005ee0b98132ef mlir::parseSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) (./mlir-opt+0x43582ef)
#22 0x00005ee0b9813988 mlir::parseSourceString(llvm::StringRef, mlir::Block*, mlir::ParserConfig const&, llvm::StringRef, mlir::LocationAttr*) (./mlir-opt+0x4358988)
#23 0x00005ee0b96e4e74 (anonymous namespace)::TestBytecodeRoundtripPass::doRoundtripWithConfigs(mlir::Operation*, mlir::BytecodeWriterConfig const&, mlir::ParserConfig const&) TestBytecodeRoundtrip.cpp:0:0
#24 0x00005ee0b96e2cb0 (anonymous namespace)::TestBytecodeRoundtripPass::runOnOperation() TestBytecodeRoundtrip.cpp:0:0
#25 0x00005ee0b98163bf mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x435b3bf)
#26 0x00005ee0b9816ba2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x435bba2)
#27 0x00005ee0b981934e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x435e34e)
#28 0x00005ee0b9811e6b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#29 0x00005ee0b9811acb 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
#30 0x00005ee0b98badf5 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) (./mlir-opt+0x43ffdf5)
#31 0x00005ee0b980c9b2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x43519b2)
#32 0x00005ee0b980cc63 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4351c63)
#33 0x00005ee0b980ce72 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4351e72)
#34 0x00005ee0b6524c27 main (./mlir-opt+0x1069c27)
#35 0x00007d5ce709ed90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#36 0x00007d5ce709ee40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#37 0x00005ee0b6524795 _start (./mlir-opt+0x1069795)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs