Issue |
128317
|
Summary |
[MLIR]`-test-bytecode-roundtrip=test-kind=2` triggers Assertion Failure `isIntOrFloat() && "only integers and floats have a bitwidth"'
|
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 @reverse_splat() -> tensor<10xi32> {
%0 = "tosa.const"() <{value = dense<42> : tensor<10xi32>}> : () -> tensor<10xi32>
%1 = tosa.reverse %0 {axis = 0 : i32} : (tensor<10xi32>) -> tensor<10xi32>
return %1 : tensor<10xi32>
}
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/mlir/lib/IR/Types.cpp:134: unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion `isIntOrFloat() && "only integers and floats have a bitwidth"' 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 0x0000590e4cbd8998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x108a998)
#1 0x0000590e4cbd64be llvm::sys::RunSignalHandlers() (./mlir-opt+0x10884be)
#2 0x0000590e4cbd93a8 SignalHandler(int) Signals.cpp:0:0
#3 0x000072f6b0e9f520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000072f6b0ef39fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x000072f6b0e9f476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x000072f6b0e857f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x000072f6b0e8571b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x000072f6b0e96e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x0000590e50067aa5 mlir::Type::getIntOrFloatBitWidth() const (./mlir-opt+0x4519aa5)
#10 0x0000590e4ff95464 mlir::detail::getDenseElementBitWidth(mlir::Type) (./mlir-opt+0x4447464)
#11 0x0000590e4ff99747 mlir::DenseIntOrFPElementsAttr::getRaw(mlir::ShapedType, llvm::ArrayRef<char>) (./mlir-opt+0x444b747)
#12 0x0000590e4ffcccf2 (anonymous namespace)::BuiltinDialectBytecodeInterface::readAttribute(mlir::DialectBytecodeReader&) const BuiltinDialectBytecode.cpp:0:0
#13 0x0000590e51f803e4 (anonymous namespace)::AttrTypeReader::resolveAttribute(unsigned long) BytecodeReader.cpp:0:0
#14 0x0000590e51f7f777 (anonymous namespace)::DialectReader::readAttribute(mlir::Attribute&) BytecodeReader.cpp:0:0
#15 0x0000590e4f0ee0a4 llvm::LogicalResult mlir::DialectBytecodeReader::readAttribute<mlir::ElementsAttr>(mlir::ElementsAttr&) (./mlir-opt+0x35a00a4)
#16 0x0000590e4f155b38 mlir::detail::BytecodeOpInterfaceInterfaceTraits::Model<mlir::tosa::ConstOp>::readProperties(mlir::DialectBytecodeReader&, mlir::OperationState&) (./mlir-opt+0x3607b38)
#17 0x0000590e51f7d0c8 mlir::BytecodeReader::Impl::parseRegions(std::vector<mlir::BytecodeReader::Impl::RegionReadState, std::allocator<mlir::BytecodeReader::Impl::RegionReadState>>&, mlir::BytecodeReader::Impl::RegionReadState&) (./mlir-opt+0x642f0c8)
#18 0x0000590e51f78adb mlir::BytecodeReader::Impl::parseIRSection(llvm::ArrayRef<unsigned char>, mlir::Block*) (./mlir-opt+0x642aadb)
#19 0x0000590e51f75f3d mlir::BytecodeReader::Impl::read(mlir::Block*, llvm::function_ref<bool (mlir::Operation*)>) (./mlir-opt+0x6427f3d)
#20 0x0000590e51f7e8be readBytecodeFileImpl(llvm::MemoryBufferRef, mlir::Block*, mlir::ParserConfig const&, std::shared_ptr<llvm::SourceMgr> const&) BytecodeReader.cpp:0:0
#21 0x0000590e51f7e74e mlir::readBytecodeFile(llvm::MemoryBufferRef, mlir::Block*, mlir::ParserConfig const&) (./mlir-opt+0x643074e)
#22 0x0000590e4fea62ef mlir::parseSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) (./mlir-opt+0x43582ef)
#23 0x0000590e4fea6988 mlir::parseSourceString(llvm::StringRef, mlir::Block*, mlir::ParserConfig const&, llvm::StringRef, mlir::LocationAttr*) (./mlir-opt+0x4358988)
#24 0x0000590e4fd77e74 (anonymous namespace)::TestBytecodeRoundtripPass::doRoundtripWithConfigs(mlir::Operation*, mlir::BytecodeWriterConfig const&, mlir::ParserConfig const&) TestBytecodeRoundtrip.cpp:0:0
#25 0x0000590e4fd75cb0 (anonymous namespace)::TestBytecodeRoundtripPass::runOnOperation() TestBytecodeRoundtrip.cpp:0:0
#26 0x0000590e4fea93bf mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x435b3bf)
#27 0x0000590e4fea9ba2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x435bba2)
#28 0x0000590e4feac34e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x435e34e)
#29 0x0000590e4fea4e6b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#30 0x0000590e4fea4acb 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
#31 0x0000590e4ff4ddf5 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)
#32 0x0000590e4fe9f9b2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x43519b2)
#33 0x0000590e4fe9fc63 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4351c63)
#34 0x0000590e4fe9fe72 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4351e72)
#35 0x0000590e4cbb7c27 main (./mlir-opt+0x1069c27)
#36 0x000072f6b0e86d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#37 0x000072f6b0e86e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#38 0x0000590e4cbb7795 _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