Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MLIR]--test-written-to=assume-func-writes=true triggers Assertion failure `writtenTo && "expected a sparse lattice"' #128339

Open
xisang0 opened this issue Feb 22, 2025 · 1 comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] mlir

Comments

@xisang0
Copy link

xisang0 commented Feb 22, 2025

Test on commit: 1d07098
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
  func.return
}

crash trace:

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 0x000062eb453f32b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x10b62b8)
 #1 0x000062eb453f0dde llvm::sys::RunSignalHandlers() (./mlir-opt+0x10b3dde)
 #2 0x000062eb453f3cc8 SignalHandler(int) Signals.cpp:0:0
 #3 0x0000747348ca8520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000747348cfc9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x0000747348ca8476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x0000747348c8e7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x0000747348c8e71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x0000747348c9fe96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x000062eb4829ec89 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<(anonymous namespace)::TestWrittenToPass::runOnOperation()::'lambda'(mlir::Operation*)>(long, mlir::Operation*) TestSparseBackwardDataFlowAnalysis.cpp:0:0
#10 0x000062eb455070ae void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11ca0ae)
#11 0x000062eb455070ae void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11ca0ae)
#12 0x000062eb4829c67c (anonymous namespace)::TestWrittenToPass::runOnOperation() TestSparseBackwardDataFlowAnalysis.cpp:0:0
#13 0x000062eb487e964f mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x44ac64f)
#14 0x000062eb487e9dd2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x44acdd2)
#15 0x000062eb487ec55e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x44af55e)
#16 0x000062eb487e50ab performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#17 0x000062eb487e4d03 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 0x000062eb4888e465 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 0x000062eb487de962 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x44a1962)
#20 0x000062eb487dec13 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a1c13)
#21 0x000062eb487dee22 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a1e22)
#22 0x000062eb453d24d7 main (./mlir-opt+0x10954d7)
#23 0x0000747348c8fd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#24 0x0000747348c8fe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#25 0x000062eb453d2045 _start (./mlir-opt+0x1095045)
Aborted (core dumped)
@llvmbot llvmbot added the mlir label Feb 22, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 22, 2025

@llvm/issue-subscribers-mlir

Author: None (xisang0)

Test on commit: https://github.com/llvm/llvm-project/commit/1d070988d9172965dee227e5629fa886845b815f 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 func.return } ``` crash trace: ``` 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 0x000062eb453f32b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x10b62b8) #1 0x000062eb453f0dde llvm::sys::RunSignalHandlers() (./mlir-opt+0x10b3dde) #2 0x000062eb453f3cc8 SignalHandler(int) Signals.cpp:0:0 #3 0x0000747348ca8520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) #4 0x0000747348cfc9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc) #5 0x0000747348ca8476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476) #6 0x0000747348c8e7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3) #7 0x0000747348c8e71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b) #8 0x0000747348c9fe96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96) #9 0x000062eb4829ec89 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<(anonymous namespace)::TestWrittenToPass::runOnOperation()::'lambda'(mlir::Operation*)>(long, mlir::Operation*) TestSparseBackwardDataFlowAnalysis.cpp:0:0 #10 0x000062eb455070ae void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11ca0ae) #11 0x000062eb455070ae void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11ca0ae) #12 0x000062eb4829c67c (anonymous namespace)::TestWrittenToPass::runOnOperation() TestSparseBackwardDataFlowAnalysis.cpp:0:0 #13 0x000062eb487e964f mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x44ac64f) #14 0x000062eb487e9dd2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x44acdd2) #15 0x000062eb487ec55e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x44af55e) #16 0x000062eb487e50ab performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0 #17 0x000062eb487e4d03 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 0x000062eb4888e465 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 0x000062eb487de962 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x44a1962) #20 0x000062eb487dec13 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a1c13) #21 0x000062eb487dee22 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x44a1e22) #22 0x000062eb453d24d7 main (./mlir-opt+0x10954d7) #23 0x0000747348c8fd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90) #24 0x0000747348c8fe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40) #25 0x000062eb453d2045 _start (./mlir-opt+0x1095045) Aborted (core dumped) ```

@EugeneZelenko EugeneZelenko added the crash Prefer [crash-on-valid] or [crash-on-invalid] label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] mlir
Projects
None yet
Development

No branches or pull requests

3 participants