| Issue |
61526
|
| Summary |
[MLIR]LLVM ERROR: operation destroyed but still has uses
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
BealZephyr
|
Test on commit: https://github.com/llvm/llvm-project/commit/333ae0a6c4d2209e3b8c6c672986a52644bd5baf
steps to reproduce:
```
mlir-opt -test-ir-visitors test.mlir
```
test case:
```
module {
func.func @main(){
%c0 = arith.constant 0 : index
%c68 = arith.constant 68 : index
cf.br ^bb1(%c0 : index)
^bb1(%29: index): // 2 preds: ^bb0, ^bb2
%30 = builtin.unrealized_conversion_cast %29 : index to i64
%31 = arith.cmpi slt, %29, %c68 : index
return
}
}
```
crash trace:
```
test.mlir:4:12: error: 'arith.constant' op operation destroyed but still has uses
%c68 = arith.constant 68 : index
^
test.mlir:4:12: note: see current operation: %0 = "arith.constant"() {value = 68 : index} : () -> index
test.mlir:8:11: note: - use: %1 = "arith.cmpi"(%arg0, <<UNKNOWN SSA VALUE>>) {predicate = 2 : i64} : (index, index) -> i1
%31 = arith.cmpi slt, %29, %c68 : index
^
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/ty/llvm-project/build/bin/mlir-opt -test-ir-visitors test.mlir
#0 0x000055cdf40da4ea llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/ty/llvm-project/build/bin/mlir-opt+0x2244ea)
#1 0x000055cdf40d777c SignalHandler(int) Signals.cpp:0:0
#2 0x00007f3a973fa980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
#3 0x00007f3a964f2e87 raise /build/glibc-CVJwZb/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#4 0x00007f3a964f47f1 abort /build/glibc-CVJwZb/glibc-2.27/stdlib/abort.c:81:0
#5 0x000055cdf40f3e2d llvm::report_fatal_error(llvm::Twine const&, bool) (/home/ty/llvm-project/build/bin/mlir-opt+0x23de2d)
#6 0x000055cdf40f3fa8 (/home/ty/llvm-project/build/bin/mlir-opt+0x23dfa8)
#7 0x000055cdf5b33ae3 mlir::Operation::~Operation() (/home/ty/llvm-project/build/bin/mlir-opt+0x1c7dae3)
#8 0x000055cdf5b33b7b llvm::ilist_traits<mlir::Operation>::deleteNode(mlir::Operation*) (/home/ty/llvm-project/build/bin/mlir-opt+0x1c7db7b)
#9 0x000055cdf5a994d3 mlir::Block::~Block() (/home/ty/llvm-project/build/bin/mlir-opt+0x1be34d3)
#10 0x000055cdf5a997dd mlir::Block::erase() (/home/ty/llvm-project/build/bin/mlir-opt+0x1be37dd)
#11 0x000055cdf58a4593 void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Block*)>, mlir::WalkOrder) (.constprop.168) TestVisitors.cpp:0:0
#12 0x000055cdf58adbd6 (anonymous namespace)::TestIRVisitorsPass::runOnOperation() TestVisitors.cpp:0:0
#13 0x000055cdf59a2fe9 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/ty/llvm-project/build/bin/mlir-opt+0x1aecfe9)
#14 0x000055cdf59a3e43 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (.constprop.495) Pass.cpp:0:0
#15 0x000055cdf59a452d mlir::PassManager::run(mlir::Operation*) (/home/ty/llvm-project/build/bin/mlir-opt+0x1aee52d)
#16 0x000055cdf5997453 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#17 0x000055cdf5997b89 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPool*) MlirOptMain.cpp:0:0
#18 0x000055cdf5997eb1 mlir::LogicalResult llvm::function_ref<mlir::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&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#19 0x000055cdf5a62ce0 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/home/ty/llvm-project/build/bin/mlir-opt+0x1bacce0)
#20 0x000055cdf5994b93 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/ty/llvm-project/build/bin/mlir-opt+0x1adeb93)
#21 0x000055cdf59982a6 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) (/home/ty/llvm-project/build/bin/mlir-opt+0x1ae22a6)
#22 0x000055cdf40a6650 main (/home/ty/llvm-project/build/bin/mlir-opt+0x1f0650)
#23 0x00007f3a964d5c87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0
#24 0x000055cdf40b94aa _start (/home/ty/llvm-project/build/bin/mlir-opt+0x2034aa)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs