Issue |
128332
|
Summary |
[MLIR]`-remove-dead-values` triggers Assertion Failure `hasOperandStorage && "expected operation to have operand storage"'
|
Labels |
mlir
|
Assignees |
|
Reporter |
xisang0
|
Test on commit: https://github.com/llvm/llvm-project/commit/dca2ed31278c444f839e3e04fde0c21b62451d4a
steps to reproduce:
```
mlir-opt test.mlir -remove-dead-values
```
test case:
```
module {
func.func @main(%A: memref<128xi32>) -> () {
%c0 = arith.constant 0 : index
%c128 = arith.constant 128 : index
%c1 = arith.constant 1 : index
scf.for %i = %c0 to %c128 step %c1 {
%load_value = scf.execute_region -> i32 {
%elem = memref.load %A[%i] : memref<128xi32>
%incremented = arith.addi %elem, %elem : i32
scf.yield %incremented : i32
}
}
return
}
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/mlir/include/mlir/IR/Operation.h:983: detail::OperandStorage &mlir::Operation::getOperandStorage(): Assertion `hasOperandStorage && "expected operation to have operand storage"' 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/test.mlir -remove-dead-values
#0 0x0000642033f77258 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x10b5258)
#1 0x0000642033f74d7e llvm::sys::RunSignalHandlers() (./mlir-opt+0x10b2d7e)
#2 0x0000642033f77c68 SignalHandler(int) Signals.cpp:0:0
#3 0x00007b2facd14520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007b2facd689fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007b2facd14476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007b2faccfa7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00007b2faccfa71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x00007b2facd0be96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00006420373a4e69 (anonymous namespace)::cleanRegionBranchOp(mlir::RegionBranchOpInterface, mlir::dataflow::RunLivenessAnalysis&) RemoveDeadValues.cpp:0:0
#10 0x000064203408b04e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11c904e)
#11 0x000064203408b04e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11c904e)
#12 0x000064203408b04e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11c904e)
#13 0x00006420373a03e7 (anonymous namespace)::RemoveDeadValues::runOnOperation() RemoveDeadValues.cpp:0:0
#14 0x000064203736cbcf mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x44aabcf)
#15 0x000064203736d352 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x44ab352)
#16 0x000064203736fade mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x44adade)
#17 0x000064203736862b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#18 0x0000642037368283 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 0x00006420374119e5 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+0x454f9e5)
#20 0x0000642037361ee2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x449fee2)
#21 0x0000642037362193 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a0193)
#22 0x00006420373623a2 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a03a2)
#23 0x0000642033f56477 main (./mlir-opt+0x1094477)
#24 0x00007b2faccfbd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#25 0x00007b2faccfbe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#26 0x0000642033f55fe5 _start (./mlir-opt+0x1093fe5)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs