[PATCH] D63170: [clang][NewPM] Fix broken -O0 test from missing assumptions
Leonard Chan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 13 11:18:09 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL363287: [clang][NewPM] Fix broken -O0 test from missing assumptions (authored by leonardchan, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D63170?vs=204174&id=204590#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63170/new/
https://reviews.llvm.org/D63170
Files:
cfe/trunk/test/CodeGen/builtin-movdir.c
cfe/trunk/test/CodeGen/lto-newpm-pipeline.c
llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp
Index: llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp
+++ llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp
@@ -31,8 +31,17 @@
#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;
Index: cfe/trunk/test/CodeGen/builtin-movdir.c
===================================================================
--- cfe/trunk/test/CodeGen/builtin-movdir.c
+++ cfe/trunk/test/CodeGen/builtin-movdir.c
@@ -1,5 +1,7 @@
-// RUN: %clang_cc1 -ffreestanding -Wall -pedantic -triple x86_64-unknown-unknown -target-feature +movdiri -target-feature +movdir64b %s -emit-llvm -o - | FileCheck %s --check-prefix=X86_64 --check-prefix=CHECK
-// RUN: %clang_cc1 -ffreestanding -Wall -pedantic -triple i386-unknown-unknown -target-feature +movdiri -target-feature +movdir64b %s -emit-llvm -o - | FileCheck %s --check-prefix=X86 --check-prefix=CHECK
+// RUN: %clang_cc1 -ffreestanding -Wall -pedantic -fno-experimental-new-pass-manager -triple x86_64-unknown-unknown -target-feature +movdiri -target-feature +movdir64b %s -emit-llvm -o - | FileCheck %s --check-prefix=X86_64 --check-prefix=CHECK
+// RUN: %clang_cc1 -ffreestanding -Wall -pedantic -fno-experimental-new-pass-manager -triple i386-unknown-unknown -target-feature +movdiri -target-feature +movdir64b %s -emit-llvm -o - | FileCheck %s --check-prefix=X86 --check-prefix=CHECK
+// RUN: %clang_cc1 -ffreestanding -Wall -pedantic -fexperimental-new-pass-manager -triple x86_64-unknown-unknown -target-feature +movdiri -target-feature +movdir64b %s -emit-llvm -o - | FileCheck %s --check-prefix=X86_64 --check-prefix=CHECK
+// RUN: %clang_cc1 -ffreestanding -Wall -pedantic -fexperimental-new-pass-manager -triple i386-unknown-unknown -target-feature +movdiri -target-feature +movdir64b %s -emit-llvm -o - | FileCheck %s --check-prefix=X86 --check-prefix=CHECK
#include <immintrin.h>
#include <stdint.h>
Index: cfe/trunk/test/CodeGen/lto-newpm-pipeline.c
===================================================================
--- cfe/trunk/test/CodeGen/lto-newpm-pipeline.c
+++ cfe/trunk/test/CodeGen/lto-newpm-pipeline.c
@@ -27,6 +27,7 @@
// CHECK-FULL-O0: Starting llvm::Module pass manager run.
// CHECK-FULL-O0: Running pass: AlwaysInlinerPass
+// CHECK-FULL-O0-NEXT: Running analysis: InnerAnalysisManagerProxy
// CHECK-FULL-O0-NEXT: Running pass: CanonicalizeAliasesPass
// CHECK-FULL-O0-NEXT: Running pass: NameAnonGlobalPass
// CHECK-FULL-O0-NEXT: Running pass: BitcodeWriterPass
@@ -34,6 +35,7 @@
// CHECK-THIN-O0: Starting llvm::Module pass manager run.
// CHECK-THIN-O0: Running pass: AlwaysInlinerPass
+// CHECK-THIN-O0-NEXT: Running analysis: InnerAnalysisManagerProxy
// CHECK-THIN-O0-NEXT: Running pass: CanonicalizeAliasesPass
// CHECK-THIN-O0-NEXT: Running pass: NameAnonGlobalPass
// CHECK-THIN-O0-NEXT: Running pass: ThinLTOBitcodeWriterPass
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63170.204590.patch
Type: text/x-patch
Size: 3642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190613/18a359d9/attachment.bin>
More information about the cfe-commits
mailing list