aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorCullen Rhodes <cullen.rhodes@arm.com>2020-08-12 18:03:46 +0000
committerCullen Rhodes <cullen.rhodes@arm.com>2020-08-17 10:34:27 +0000
commit2ccde3c96b784f74370beff5dab5fbf3e70fae8b (patch)
tree28dd18a2fb92d93c29132bbc657f829e1ce6e417 /llvm/lib/Analysis/InlineCost.cpp
parent3b348d91028726f840868875dac3bcefcefda917 (diff)
downloadllvm-2ccde3c96b784f74370beff5dab5fbf3e70fae8b.zip
llvm-2ccde3c96b784f74370beff5dab5fbf3e70fae8b.tar.gz
llvm-2ccde3c96b784f74370beff5dab5fbf3e70fae8b.tar.bz2
[InlineCost] Fix scalable vectors in visitAlloca
Discovered as part of the VLS type work (see D85128). Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D85848
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 33d7144..0a2de5d4 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -867,7 +867,7 @@ bool CallAnalyzer::visitAlloca(AllocaInst &I) {
// 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;
@@ -881,7 +881,7 @@ bool CallAnalyzer::visitAlloca(AllocaInst &I) {
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.