aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2021-04-10 11:59:04 -0700
committerArthur Eubanks <aeubanks@google.com>2021-04-12 10:54:22 -0700
commit269b335bd7332cd0d13451260d408dc9fcbcb5b1 (patch)
tree0816eef7b5a03279705611dcc0f5d3b03e0c1a59 /llvm/lib/Analysis/InlineCost.cpp
parent0a92aff721f43406691e38a0965fd0c917121d09 (diff)
downloadllvm-269b335bd7332cd0d13451260d408dc9fcbcb5b1.zip
llvm-269b335bd7332cd0d13451260d408dc9fcbcb5b1.tar.gz
llvm-269b335bd7332cd0d13451260d408dc9fcbcb5b1.tar.bz2
[Inliner] Propagate SROA analysis through invariant group intrinsics
SROA can handle invariant group intrinsics, let the inliner know that for better heuristics when the intrinsics are present. This fixes size issues in a couple files when turning on -fstrict-vtable-pointers in Chrome. Reviewed By: rnk, mtrofin Differential Revision: https://reviews.llvm.org/D100249
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 06cc778..b367efa 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1884,6 +1884,11 @@ bool CallAnalyzer::visitCallBase(CallBase &Call) {
case Intrinsic::vastart:
InitsVargArgs = true;
return false;
+ case Intrinsic::launder_invariant_group:
+ case Intrinsic::strip_invariant_group:
+ if (auto *SROAArg = getSROAArgForValueOrNull(II->getOperand(0)))
+ SROAArgValues[II] = SROAArg;
+ return true;
}
}