summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorLeonard Chan <leonardchan@google.com>2019-06-13 18:18:40 +0000
committerLeonard Chan <leonardchan@google.com>2019-06-13 18:18:40 +0000
commit09f56b51ec8c72dce619b391e489f04e5d49211a (patch)
tree658220bc501bf89cfa1f5d0eaf4a39d4039bc049 /llvm/lib/Transforms/IPO
parent4d93fb528ec00da2d5157c858a49c9df8354cab6 (diff)
downloadbcm5719-llvm-09f56b51ec8c72dce619b391e489f04e5d49211a.tar.gz
bcm5719-llvm-09f56b51ec8c72dce619b391e489f04e5d49211a.zip
[clang][NewPM] Fix broken -O0 test from missing assumptions
Add an AssumptionCache callback to the InlineFuntionInfo used for the AlwaysInlinerPass to match codegen of the AlwaysInlinerLegacyPass to generate llvm.assume. This fixes CodeGen/builtin-movdir.c when new PM is enabled by default. Differential Revision: https://reviews.llvm.org/D63170 llvm-svn: 363287
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/AlwaysInliner.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/AlwaysInliner.cpp b/llvm/lib/Transforms/IPO/AlwaysInliner.cpp
index 0058bb9832a..c50805692b9 100644
--- a/llvm/lib/Transforms/IPO/AlwaysInliner.cpp
+++ b/llvm/lib/Transforms/IPO/AlwaysInliner.cpp
@@ -31,8 +31,17 @@ using namespace llvm;
#define DEBUG_TYPE "inline"
-PreservedAnalyses AlwaysInlinerPass::run(Module &M, ModuleAnalysisManager &) {
- InlineFunctionInfo IFI;
+PreservedAnalyses AlwaysInlinerPass::run(Module &M,
+ ModuleAnalysisManager &MAM) {
+ // Add inline assumptions during code generation.
+ FunctionAnalysisManager &FAM =
+ MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
+ std::function<AssumptionCache &(Function &)> GetAssumptionCache =
+ [&](Function &F) -> AssumptionCache & {
+ return FAM.getResult<AssumptionAnalysis>(F);
+ };
+ InlineFunctionInfo IFI(/*cg=*/nullptr, &GetAssumptionCache);
+
SmallSetVector<CallSite, 16> Calls;
bool Changed = false;
SmallVector<Function *, 16> InlinedFunctions;
OpenPOWER on IntegriCloud