Skip to content

[MLIR]'-promote-buffers-to-stack' triggers LLVM ERROR' neither the scoping op nor the type class provide data layout information for memref<1xf32>' #61375

@BealZephyr

Description

@BealZephyr

Test on commit: e0282cb
The same crash occurred in LLVM 16
steps to reproduce:

mlir-opt -promote-buffers-to-stack test.mlir

test case:

module attributes { dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<index, 32>> } {
  func.func @memref_of_memref_32() {
    %0 = memref.alloc() : memref<1xmemref<1xf32>>
    return
  }
}

crash trace:

LLVM ERROR: neither the scoping op nor the type class provide data layout information for memref<1xf32>
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/verify/llvm-project/build/bin/mlir-opt -promote-buffers-to-stack test.mlir
 #0 0x0000558f15ae105a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/verify/llvm-project/build/bin/mlir-opt+0x22205a)
 #1 0x0000558f15ade55c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f0c02368980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #3 0x00007f0c01460e87 raise /build/glibc-CVJwZb/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #4 0x00007f0c014627f1 abort /build/glibc-CVJwZb/glibc-2.27/stdlib/abort.c:81:0
 #5 0x0000558f15afac6d llvm::report_fatal_error(llvm::Twine const&, bool) (/home/verify/llvm-project/build/bin/mlir-opt+0x23bc6d)
 #6 0x0000558f1780e9e8 reportMissingDataLayout(mlir::Type) DataLayoutInterfaces.cpp:0:0
 #7 0x0000558f17813f7c (/home/verify/llvm-project/build/bin/mlir-opt+0x1f54f7c)
 #8 0x0000558f178141f5 cachedLookup(mlir::Type, llvm::DenseMap<mlir::Type, unsigned int, llvm::DenseMapInfo<mlir::Type, void>, llvm::detail::DenseMapPair<mlir::Type, unsigned int>>&, llvm::function_ref<unsigned int (mlir::Type)>) (.constprop.306) DataLayoutInterfaces.cpp:0:0
 #9 0x0000558f178144ab mlir::DataLayout::getTypeSizeInBits(mlir::Type) const (/home/verify/llvm-project/build/bin/mlir-opt+0x1f554ab)
#10 0x0000558f15dc10bd std::_Function_handler<bool (mlir::Value), (anonymous namespace)::PromoteBuffersToStackPass::initialize(mlir::MLIRContext*)::'lambda'(mlir::Value)>::_M_invoke(std::_Any_data const&, mlir::Value&&) BufferOptimizations.cpp:0:0
#11 0x0000558f15dbc20b (anonymous namespace)::PromoteBuffersToStackPass::runOnOperation() BufferOptimizations.cpp:0:0
#12 0x0000558f1739eea9 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/verify/llvm-project/build/bin/mlir-opt+0x1adfea9)
#13 0x0000558f1739f1ca mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/verify/llvm-project/build/bin/mlir-opt+0x1ae01ca)
#14 0x0000558f1739f548 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::'lambda'(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&)::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const Pass.cpp:0:0
#15 0x0000558f1739e685 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/home/verify/llvm-project/build/bin/mlir-opt+0x1adf685)
#16 0x0000558f1739ee1a mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/verify/llvm-project/build/bin/mlir-opt+0x1adfe1a)
#17 0x0000558f1739fd03 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (.constprop.495) Pass.cpp:0:0
#18 0x0000558f173a03ed mlir::PassManager::run(mlir::Operation*) (/home/verify/llvm-project/build/bin/mlir-opt+0x1ae13ed)
#19 0x0000558f173933f3 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#20 0x0000558f17393b29 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPool*) MlirOptMain.cpp:0:0
#21 0x0000558f17393e51 mlir::LogicalResult llvm::function_ref<mlir::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&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#22 0x0000558f17459c80 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/home/verify/llvm-project/build/bin/mlir-opt+0x1b9ac80)
#23 0x0000558f17390b33 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/verify/llvm-project/build/bin/mlir-opt+0x1ad1b33)
#24 0x0000558f17394238 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) (/home/verify/llvm-project/build/bin/mlir-opt+0x1ad5238)
#25 0x0000558f15aad470 main (/home/verify/llvm-project/build/bin/mlir-opt+0x1ee470)
#26 0x00007f0c01443c87 __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:344:0
#27 0x0000558f15ac010a _start (/home/verify/llvm-project/build/bin/mlir-opt+0x20110a)

Metadata

Metadata

Assignees

Labels

crashPrefer [crash-on-valid] or [crash-on-invalid]mlir

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions