Issue 114765
Summary [MLIR]-test-ir-visitors triggers Assertion Failure `use_empty() && "Cannot destroy a value that still has uses!"'
Labels mlir
Assignees
Reporter xisang0
    Test on commit: [c3edeaa61bf0e7faed6c26f693b4fcd9102ba1ec](url)
steps to reproduce:
```
mlir-opt test7.mlir --test-ir-visitors
```
test case:
```
module {
  func.func @branchCondProp(%arg0: i1) {
 llvm.cond_br %arg0, ^bb1, ^bb2
  ^bb1: "test.consumer1"(%arg0) : (i1) -> ()
  ^bb2: "test.consumer2"(%arg0) : (i1) -> ()
    return
 }
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/mlir/include/mlir/IR/UseDefLists.h:198: mlir::IRObjectWithUseList<mlir::OpOperand>::~IRObjectWithUseList() [OperandType = mlir::OpOperand]: Assertion `use_empty() && "Cannot destroy a value that still has uses!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: ./mlir-opt /home/workdir/test7.mlir --test-ir-visitors
 #0 0x00005dee86b4c228 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x1062228)
 #1 0x00005dee86b49d4e llvm::sys::RunSignalHandlers() (./mlir-opt+0x105fd4e)
 #2 0x00005dee86b4cc38 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007043ac723520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007043ac7779fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007043ac723476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007043ac7097f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007043ac70971b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007043ac71ae96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00005dee89e54727 mlir::Block::~Block() (./mlir-opt+0x436a727)
#10 0x00005dee89e54b4d mlir::Block::erase() (./mlir-opt+0x436ab4d)
#11 0x00005dee894291be void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Block*)>, mlir::WalkOrder) (./mlir-opt+0x393f1be)
#12 0x00005dee894291a3 void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Block*)>, mlir::WalkOrder) (./mlir-opt+0x393f1a3)
#13 0x00005dee89c63519 (anonymous namespace)::TestIRVisitorsPass::runOnOperation() TestVisitors.cpp:0:0
#14 0x00005dee89d74e9f mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x428ae9f)
#15 0x00005dee89d75682 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x428b682)
#16 0x00005dee89d77e2e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x428de2e)
#17 0x00005dee89d70952 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#18 0x00005dee89d705bb 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
#19 0x00005dee89e1a2a5 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) (./mlir-opt+0x43302a5)
#20 0x00005dee89d6b7b2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x42817b2)
#21 0x00005dee89d6ba63 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4281a63)
#22 0x00005dee89d6bc72 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4281c72)
#23 0x00005dee86b2b477 main (./mlir-opt+0x1041477)
#24 0x00007043ac70ad90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#25 0x00007043ac70ae40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#26 0x00005dee86b2afe5 _start (./mlir-opt+0x1040fe5)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to