Issue 144028
Summary [MLIR] `-generate-runtime-verification` triggers LLVM ERROR: checking for an interface (`mlir::RuntimeVerifiableOpInterface`) that was promised by dialect 'memref' but never implemented.
Labels mlir
Assignees
Reporter Lambor24
    Test on commit: [4903c11](https://github.com/llvm/llvm-project/commit/4903c11a7e144d63635b115d97936a7aecf7a2f6). 

steps to reproduce:

 ```
mlir-opt test.mlir -generate-runtime-verification
```

test case:

```
module {
 func.func @main() {
    %alloc_5 = memref.alloc() {alignment = 64 : i64} : memref<9x12x8x4xf32>
    %reinterpret_cast = memref.reinterpret_cast %alloc_5 to offset: [36], sizes: [9, 10, 6, 4], strides: [384, 32, 4, 1] : memref<9x12x8x4xf32> to memref<9x10x6x4xf32, strided<[384, 32, 4, 1], offset: 36>>
    return
  }
}
```

crash trace:

```
LLVM ERROR: checking for an interface (`mlir::RuntimeVerifiableOpInterface`) that was promised by dialect 'memref' but never implemented. This is generally an indication that the dialect extension implementing the interface was never registered.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/projects/project/llvm-project/build/bin/mlir-opt test.mlir -generate-runtime-verification
 #0 0x00005c8814df394d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/projects/project/llvm-project/llvm/lib/Support/Unix/Signals.inc:804:11
 #1 0x00005c8814df3ecb PrintStackTraceSignalHandler(void*) /home/projects/project/llvm-project/llvm/lib/Support/Unix/Signals.inc:888:1
 #2 0x00005c8814df1ea6 llvm::sys::RunSignalHandlers() /home/projects/project/llvm-project/llvm/lib/Support/Signals.cpp:105:5
 #3 0x00005c8814df46ad SignalHandler(int, siginfo_t*, void*) /home/projects/project/llvm-project/llvm/lib/Support/Unix/Signals.inc:418:7
 #4 0x0000753ff5f6d520 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #5 0x0000753ff5fc19fc pthread_kill (/usr/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #6 0x0000753ff5f6d476 gsignal (/usr/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #7 0x0000753ff5f537f3 abort (/usr/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #8 0x00005c8814e3c9f4 llvm::report_fatal_error(llvm::Twine const&, bool) /home/projects/project/llvm-project/llvm/lib/Support/ErrorHandling.cpp:126:5
 #9 0x00005c8815a3a432 mlir::Dialect::handleUseOfUndefinedPromisedInterface(mlir::TypeID, mlir::TypeID, llvm::StringRef) /home/projects/project/llvm-project/mlir/include/mlir/IR/Dialect.h:240:3
#10 0x00005c881abc98e5 mlir::dialect_extension_detail::handleUseOfUndefinedPromisedInterface(mlir::Dialect&, mlir::TypeID, mlir::TypeID, llvm::StringRef) /home/projects/project/llvm-project/mlir/lib/IR/Dialect.cpp:164:1
#11 0x00005c881a9432b8 mlir::OpInterface<mlir::RuntimeVerifiableOpInterface, mlir::detail::RuntimeVerifiableOpInterfaceInterfaceTraits>::getInterfaceFor(mlir::Operation*) /home/projects/project/llvm-project/mlir/include/mlir/IR/OpDefinition.h:2112:18
#12 0x00005c881a943225 mlir::detail::Interface<mlir::RuntimeVerifiableOpInterface, mlir::Operation*, mlir::detail::RuntimeVerifiableOpInterfaceInterfaceTraits, mlir::Op<mlir::RuntimeVerifiableOpInterface>, mlir::OpTrait::TraitBase>::classof(mlir::Operation*) /home/projects/project/llvm-project/mlir/include/mlir/Support/InterfaceSupport.h:124:42
#13 0x00005c881a9431a5 llvm::CastInfo<mlir::RuntimeVerifiableOpInterface, mlir::Operation*, void>::isPossible(mlir::Operation*) /home/projects/project/llvm-project/mlir/include/mlir/IR/Operation.h:1113:51
#14 0x00005c881a943155 llvm::DefaultDoCastIfPossible<mlir::RuntimeVerifiableOpInterface, mlir::Operation*, llvm::CastInfo<mlir::RuntimeVerifiableOpInterface, mlir::Operation*, void>>::doCastIfPossible(mlir::Operation*) /home/projects/project/llvm-project/llvm/include/llvm/Support/Casting.h:311:9
#15 0x00005c881a943121 decltype(auto) llvm::dyn_cast<mlir::RuntimeVerifiableOpInterface, mlir::Operation>(mlir::Operation*) /home/projects/project/llvm-project/llvm/include/llvm/Support/Casting.h:663:10
#16 0x00005c881a942991 std::enable_if<!llvm::is_one_of<mlir::RuntimeVerifiableOpInterface, mlir::Operation*, mlir::Region*, mlir::Block*>::value && std::is_same<void, void>::value, void>::type mlir::detail::walk<(mlir::WalkOrder)1, mlir::ForwardIterator, (anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0, mlir::RuntimeVerifiableOpInterface, void>(mlir::Operation*, (anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0&&)::'lambda'(mlir::Operation*)::operator()(mlir::Operation*) const /home/projects/project/llvm-project/mlir/include/mlir/IR/Visitors.h:337:26
#17 0x00005c881a94295d void llvm::function_ref<void (mlir::Operation*)>::callback_fn<std::enable_if<!llvm::is_one_of<mlir::RuntimeVerifiableOpInterface, mlir::Operation*, mlir::Region*, mlir::Block*>::value && std::is_same<void, void>::value, void>::type mlir::detail::walk<(mlir::WalkOrder)1, mlir::ForwardIterator, (anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0, mlir::RuntimeVerifiableOpInterface, void>(mlir::Operation*, (anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0&&)::'lambda'(mlir::Operation*)>(long, mlir::Operation*) /home/projects/project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#18 0x00005c8815013cc1 llvm::function_ref<void (mlir::Operation*)>::operator()(mlir::Operation*) const /home/projects/project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
#19 0x00005c8815013c8e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) /home/projects/project/llvm-project/mlir/include/mlir/IR/Visitors.h:187:1
#20 0x00005c8815013c3d void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) /home/projects/project/llvm-project/mlir/include/mlir/IR/Visitors.h:179:27
#21 0x00005c8815013c3d void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) /home/projects/project/llvm-project/mlir/include/mlir/IR/Visitors.h:179:27
#22 0x00005c881a94290a std::enable_if<!llvm::is_one_of<mlir::RuntimeVerifiableOpInterface, mlir::Operation*, mlir::Region*, mlir::Block*>::value && std::is_same<void, void>::value, void>::type mlir::detail::walk<(mlir::WalkOrder)1, mlir::ForwardIterator, (anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0, mlir::RuntimeVerifiableOpInterface, void>(mlir::Operation*, (anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0&&) /home/projects/project/llvm-project/mlir/include/mlir/IR/Visitors.h:340:3
#23 0x00005c881a9428ad std::enable_if<llvm::function_traits<std::decay<(anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0>::type>::num_args == 1, void>::type mlir::Operation::walk<(mlir::WalkOrder)1, mlir::ForwardIterator, (anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0, void>((anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation()::$_0&&) /home/projects/project/llvm-project/mlir/include/mlir/IR/Operation.h:798:5
#24 0x00005c881a9426a3 (anonymous namespace)::GenerateRuntimeVerificationPass::runOnOperation() /home/projects/project/llvm-project/mlir/lib/Transforms/GenerateRuntimeVerification.cpp:35:19
#25 0x00005c881a8ddedb mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1::operator()() const /home/projects/project/llvm-project/mlir/lib/Pass/Pass.cpp:0:17
#26 0x00005c881a8dde75 void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) /home/projects/project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#27 0x00005c8814e19be9 llvm::function_ref<void ()>::operator()() const /home/projects/project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
#28 0x00005c881a8e1f65 void mlir::MLIRContext::executeAction<mlir::PassExecutionAction, mlir::Pass&>(llvm::function_ref<void ()>, llvm::ArrayRef<mlir::IRUnit>, mlir::Pass&) /home/projects/project/llvm-project/mlir/include/mlir/IR/MLIRContext.h:281:3
#29 0x00005c881a8d96da mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /home/projects/project/llvm-project/mlir/lib/Pass/Pass.cpp:563:17
#30 0x00005c881a8d9c64 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /home/projects/project/llvm-project/mlir/lib/Pass/Pass.cpp:623:16
#31 0x00005c881a8db6c8 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /home/projects/project/llvm-project/mlir/lib/Pass/Pass.cpp:937:10
#32 0x00005c881a8db5f2 mlir::PassManager::run(mlir::Operation*) /home/projects/project/llvm-project/mlir/lib/Pass/Pass.cpp:917:60
#33 0x00005c881a8ca36a performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) /home/projects/project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:484:17
#34 0x00005c881a8c9f0c processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPoolInterface*) /home/projects/project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:552:12
#35 0x00005c881a8c9cbc mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const /home/projects/project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:636:12
#36 0x00005c881a8c9c56 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&) /home/projects/project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
#37 0x00005c881aa5ddf2 llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const /home/projects/project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:12
#38 0x00005c881aa5d3dc 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/projects/project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:27:12
#39 0x00005c881a8c6098 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) /home/projects/project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:639:10
#40 0x00005c881a8c6459 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) /home/projects/project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:680:14
#41 0x00005c881a8c6628 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) /home/projects/project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:696:10
#42 0x00005c8814d62355 main /home/projects/project/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:339:33
#43 0x0000753ff5f54d90 (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#44 0x0000753ff5f54e40 __libc_start_main (/usr/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#45 0x00005c8814d61f35 _start (/home/projects/project/llvm-project/build/bin/mlir-opt+0x3178f35)
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