summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/SampleProfile.cpp
diff options
context:
space:
mode:
authorSean Silva <chisophugis@gmail.com>2016-07-23 04:22:50 +0000
committerSean Silva <chisophugis@gmail.com>2016-07-23 04:22:50 +0000
commitab6a6837651fa39124d41ec1484d360b47efa989 (patch)
treeff91117f0c5cc331b0d8a8ec7e64e7ebbbe7459e /llvm/lib/Transforms/IPO/SampleProfile.cpp
parentc6b9be29f270e6adc0922cb6e9be000f7102b663 (diff)
downloadbcm5719-llvm-ab6a6837651fa39124d41ec1484d360b47efa989.tar.gz
bcm5719-llvm-ab6a6837651fa39124d41ec1484d360b47efa989.zip
Avoid using a raw AssumptionCacheTracker in various inliner functions.
This unblocks the new PM part of River's patch in https://reviews.llvm.org/D22706 Conveniently, this same change was needed for D21921 and so these changes are just spun out from there. llvm-svn: 276515
Diffstat (limited to 'llvm/lib/Transforms/IPO/SampleProfile.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/SampleProfile.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp
index 39de108edc0..6a74a938691 100644
--- a/llvm/lib/Transforms/IPO/SampleProfile.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp
@@ -627,6 +627,8 @@ SampleProfileLoader::findFunctionSamples(const Instruction &Inst) const {
bool SampleProfileLoader::inlineHotFunctions(Function &F) {
bool Changed = false;
LLVMContext &Ctx = F.getContext();
+ std::function<AssumptionCache &(Function &)> GetAssumptionCache = [&](
+ Function &F) -> AssumptionCache & { return ACT->getAssumptionCache(F); };
while (true) {
bool LocalChanged = false;
SmallVector<CallInst *, 10> CIS;
@@ -638,7 +640,7 @@ bool SampleProfileLoader::inlineHotFunctions(Function &F) {
}
}
for (auto CI : CIS) {
- InlineFunctionInfo IFI(nullptr, ACT);
+ InlineFunctionInfo IFI(nullptr, ACT ? &GetAssumptionCache : nullptr);
Function *CalledFunction = CI->getCalledFunction();
DebugLoc DLoc = CI->getDebugLoc();
uint64_t NumSamples = findCalleeFunctionSamples(*CI)->getTotalSamples();
OpenPOWER on IntegriCloud