llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[mlir] Promote-Buffers-To-Stack Pass Segmentation Fault on nested memref

Open CelestineSmith opened this issue 3 years ago • 0 comments

MLIR built at commit https://github.com/llvm/llvm-project/commit/159cac50 Reproduced with:

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

temp.mlir:

func.func @func() { 
  %0 = memref.alloc() : memref<1 x memref<2 x f32>>
  return
} 

trace:

LLVM ERROR: neither the scoping op nor the type class provide data layout information for memref<2xmemref<3xf32>>
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 --promote-buffers-to-stack temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mlir-opt                 0x00000001049a85bc llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt                 0x00000001049a7624 llvm::sys::RunSignalHandlers() + 112
2  mlir-opt                 0x00000001049a8c54 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001a56894c4 _sigtramp + 56
4  libsystem_pthread.dylib  0x00000001a5671ee0 pthread_kill + 288
5  libsystem_c.dylib        0x00000001a55ac340 abort + 168
6  mlir-opt                 0x000000010496f1f4 llvm::report_fatal_error(llvm::Twine const&, bool) + 468
7  mlir-opt                 0x0000000105e7fbb8 mlir::detail::getDefaultABIAlignment(mlir::Type, mlir::DataLayout const&, llvm::ArrayRef<mlir::DataLayoutEntryInterface>) + 0
8  mlir-opt                 0x0000000105e7f704 mlir::detail::getDefaultPreferredAlignment(mlir::Type, mlir::DataLayout const&, llvm::ArrayRef<mlir::DataLayoutEntryInterface>) + 0
9  mlir-opt                 0x0000000105e829a4 unsigned int llvm::function_ref<unsigned int (mlir::Type)>::callback_fn<mlir::DataLayout::getTypeSizeInBits(mlir::Type) const::$_4>(long, mlir::Type) + 312
10 mlir-opt                 0x0000000105e81018 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)>) + 200
11 mlir-opt                 0x0000000105e7fa38 mlir::DataLayout::getTypeSizeInBits(mlir::Type) const + 56
12 mlir-opt                 0x0000000104b90c14 std::__1::__function::__func<(anonymous namespace)::PromoteBuffersToStackPass::initialize(mlir::MLIRContext*)::'lambda'(mlir::Value), std::__1::allocator<(anonymous namespace)::PromoteBuffersToStackPass::initialize(mlir::MLIRContext*)::'lambda'(mlir::Value)>, bool (mlir::Value)>::operator()(mlir::Value&&) + 320
13 mlir-opt                 0x0000000104b8f684 (anonymous namespace)::PromoteBuffersToStackPass::runOnOperation() + 200
14 mlir-opt                 0x0000000105bb34dc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 420
15 mlir-opt                 0x0000000105bb3a0c mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
16 mlir-opt                 0x0000000105bb7a90 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const + 176
17 mlir-opt                 0x0000000105bb790c mlir::LogicalResult mlir::failableParallelForEach<std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext*, std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) + 360
18 mlir-opt                 0x0000000105bb46d4 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) + 1396
19 mlir-opt                 0x0000000105bb360c mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 724
20 mlir-opt                 0x0000000105bb3a0c mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
21 mlir-opt                 0x0000000105bb5388 mlir::PassManager::run(mlir::Operation*) + 1148
22 mlir-opt                 0x0000000105bae840 performActions(llvm::raw_ostream&, bool, bool, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 504
23 mlir-opt                 0x0000000105bae410 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 704
24 mlir-opt                 0x0000000105c1902c mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) + 656
25 mlir-opt                 0x0000000105bac838 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) + 216
26 mlir-opt                 0x0000000105bacd2c mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
27 mlir-opt                 0x000000010484b0a0 main + 108
28 dyld                     0x0000000109165088 start + 516

CelestineSmith avatar Jan 17 '23 02:01 CelestineSmith