[mlir](transform-interpreter) mlir-opt crashes at TransformInterfaces.cpp:1126 with assertion `operations[resultNumber].data() != nullptr && "querying unset results (values or params expected?)"' failed.
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
git version: 42f2cd0c980cc1a924619ecaeaa51ca7b55164ab
MLIR Program:
```mlir
module {
module attributes {transform.with_named_sequence} {
transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {
%0 = transform.structured.match ops{["linalg.matmul"]} in %arg0 : (!transform.any_op) -> !transform.any_op
%tiled_op, %loops:2 = transform.test.tile_using_forall %0 [10, 20] mapping = [#gpu.block, #gpu.block] : (!transform.any_op) -> (!transform.any_op, !transform.any_op, !transform.any_op)
transform.yield
}
}
}
```
Reproduce Command: `mlir-opt -transform-interpreter a.mlir`
StackTrace:
```
mlir-opt: /data2/dependency/dev/llvm-project/mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp:1126: llvm::ArrayRef mlir::transform::TransformResults::get(unsigned int) const: Assertion `operations[resultNumber].data() != nullptr && "querying unset results (values or params expected?)"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: mlir-opt -transform-interpreter a.mlir
#0 0x0000563d37a39aff llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x20adaff)
#1 0x0000563d37a3665c llvm::sys::RunSignalHandlers() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x20aa65c)
#2 0x0000563d37a36803 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f57cf3a2420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f57cee8d00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f57cee6c859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f57cee6c729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007f57cee7dfd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x0000563d3e5d47b5 mlir::transform::TransformResults::get(unsigned int) const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x8c487b5)
#9 0x0000563d3e5ee6d8 mlir::transform::TransformState::updateStateFromResults(mlir::transform::TransformResults const&, mlir::ResultRange) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x8c626d8)
#10 0x0000563d3e5f33c1 mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x8c673c1)
#11 0x0000563d3e551149 applySequenceBlock(mlir::Block&, mlir::transform::FailurePropagationMode, mlir::transform::TransformState&, mlir::transform::TransformResults&) TransformOps.cpp:0:0
#12 0x0000563d3e5a0394 mlir::transform::NamedSequenceOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x8c14394)
#13 0x0000563d3e4f0583 mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x8b64583)
#14 0x0000563d3e5f211d mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x8c6611d)
#15 0x0000563d3e5f3a61 mlir::transform::applyTransforms(mlir::Operation*, mlir::transform::TransformOpInterface, mlir::RaggedArray> const&, mlir::transform::TransformOptions const&, bool, llvm::function_ref, llvm::function_ref) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x8c67a61)
#16 0x0000563d3e4dbaf0 mlir::transform::applyTransformNamedSequence(mlir::RaggedArray>, mlir::transform::TransformOpInterface, mlir::ModuleOp, mlir::transform::TransformOptions const&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x8b4faf0)
#17 0x0000563d3e4d706f (anonymous namespace)::InterpreterPass::runOnOperation() InterpreterPass.cpp:0:0
#18 0x0000563d40f7bf81 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb5eff81)
#19 0x0000563d40f7c310 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb5f0310)
#20 0x0000563d40f7e3c4 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb5f23c4)
#21 0x0000563d40f7f491 mlir::PassManager::run(mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb5f3491)
#22 0x0000563d37afff7b performActions(llvm::raw_ostream&, std::shared_ptr const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#23 0x0000563d37b00abf processBuffer(llvm::raw_ostream&, std::unique_ptr>, llvm::MemoryBufferRef, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, mlir::SourceMgrDiagnosticVerifierHandler*, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#24 0x0000563d37b00ceb llvm::LogicalResult llvm::function_ref>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>::callback_fn>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::'lambda'(std::unique_ptr>, llvm::MemoryBufferRef, llvm::raw_ostream&)>(long, std::unique_ptr>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#25 0x0000563d41363e55 mlir::splitAndProcessBuffer(std::unique_ptr>, llvm::function_ref>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb9d7e55)
#26 0x0000563d37af6d34 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (.part.0) MlirOptMain.cpp:0:0
#27 0x0000563d37b01207 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2175207)
#28 0x0000563d37b01443 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2175443)
#29 0x0000563d379a09e7 main (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x20149e7)
#30 0x00007f57cee6e083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#31 0x0000563d37a1648e _start (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x208a48e)
Aborted (core dumped)
```
Contributor guide
Research direction
Reproduce the failure with `mlir-opt -transform-interpreter a.mlir`, then inspect `TransformInterfaces.cpp:1126` and the stack path through `TransformState::updateStateFromResults` and `applyTransform`. Trace the named transform sequence and interpreter entries in `TransformOps.cpp` and `InterpreterPass.cpp`; done means this input no longer aborts on the unset-result assertion.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100