[Mlir-commits] [mlir] [mlir][bufferization] Fix integer overflow crash in promote-buffers-to-stack (PR #186276)
Matthias Springer
llvmlistbot at llvm.org
Fri Mar 13 03:53:05 PDT 2026
================
@@ -0,0 +1,14 @@
+// RUN: mlir-opt %s --promote-buffers-to-stack | FileCheck %s
+
+// Regression test for https://github.com/llvm/llvm-project/issues/64638.
+// A memref whose static element count overflows int64_t must not trigger an
+// assertion in ShapedType::getNumElements(). The allocation is too large to
+// promote to the stack, so it must remain as a heap allocation.
+
+// CHECK-LABEL: func @huge_static_memref
+// CHECK: memref.alloc
+// CHECK-NOT: memref.alloca
+func.func @huge_static_memref() {
----------------
matthias-springer wrote:
Can you move this to `mlir/test/Transforms/promote-buffers-to-stack.mlir`?
https://github.com/llvm/llvm-project/pull/186276
More information about the Mlir-commits
mailing list