Issue 203218
Summary [mlir] Assertion `use_empty() && "Cannot destroy a value that still has uses!"' failed.
Labels
Assignees
Reporter Anonymous7i0em3yd
    git version: aec0da1e9455356a32ec797430794025628b4210

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -test-func-erase-arg a.mlir`

a.mlir: 

```mlir
module {
  llvm.func @f(%arg0: f32 {test.erase_this_arg}) {
 %0 = "emitc.constant"() <{value = 1 : index}> {test.erase_this_arg} : () -> index
    "test.return"(%0) : (index) -> ()
  }
  llvm.func @_mlir_ciface_f(%arg0: f32 {test.erase_this_arg}) attributes {test.side_effect = true} {
    llvm.call @f(%arg0) : (f32) -> ()
 llvm.return
  }
}

```

stack trace:

```
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/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 and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -test-func-erase-arg 4.mlir
 #0 0x000055b868435658 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fda658)
 #1 0x000055b8684324f1 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fd74f1)
 #2 0x000055b868436776 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007fe5fd02c420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007fe5fc66900b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007fe5fc648859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007fe5fc648729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007fe5fc648729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007fe5fc659fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #9 0x000055b870fb3ce5 (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xab58ce5)
#10 0x000055b870fb3ad4 mlir::Block::eraseArguments(llvm::BitVector const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xab58ad4)
#11 0x000055b870ec5a8b mlir::function_interface_impl::eraseFunctionArguments(mlir::FunctionOpInterface, llvm::BitVector const&, mlir::Type) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xaa6aa8b)
#12 0x000055b868bf5e44 (anonymous namespace)::TestFuncEraseArg::runOnOperation() TestFunc.cpp:0:0
#13 0x000055b870d61f42 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa906f42)
#14 0x000055b870d62d84 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa907d84)
#15 0x000055b870d69c9a mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa90ec9a)
#16 0x000055b870d695cf mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa90e5cf)
#17 0x000055b8684e756b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#18 0x000055b8684e67a6 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, 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::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#19 0x000055b8710b6815 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::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xac5b815)
#20 0x000055b8684dc3a6 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20813a6)
#21 0x000055b8684dc785 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2081785)
#22 0x000055b8684dcae5 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2081ae5)
#23 0x000055b86841b0e2 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fc00e2)
#24 0x00007fe5fc64a083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#25 0x000055b86841ac1e _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fbfc1e)
Aborted (core dumped)
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to