// is needed to track stack usage during inlining.
Type *Ty = I.getAllocatedType();
AllocatedSize = SaturatingMultiplyAdd(
- AllocSize->getLimitedValue(), DL.getTypeAllocSize(Ty).getFixedSize(),
+ AllocSize->getLimitedValue(), DL.getTypeAllocSize(Ty).getKnownMinSize(),
AllocatedSize);
if (AllocatedSize > InlineConstants::MaxSimplifiedDynamicAllocaToInline) {
HasDynamicAlloca = true;
if (I.isStaticAlloca()) {
Type *Ty = I.getAllocatedType();
AllocatedSize =
- SaturatingAdd(DL.getTypeAllocSize(Ty).getFixedSize(), AllocatedSize);
+ SaturatingAdd(DL.getTypeAllocSize(Ty).getKnownMinSize(), AllocatedSize);
}
// We will happily inline static alloca instructions.
--- /dev/null
+; RUN: opt -S -inline < %s | FileCheck %s
+
+define void @func() {
+; CHECK-LABEL: func
+; CHECK-NEXT: [[VEC_ADDR:%.*]] = alloca <vscale x 4 x i32>
+; CHECK-NEXT: call void @func()
+; CHECK-NEXT: ret void
+ %vec.addr = alloca <vscale x 4 x i32>
+ call void @func();
+ ret void
+}