Issue |
128335
|
Summary |
[MLIR]`-remove-dead-values` triggers Assertion Failure `!NodePtr->isKnownSentinel()'
|
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 @invariant_affine_nested_if_else() {
%m = memref.alloc() : memref<10xf32>
%cf8 = arith.constant 8.0 : f32
affine.for %arg0 = 0 to 10 {
affine.for %arg1 = 0 to 10 {
affine.if affine_set<(d0, d1) : (d1 - d0 >= 0)> (%arg0, %arg0) {
%cf9 = arith.addf %cf8, %cf8 : f32
affine.store %cf9, %m[%arg0] : memref<10xf32>
}
}
}
return
}
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/llvm/include/llvm/ADT/ilist_iterator.h:168: reference llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Block, true, false, void, false, void>, false, false>::operator*() const [OptionsT = llvm::ilist_detail::node_options<mlir::Block, true, false, void, false, void>, IsReverse = false, IsConst = false]: Assertion `!NodePtr->isKnownSentinel()' 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 0x0000603388725258 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x10b5258)
#1 0x0000603388722d7e llvm::sys::RunSignalHandlers() (./mlir-opt+0x10b2d7e)
#2 0x0000603388725c68 SignalHandler(int) Signals.cpp:0:0
#3 0x0000780752fc0520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007807530149fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x0000780752fc0476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x0000780752fa67f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x0000780752fa671b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x0000780752fb7e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x000060338bb52e2b (anonymous namespace)::cleanRegionBranchOp(mlir::RegionBranchOpInterface, mlir::dataflow::RunLivenessAnalysis&) RemoveDeadValues.cpp:0:0
#10 0x000060338883904e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11c904e)
#11 0x000060338883904e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11c904e)
#12 0x000060338883904e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11c904e)
#13 0x000060338883904e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11c904e)
#14 0x000060338bb4e3e7 (anonymous namespace)::RemoveDeadValues::runOnOperation() RemoveDeadValues.cpp:0:0
#15 0x000060338bb1abcf mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x44aabcf)
#16 0x000060338bb1b352 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x44ab352)
#17 0x000060338bb1dade mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x44adade)
#18 0x000060338bb1662b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#19 0x000060338bb16283 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
#20 0x000060338bbbf9e5 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)
#21 0x000060338bb0fee2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x449fee2)
#22 0x000060338bb10193 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a0193)
#23 0x000060338bb103a2 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a03a2)
#24 0x0000603388704477 main (./mlir-opt+0x1094477)
#25 0x0000780752fa7d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x0000780752fa7e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x0000603388703fe5 _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