Issue 130023
Summary [MLIR] LLVM ERROR: operation destroyed but still has uses.
Labels mlir
Assignees
Reporter RiRi114
    Test on commit: 0f9720a6

steps to reproduce:
`mlir-opt  temp.mlir   -test-transform-dialect-erase-schedule
`

test case:
```mlir
module attributes {transform.with_named_sequence} {
    func.func @transform_example(%arg0: !transform.any_op) {
        %transform_copy = transform.structured.match ops{["linalg.copy"]} in %arg0 : (!transform.any_op) -> !transform.any_op
        transform.nvgpu.rewrite_copy_as_tma %transform_copy : (!transform.any_op) -> ()
        transform.yield
    }
}
```

crash trace:
```
temp.mlir:3:27: error: 'transform.structured.match' op operation destroyed but still has uses
        %transform_copy = transform.structured.match ops{["linalg.copy"]} in %arg0 : (!transform.any_op) -> !transform.any_op
                          ^
temp.mlir:3:27: note: see current operation: %0 = "transform.structured.match"(<<UNKNOWN SSA VALUE>>) <{ops = ["linalg.copy"]}> : (!transform.any_op) -> !transform.any_op
temp.mlir:4:9: note: - use: "transform.nvgpu.rewrite_copy_as_tma"(<<UNKNOWN SSA VALUE>>) : (!transform.any_op) -> ()

        transform.nvgpu.rewrite_copy_as_tma %transform_copy : (!transform.any_op) -> ()
        ^
LLVM ERROR: operation destroyed but still has uses
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/fuzzing/llvm-project/build/bin/mlir-opt temp.mlir -test-transform-dialect-erase-schedule
 #0 0x000000000113ce77 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x113ce77)
 #1 0x000000000113aa0e llvm::sys::RunSignalHandlers() (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x113aa0e)
 #2 0x000000000113d855 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x000079204fa48520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000079204fa9c9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x000079204fa48476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x000079204fa2e7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000000001124863 llvm::report_fatal_error(llvm::Twine const&, bool) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x1124863)
 #8 0x00000000011246b6 (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x11246b6)
 #9 0x00000000043e7bed mlir::Operation::~Operation() (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x43e7bed)
#10 0x00000000043f02a3 llvm::iplist_impl<llvm::simple_ilist<mlir::Operation>, llvm::ilist_traits<mlir::Operation> >::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, true, false, void, false, void>, false, false>) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x43f02a3)
#11 0x0000000004943c99 mlir::WalkResult llvm::function_ref<mlir::WalkResult (mlir::Operation*)>::callback_fn<(anonymous namespace)::TestTransformDialectEraseSchedulePass::runOnOperation()::'lambda'(mlir::Operation*)>(long, mlir::Operation*) TestTransformDialectInterpreter.cpp:0:0
#12 0x0000000001271548 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x1271548)
#13 0x00000000012714f7 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x12714f7)
#14 0x00000000012714f7 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x12714f7)
#15 0x0000000004943baa (anonymous namespace)::TestTransformDialectEraseSchedulePass::runOnOperation() TestTransformDialectInterpreter.cpp:0:0
#16 0x00000000042452f7 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x42452f7)
#17 0x0000000004245b61 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x4245b61)
#18 0x000000000424825b mlir::PassManager::run(mlir::Operation*) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x424825b)
#19 0x00000000042408af performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#20 0x0000000004240503 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&)::$_3>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#21 0x00000000042ec4e8 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/fuzzing/llvm-project/build/bin/mlir-opt+0x42ec4e8)
#22 0x000000000423a151 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x423a151)
#23 0x000000000423a403 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x423a403)
#24 0x000000000423a612 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x423a612)
#25 0x000000000111a8d7 main (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x111a8d7)
#26 0x000079204fa2fd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#27 0x000079204fa2fe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#28 0x000000000111a435 _start (/home/fuzzing/llvm-project/build/bin/mlir-opt+0x111a435)
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