Issue 132886
Summary [mlir] Parser crash 'vector.contract'
Labels mlir
Assignees
Reporter wwy6191
    git version: 59fd2878fce470f02058f43d4b818ed68ce04094

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt   a.mlir`


a.mlir:  
``` 
module {
 llvm.func @matmul_mk_nk(%arg0 :!llvm.array<4 x vector<16xi32>>, %arg1:!llvm.array<4 x vector < 16xi32 >>, %arg2:!llvm.array<4 x vector<16xi32>>) ->!llvm.array<4 x vector<16xi32>> {
    %0 = builtin.unrealized_conversion_cast %arg2 :!llvm.array<4 x vector<16xi32>> to vector<4x16xi32>
    %1 = builtin.unrealized_conversion_cast %arg1 :!llvm.array<4 x vector < 16xi32 >> to vector<4x16xi32>
    %2 = builtin.unrealized_conversion_cast %arg0 :!llvm.array<4 x vector<16xi32>> to vector<4x16xi32>
    %cst = arith.constant dense<0> : vector<4x16xi32>
 %3 = vector.contract {indexing_maps = [affine_map<(d0, d1, d2) -> (d0, d2)>, affine_map<(d0, d1, d2) -> (d2, d1)>, affine_map<(d0, d1, d2) -> (d0, d1)>]} %2, %1, %0 : vector<4x16xi32>, vector<4x16xi32> into vector<4x16xi32>
    %4 = builtin.unrealized_conversion_cast %3 : vector<4x16xi32> to!llvm.array<4 x vector<16xi32>>
    llvm.return %4 :!llvm.array<4 x vector<16xi32>>
 }
}
``` 
stack trace:

``` 
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.b095sQl65J.mlir
1.      MLIR Parser: custom op parser 'builtin.module'
2.      MLIR Parser: custom op parser 'llvm.func'
3.      MLIR Parser: custom op parser 'vector.contract'
 #0 0x000056043de9bdb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x11bddb8)
 #1 0x000056043de998be llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x11bb8be)
 #2 0x000056043de9c736 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f8fb3e4f420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x000056044071b347 mlir::vector::ContractionOp::parse(mlir::OpAsmParser&, mlir::OperationState&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x3a3d347)
 #5 0x00005604440047e4 (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
 #6 0x000056044400f9a4 (anonymous namespace)::OperationParser::parseBlock(mlir::Block*&) Parser.cpp:0:0
 #7 0x000056044400d85c (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
 #8 0x000056044400bacc (anonymous namespace)::CustomOpAsmParser::parseOptionalRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
 #9 0x000056043f17c071 mlir::LLVM::LLVMFuncOp::parse(mlir::OpAsmParser&, mlir::OperationState&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x249e071)
#10 0x00005604440047e4 (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
#11 0x000056044400f9a4 (anonymous namespace)::OperationParser::parseBlock(mlir::Block*&) Parser.cpp:0:0
#12 0x000056044400d6d5 (anonymous namespace)::OperationParser::parseRegion(mlir::Region&, llvm::ArrayRef<mlir::OpAsmParser::Argument>, bool) Parser.cpp:0:0
#13 0x0000560440fc2b9e mlir::ModuleOp::parse(mlir::OpAsmParser&, mlir::OperationState&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x42e4b9e)
#14 0x00005604440047e4 (anonymous namespace)::OperationParser::parseOperation() Parser.cpp:0:0
#15 0x00005604440035ad mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x73255ad)
#16 0x0000560440ea2f0f 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)
#17 0x0000560440ea1e8e mlir::parseSourceFileForTool(std::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41c3e8e)
#18 0x0000560440ea167f performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#19 0x0000560440ea13ed 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
#20 0x0000560440f4c275 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)
#21 0x0000560440e9b405 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)
#22 0x0000560440e9b6af mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41bd6af)
#23 0x0000560440e9b9de mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x41bd9de)
#24 0x000056043de7a337 main (/data/szy/MLIR/llvm-project/install/bin/mlir-opt+0x119c337)
#25 0x00007f8fb346d083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#26 0x000056043de79e9e _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

Reply via email to