Issue |
128338
|
Summary |
[MLIR]`-test-written-to=assume-func-writes=true` triggers Assertion Failure `liveness && "expected a sparse lattice"'
|
Labels |
mlir
|
Assignees |
|
Reporter |
xisang0
|
Test on commit: https://github.com/llvm/llvm-project/commit/abc4183c731e0a352ebebc96106e3622e6ad5029
steps to reproduce:
```
mlir-opt test.mlir -test-written-to=assume-func-writes=true
```
test case:
```
func.func private @private2(%0 : i32) -> () {
%cond = arith.index_cast %0 {tag = "in_private2"} : i32 to index
%1 = scf.index_switch %cond -> i32
default {
%thirty = arith.constant 30 : i32
scf.yield %thirty : i32
}
func.return
}
```
crash trace:
```
test_tag: in_private2:
mlir-opt: /home/workdir/llvm-project-19/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp:48: auto (anonymous namespace)::TestLivenessAnalysisPass::runOnOperation()::(anonymous class)::operator()(Operation *) const: Assertion `liveness && "expected a sparse lattice"' 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 -test-liveness-analysis
#0 0x00005757f38b62b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x10b62b8)
#1 0x00005757f38b3dde llvm::sys::RunSignalHandlers() (./mlir-opt+0x10b3dde)
#2 0x00005757f38b6cc8 SignalHandler(int) Signals.cpp:0:0
#3 0x000075ae43ec9520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000075ae43f1d9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x000075ae43ec9476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x000075ae43eaf7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x000075ae43eaf71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x000075ae43ec0e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00005757f675ef79 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<(anonymous namespace)::TestLivenessAnalysisPass::runOnOperation()::'lambda'(mlir::Operation*)>(long, mlir::Operation*) TestLivenessAnalysis.cpp:0:0
#10 0x00005757f39ca0ae void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11ca0ae)
#11 0x00005757f39ca0ae void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11ca0ae)
#12 0x00005757f675e5f8 (anonymous namespace)::TestLivenessAnalysisPass::runOnOperation() TestLivenessAnalysis.cpp:0:0
#13 0x00005757f6cac64f mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x44ac64f)
#14 0x00005757f6cacdd2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x44acdd2)
#15 0x00005757f6caf55e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x44af55e)
#16 0x00005757f6ca80ab performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#17 0x00005757f6ca7d03 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
#18 0x00005757f6d51465 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+0x4551465)
#19 0x00005757f6ca1962 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x44a1962)
#20 0x00005757f6ca1c13 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a1c13)
#21 0x00005757f6ca1e22 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a1e22)
#22 0x00005757f38954d7 main (./mlir-opt+0x10954d7)
#23 0x000075ae43eb0d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#24 0x000075ae43eb0e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#25 0x00005757f3895045 _start (./mlir-opt+0x1095045)
Aborted (core dumped)
(base) root@4dc8d4e7462e:/home/workdir/llvm-project-19/build/bin# ./mlir-opt /home/workdir/test.mlir -test-written-to=assume-func-writes=true
test_tag: in_private2:
mlir-opt: /home/workdir/llvm-project-19/mlir/test/lib/Analysis/DataFlow/TestSparseBackwardDataFlowAnalysis.cpp:199: auto (anonymous namespace)::TestWrittenToPass::runOnOperation()::(anonymous class)::operator()(Operation *) const: Assertion `writtenTo && "expected a sparse lattice"' 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 -test-written-to=assume-func-writes=true
#0 0x00005925fb2062b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x10b62b8)
#1 0x00005925fb203dde llvm::sys::RunSignalHandlers() (./mlir-opt+0x10b3dde)
#2 0x00005925fb206cc8 SignalHandler(int) Signals.cpp:0:0
#3 0x000070a2c80a8520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000070a2c80fc9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x000070a2c80a8476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x000070a2c808e7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x000070a2c808e71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
#8 0x000070a2c809fe96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#9 0x00005925fe0b1c89 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<(anonymous namespace)::TestWrittenToPass::runOnOperation()::'lambda'(mlir::Operation*)>(long, mlir::Operation*) TestSparseBackwardDataFlowAnalysis.cpp:0:0
#10 0x00005925fb31a0ae void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11ca0ae)
#11 0x00005925fb31a0ae void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11ca0ae)
#12 0x00005925fe0af67c (anonymous namespace)::TestWrittenToPass::runOnOperation() TestSparseBackwardDataFlowAnalysis.cpp:0:0
#13 0x00005925fe5fc64f mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x44ac64f)
#14 0x00005925fe5fcdd2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x44acdd2)
#15 0x00005925fe5ff55e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x44af55e)
#16 0x00005925fe5f80ab performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#17 0x00005925fe5f7d03 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
#18 0x00005925fe6a1465 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+0x4551465)
#19 0x00005925fe5f1962 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x44a1962)
#20 0x00005925fe5f1c13 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a1c13)
#21 0x00005925fe5f1e22 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a1e22)
#22 0x00005925fb1e54d7 main (./mlir-opt+0x10954d7)
#23 0x000070a2c808fd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#24 0x000070a2c808fe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#25 0x00005925fb1e5045 _start (./mlir-opt+0x1095045)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs