Issue 107806
Summary [mlir] [memref] -promote-buffers-to-stack crashes
Labels mlir
Assignees
Reporter axeabc
    git version: 0f5033053a3d4

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -promote-buffers-to-stack a.mlir`

a.mlir:
``` 
func.func @multi_slot_alloca_only_second() {
  %0 = memref.alloc(): memref<2 x memref<4 x f32>>
  return
}
``` 
stack trace:

``` 
LLVM ERROR: neither the scoping op nor the type class provide data layout information for memref<4xf32>
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -promote-buffers-to-stack a.mlir
 #0 0x000055f25cc25ff8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10d3ff8)
 #1 0x000055f25cc23b0e llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10d1b0e)
 #2 0x000055f25cc2698d SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fa84a490420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007fa849acd00b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007fa849aac859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
 #6 0x000055f25cc45c97 llvm::report_fatal_error(llvm::Twine const&, bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10f3c97)
 #7 0x000055f262802c34 (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x6cb0c34)
 #8 0x000055f26280260f mlir::detail::getDefaultTypeSizeInBits(mlir::Type, mlir::DataLayout const&, llvm::ArrayRef<mlir::DataLayoutEntryInterface>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x6cb060f)
 #9 0x000055f262807a18 llvm::TypeSize llvm::function_ref<llvm::TypeSize (mlir::Type)>::callback_fn<mlir::DataLayout::getTypeSizeInBits(mlir::Type) const::$_0>(long, mlir::Type) DataLayoutInterfaces.cpp:0:0
#10 0x000055f262804642 llvm::TypeSize cachedLookup<llvm::TypeSize>(mlir::Type, llvm::DenseMap<mlir::Type, llvm::TypeSize, llvm::DenseMapInfo<mlir::Type, void>, llvm::detail::DenseMapPair<mlir::Type, llvm::TypeSize>>&, llvm::function_ref<llvm::TypeSize (mlir::Type)>) DataLayoutInterfaces.cpp:0:0
#11 0x000055f262802a5c mlir::DataLayout::getTypeSizeInBits(mlir::Type) const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x6cb0a5c)
#12 0x000055f25d167ef3 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
#13 0x000055f25d16741e (anonymous namespace)::PromoteBuffersToStackPass::runOnOperation() BufferOptimizations.cpp:0:0
#14 0x000055f25fd12e26 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c0e26)
#15 0x000055f25fd13790 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c1790)
#16 0x000055f25fd18b4e mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const Pass.cpp:0:0
#17 0x000055f25fd14e6b mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c2e6b)
#18 0x000055f25fd12f78 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c0f78)
#19 0x000055f25fd13790 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c1790)
#20 0x000055f25fd15dd2 mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41c3dd2)
#21 0x000055f25fd0e601 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#22 0x000055f25fd0e25b 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
#23 0x000055f25fdbaef5 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) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x4268ef5)
#24 0x000055f25fd09685 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41b7685)
#25 0x000055f25fd0992f mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41b792f)
#26 0x000055f25fd09c5e mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x41b7c5e)
#27 0x000055f25cc06c37 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10b4c37)
#28 0x00007fa849aae083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#29 0x000055f25cc067be _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x10b47be)
``` 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to