Issue 131441
Summary [MLIR] `ModuleOp` crashed with assertion failure: `matcherFunc && rewriterModule && "invalid PDL Interpreter module"
Labels mlir
Assignees
Reporter sweead
    test commit: [bbd1bb4](https://github.com/llvm/llvm-project/commit/bbd1bb40573dd5a36dc04af4ad307d6e16456f89)

step to reproduce:
```
mlir-opt test.mlir --mlir-debug-counter=pass-execution-skip=1 --test-dialect-conversion-pdll
```

test case:
```
  func.func @main() {
    return
  }
```

Crash backtrace:
```
mlir-opt: /home/workdir/llvm-project/mlir/lib/Rewrite/ByteCode.cpp:505: void (anonymous namespace)::Generator::generate(ModuleOp): Assertion `matcherFunc && rewriterModule && "invalid PDL Interpreter module"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/workdir/llvm-project/build/bin/./mlir-opt test.mlir --mlir-debug-counter=pass-execution-skip=1 --test-dialect-conversion-pdll
 #0 0x0000561b01ecf158 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12d3158)
 #1 0x0000561b01eccc7e llvm::sys::RunSignalHandlers() (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12d0c7e)
 #2 0x0000561b01ecfb61 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007fc151341520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007fc1513959fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007fc151341476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007fc1513277f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007fc15132771b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007fc151338e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000561b0777b3fc mlir::detail::PDLByteCode::PDLByteCode(mlir::ModuleOp, llvm::SmallVector<std::unique_ptr<mlir::PDLPatternConfigSet, std::default_delete<mlir::PDLPatternConfigSet>>, 6u>, llvm::DenseMap<mlir::Operation*, mlir::PDLPatternConfigSet*, llvm::DenseMapInfo<mlir::Operation*, void>, llvm::detail::DenseMapPair<mlir::Operation*, mlir::PDLPatternConfigSet*>> const&, llvm::StringMap<std::function<llvm::LogicalResult (mlir::PatternRewriter&, mlir::PDLResultList&, llvm::ArrayRef<mlir::PDLValue>)>, llvm::MallocAllocator>, llvm::StringMap<std::function<llvm::LogicalResult (mlir::PatternRewriter&, mlir::PDLResultList&, llvm::ArrayRef<mlir::PDLValue>)>, llvm::MallocAllocator>) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x6b7f3fc)
#10 0x0000561b07772d7b std::_MakeUniq<mlir::detail::PDLByteCode>::__single_object std::make_unique<mlir::detail::PDLByteCode, mlir::ModuleOp&, llvm::SmallVector<std::unique_ptr<mlir::PDLPatternConfigSet, std::default_delete<mlir::PDLPatternConfigSet>>, 6u>, llvm::DenseMap<mlir::Operation*, mlir::PDLPatternConfigSet*, llvm::DenseMapInfo<mlir::Operation*, void>, llvm::detail::DenseMapPair<mlir::Operation*, mlir::PDLPatternConfigSet*>>&, llvm::StringMap<std::function<llvm::LogicalResult (mlir::PatternRewriter&, mlir::PDLResultList&, llvm::ArrayRef<mlir::PDLValue>)>, llvm::MallocAllocator>, llvm::StringMap<std::function<llvm::LogicalResult (mlir::PatternRewriter&, mlir::PDLResultList&, llvm::ArrayRef<mlir::PDLValue>)>, llvm::MallocAllocator>>(mlir::ModuleOp&, llvm::SmallVector<std::unique_ptr<mlir::PDLPatternConfigSet, std::default_delete<mlir::PDLPatternConfigSet>>, 6u>&&, llvm::DenseMap<mlir::Operation*, mlir::PDLPatternConfigSet*, llvm::DenseMapInfo<mlir::Operation*, void>, llvm::detail::DenseMapPair<mlir::Operation*, mlir::PDLPatternConfigSet*>>&, llvm::StringMap<std::function<llvm::LogicalResult (mlir::PatternRewriter&, mlir::PDLResultList&, llvm::ArrayRef<mlir::PDLValue>)>, llvm::MallocAllocator>&&, llvm::StringMap<std::function<llvm::LogicalResult (mlir::PatternRewriter&, mlir::PDLResultList&, llvm::ArrayRef<mlir::PDLValue>)>, llvm::MallocAllocator>&&) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x6b76d7b)
#11 0x0000561b077721ea mlir::FrozenRewritePatternSet::FrozenRewritePatternSet(mlir::RewritePatternSet&&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x6b761ea)
#12 0x0000561b056780a1 (anonymous namespace)::TestDialectConversionPDLLPass::initialize(mlir::MLIRContext*) TestDialectConversion.cpp:0:0
#13 0x0000561b04fc82ad mlir::OpPassManager::initialize(mlir::MLIRContext*, unsigned int) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43cc2ad)
#14 0x0000561b04fcb73d mlir::PassManager::run(mlir::Operation*) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43cf73d)
#15 0x0000561b04fc3e9b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#16 0x0000561b04fc3af3 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
#17 0x0000561b0506f065 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) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x4473065)
#18 0x0000561b04fbd752 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43c1752)
#19 0x0000561b04fbda03 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43c1a03)
#20 0x0000561b04fbdc12 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43c1c12)
#21 0x0000561b01eae8df main (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12b28df)
#22 0x00007fc151328d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#23 0x00007fc151328e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#24 0x0000561b01eae435 _start (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12b2435)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to