Issue 60726
Summary Inline pass violates assertion "expected 'op' to have no uses"
Labels new issue
Assignees
Reporter Colloportus0
    MLIR built at commit https://github.com/llvm/llvm-project/commit/4b815d84
Reproduced with: 
`mlir-opt --inline temp.mlir`

temp.mlir:
``` milr 
module {
  func.func @func() {
    %c0 = arith.constant 0 : index
 %alloc = memref.alloc() : memref<8xf32>
    scf.index_switch %c0 
 default {
      %0 = bufferization.clone %alloc : memref<8xf32> to memref<8xf32>
      %1 = memref.realloc %0 : memref<8xf32> to memref<15xf32>
      memref.dealloc %1 : memref<15xf32>
    }
 memref.dealloc %alloc : memref<8xf32>
    return
 }
}


```
 
trace:
```console  
Assertion failed: (op->use_empty() && "expected 'op' to have no uses"), function eraseOp, file PatternMatch.cpp, line 276.
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 --inline temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mlir-opt                 0x0000000100a212fc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt 0x0000000100a20364 llvm::sys::RunSignalHandlers() + 112
2 mlir-opt                 0x0000000100a21994 SignalHandler(int) + 344
3 libsystem_platform.dylib 0x00000001b36554c4 _sigtramp + 56
4 libsystem_pthread.dylib  0x00000001b363dee0 pthread_kill + 288
5 libsystem_c.dylib        0x00000001b3578340 abort + 168
6 libsystem_c.dylib        0x00000001b3577754 err + 0
7  mlir-opt 0x000000010289788c mlir::RewriterBase::eraseBlock(mlir::Block*) (.cold.1) + 0
8  mlir-opt                 0x000000010222e174 mlir::RewriterBase::eraseBlock(mlir::Block*) + 0
9  mlir-opt 0x0000000100c35e54 (anonymous namespace)::SimplifyClones::matchAndRewrite(mlir::bufferization::CloneOp, mlir::PatternRewriter&) const + 132
10 mlir-opt 0x00000001023b4ba0 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) + 1420
11 mlir-opt                 0x0000000102162048 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() + 2432
12 mlir-opt                 0x000000010215f6a0 mlir::applyPatternsAndFoldGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig) + 1516
13 mlir-opt                 0x0000000102126288 (anonymous namespace)::Canonicalizer::runOnOperation() + 156
14 mlir-opt 0x0000000102110efc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 428
15 mlir-opt                 0x000000010211142c mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
16 mlir-opt                 0x00000001021350c0 (anonymous namespace)::InlinerPass::optimizeSCCAsync(llvm::MutableArrayRef<mlir::CallGraphNode*>, mlir::MLIRContext*)::$_0::operator()(mlir::CallGraphNode*) const + 332
17 mlir-opt                 0x0000000102134bd0 (anonymous namespace)::InlinerPass::inlineSCC((anonymous namespace)::Inliner&, (anonymous namespace)::CGUseList&, (anonymous namespace)::CallGraphSCC&, mlir::MLIRContext*) + 7928
18 mlir-opt                 0x000000010212d0c8 (anonymous namespace)::InlinerPass::runOnOperation() + 1216
19 mlir-opt 0x0000000102110efc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 428
20 mlir-opt 0x000000010211142c mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
21 mlir-opt                 0x0000000102112d9c mlir::PassManager::run(mlir::Operation*) + 1148
22 mlir-opt 0x000000010210c16c performActions(llvm::raw_ostream&, bool, bool, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 476
23 mlir-opt                 0x000000010210bd58 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 704
24 mlir-opt                 0x0000000102176378 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) + 656
25 mlir-opt 0x000000010210a180 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) + 216
26 mlir-opt                 0x000000010210a674 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
27 mlir-opt 0x00000001008c0b34 main + 108
28 dyld 0x0000000105b95088 start + 516

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

Reply via email to