| Issue |
202529
|
| Summary |
[MLIR] mlir-opt crashes with Assertion `num.has_value() && "integer overflow in element count computation"' failed
|
| Labels |
mlir
|
| Assignees |
|
| Reporter |
Aran-414
|
git version: d33b8093ce336b92d01f55033aed7021f5244eec
MLIR Program:
```
"builtin.module"() ({
"func.func"() <{function_type = (index, index, index) -> (), sym_name = "view"}> ({
^bb0(%arg49: index, %arg50: index, %arg51: index):
"func.return"() : () -> ()
}) : () -> ()
"func.func"() <{function_type = (memref<4x4xf16, strided<[?, ?], offset: ?>>) -> (), sym_name = "assume_alignment_w_offset"}> ({
^bb0(%arg35: memref<4x4xf16, strided<[?, ?], offset: ?>>):
%25 = "arith.constant"() <{value = 1 : index}> : () -> index
%26 = "memref.alloc"() <{operandSegmentSizes = array<i32: 0, 0>}> : () -> memref<2x3xi32>
"memref.alloca_scope"() ({
%27 = "memref.generic_atomic_rmw"(%26, %25, %25) ({
^bb0(%arg17: i32):
"memref.atomic_yield"(%arg17) : (i32) -> ()
}) : (memref<2x3xi32>, index, index) -> i32
"memref.alloca_scope.return"() : () -> ()
}) : () -> ()
"llvm.return"() : () -> ()
}) : () -> ()
"func.func"() <{function_type = () -> (), sym_name = "memref_copy_ranked"}> ({
%0 = "memref.alloca"() <{operandSegmentSizes = array<i32: 0, 0>}> : () -> memref<9223372036854775807x3xi32>
"func.return"() : () -> ()
}) : () -> ()
}) : () -> ()
```
Reproduce Command: `mlir-opt -sroa a.mlir`
StackTrace:
```
mlir-opt: /data2/dependency/dev/llvm-project/mlir/lib/IR/BuiltinTypeInterfaces.cpp:86: static int64_t mlir::ShapedType::getNumElements(llvm::ArrayRef<long int>): Assertion `num.has_value() && "integer overflow in element count computation"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: /data2/dependency/dev/llvm-project/build/bin/mlir-opt -sroa a.mlir
#0 0x000055ccff9e7bcf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25ccbcf)
#1 0x000055ccff9e429c llvm::sys::RunSignalHandlers() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25c929c)
#2 0x000055ccff9e4437 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007fe0557f1420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007fe0552dc00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007fe0552bb859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007fe0552bb729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#7 0x00007fe0552ccfd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#8 0x000055cd08a9d835 (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb682835)
#9 0x000055cd08379866 mlir::detail::DestructurableTypeInterfaceInterfaceTraits::FallbackModel<(anonymous namespace)::MemRefDestructurableTypeExternalModel>::getSubelementIndexMap(mlir::detail::DestructurableTypeInterfaceInterfaceTraits::Concept const*, mlir::Type) MemRefMemorySlot.cpp:0:0
#10 0x000055cd086895f9 mlir::DestructurableTypeInterface::getSubelementIndexMap() const (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb26e5f9)
#11 0x000055cd083787b2 mlir::memref::AllocaOp::getDestructurableSlots() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf5d7b2)
#12 0x000055cd0835d344 mlir::detail::DestructurableAllocationOpInterfaceInterfaceTraits::Model<mlir::memref::AllocaOp>::getDestructurableSlots(mlir::detail::DestructurableAllocationOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xaf42344)
#13 0x000055cd08689199 mlir::DestructurableAllocationOpInterface::getDestructurableSlots() (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb26e199)
#14 0x000055cd08665d6b mlir::tryToDestructureMemorySlots(llvm::ArrayRef<mlir::DestructurableAllocationOpInterface>, mlir::OpBuilder&, mlir::DataLayout const&, mlir::SROAStatistics) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb24ad6b)
#15 0x000055cd086689c2 (anonymous namespace)::SROA::runOnOperation() SROA.cpp:0:0
#16 0x000055cd0877bf01 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb360f01)
#17 0x000055cd0877c290 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb361290)
#18 0x000055cd0877e344 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb363344)
#19 0x000055cd0877f3d1 mlir::PassManager::run(mlir::Operation*) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb3643d1)
#20 0x000055ccffaaf3cb performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#21 0x000055ccffaafe73 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, mlir::SourceMgrDiagnosticVerifierHandler*, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#22 0x000055ccffab00fb llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, 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::MemoryBufferRef, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#23 0x000055cd08b5ae45 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::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0xb73fe45)
#24 0x000055ccffaa5f54 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (.part.0) MlirOptMain.cpp:0:0
#25 0x000055ccffab0617 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2695617)
#26 0x000055ccffab0853 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x2695853)
#27 0x000055ccff8e5adc main (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x24caadc)
#28 0x00007fe0552bd083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#29 0x000055ccff9c40ce _start (/data2/dependency/dev/llvm-project/build/bin/mlir-opt+0x25a90ce)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs