Issue 132891
Summary [mlir] constant float or int?? informal mlir input raise crash
Labels mlir
Assignees
Reporter wwy6191
    git version: 59fd2878fce470f02058f43d4b818ed68ce04094

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt  a.mlir`


a.mlir:  
``` 
func.func @float_vector234(%arg0: vector<1xf16>) {
   %0 = arith.constant sparse<[[0, 0], [256, 256], [512, 512]], 0101>:vector<1x2x256xf16>
   return
 }


``` 
stack trace:

``` 
/data/szy/MLIR/my_issues/test.mlir:2:65: error: unexpected decimal integer literal for a floating point value
   %0 = arith.constant sparse<[[0, 0], [256, 256], [512, 512]], 0101>:vector<1x2x256xf16>
 ^
/data/szy/MLIR/my_issues/test.mlir:2:65: note: add a trailing dot to make the literal a float
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/my_issues/test.mlir
1.      MLIR Parser: custom op parser 'func.func'
2.      MLIR Parser: custom op parser 'arith.constant'
 #0 0x000055bbee812db8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x11bddb8)
 #1 0x000055bbee8108be llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x11bb8be)
 #2 0x000055bbee813736 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f0e88c7e420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x000055bbf1905418 mlir::SparseElementsAttr::verify(llvm::function_ref<mlir::InFlightDiagnostic ()>, mlir::ShapedType, mlir::DenseIntElementsAttr, mlir::DenseElementsAttr) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x42b0418)
 #5 0x000055bbf19052cd mlir::SparseElementsAttr::getChecked(llvm::function_ref<mlir::InFlightDiagnostic ()>, mlir::ShapedType, mlir::DenseElementsAttr, mlir::DenseElementsAttr) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x42b02cd)
 #6 0x000055bbf4999d23 mlir::detail::Parser::parseSparseElementsAttr(mlir::Type) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x7344d23)
 #7 0x000055bbf49815d0 mlir::detail::AsmParserImpl<mlir::OpAsmParser>::parseAttribute(mlir::Attribute&, mlir::Type) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x732c5d0)
 #8 0x000055bbeea8dcab llvm::ParseResult mlir::AsmParser::parseAttribute<mlir::TypedAttr>(mlir::TypedAttr&, mlir::Type) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x1438cab)
 #9 0x000055bbeea4287f mlir::arith::ConstantOp::parse(mlir::OpAsmParser&, mlir::OperationState&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x13ed87f)
#10 0x000055bbf497b7e4 (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
#11 0x000055bbf49869a4 (anonymous namespace)::OperationParser::parseBlock(mlir::Block*&) Parser.cpp:0:0
#12 0x000055bbf498485c (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
#13 0x000055bbf4982acc (anonymous namespace)::CustomOpAsmParser::parseOptionalRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
#14 0x000055bbf4a84e32 mlir::function_interface_impl::parseFunctionOp(mlir::OpAsmParser&, mlir::OperationState&, bool, mlir::StringAttr, llvm::function_ref<mlir::Type (mlir::Builder&, llvm::ArrayRef<mlir::Type>, llvm::ArrayRef<mlir::Type>, mlir::function_interface_impl::VariadicFlag, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)>, mlir::StringAttr, mlir::StringAttr) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x742fe32)
#15 0x000055bbeee957fa mlir::func::FuncOp::parse(mlir::OpAsmParser&, mlir::OperationState&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x18407fa)
#16 0x000055bbf497b7e4 (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
#17 0x000055bbf497a5ad mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x73255ad)
#18 0x000055bbf1819f0f 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 0x000055bbf1818e8e mlir::parseSourceFileForTool(std::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41c3e8e)
#20 0x000055bbf181867f performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#21 0x000055bbf18183ed 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 0x000055bbf18c3275 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 0x000055bbf1812405 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 0x000055bbf18126af mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41bd6af)
#25 0x000055bbf18129de mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41bd9de)
#26 0x000055bbee7f1337 main (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x119c337)
#27 0x00007f0e8829c083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#28 0x000055bbee7f0e9e _start (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x119be9e)
``` 

interesting case. dalao @CoTinker why 
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to