llvm.org GIT mirror llvm / 303105c
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363287 91177308-0d34-0410-b5e6-96231b3b80d8 Leonard Chan 4 months ago
1 changed file(s) with 11 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
3030
3131 #define DEBUG_TYPE "inline"
3232
33 PreservedAnalyses AlwaysInlinerPass::run(Module &M, ModuleAnalysisManager &) {
34 InlineFunctionInfo IFI;
33 PreservedAnalyses AlwaysInlinerPass::run(Module &M,
34 ModuleAnalysisManager &MAM) {
35 // Add inline assumptions during code generation.
36 FunctionAnalysisManager &FAM =
37 MAM.getResult(M).getManager();
38 std::function GetAssumptionCache =
39 [&](Function &F) -> AssumptionCache & {
40 return FAM.getResult(F);
41 };
42 InlineFunctionInfo IFI(/*cg=*/nullptr, &GetAssumptionCache);
43
3544 SmallSetVector Calls;
3645 bool Changed = false;
3746 SmallVector InlinedFunctions;