Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / lto-newpm-pipeline.c
blobf58757efbf686f2987edb74f35aff55ca5f13c79
1 // REQUIRES: x86-registered-target
3 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=full -O0 %s 2>&1 | FileCheck %s \
4 // RUN: -check-prefix=CHECK-FULL-O0
5 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=thin -O0 %s 2>&1 | FileCheck %s \
6 // RUN: -check-prefix=CHECK-THIN-O0
7 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=full -O1 %s 2>&1 | FileCheck %s \
8 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
9 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=thin -O1 %s 2>&1 | FileCheck %s \
10 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
11 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=full -O2 %s 2>&1 | FileCheck %s \
12 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
13 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=thin -O2 %s 2>&1 | FileCheck %s \
14 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
15 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=full -O3 %s 2>&1 | FileCheck %s \
16 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
17 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=thin -O3 %s 2>&1 | FileCheck %s \
18 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
19 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=full -Os %s 2>&1 | FileCheck %s \
20 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
21 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=thin -Os %s 2>&1 | FileCheck %s \
22 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
23 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=full -Oz %s 2>&1 | FileCheck %s \
24 // RUN: -check-prefix=CHECK-FULL-OPTIMIZED
25 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -o /dev/null -mllvm -verify-analysis-invalidation=0 -fdebug-pass-manager -flto=thin -Oz %s 2>&1 | FileCheck %s \
26 // RUN: -check-prefix=CHECK-THIN-OPTIMIZED
28 // CHECK-FULL-O0: Running pass: VerifierPass
29 // CHECK-FULL-O0-NEXT: Running analysis: VerifierAnalysis
30 // CHECK-FULL-O0-NEXT: Running pass: AlwaysInlinerPass
31 // CHECK-FULL-O0-NEXT: Running analysis: InnerAnalysisManagerProxy
32 // CHECK-FULL-O0-NEXT: Running analysis: ProfileSummaryAnalysis
33 // CHECK-FULL-O0-NEXT: Running pass: CoroConditionalWrapper
34 // CHECK-FULL-O0-NEXT: Running pass: CanonicalizeAliasesPass
35 // CHECK-FULL-O0-NEXT: Running pass: NameAnonGlobalPass
36 // CHECK-FULL-O0-NEXT: Running pass: AnnotationRemarksPass
37 // CHECK-FULL-O0-NEXT: Running analysis: TargetLibraryAnalysis
38 // CHECK-FULL-O0-NEXT: Running pass: VerifierPass
39 // CHECK-FULL-O0-NEXT: Running pass: BitcodeWriterPass
41 // CHECK-THIN-O0: Running pass: VerifierPass
42 // CHECK-THIN-O0-NEXT: Running analysis: VerifierAnalysis
43 // CHECK-THIN-O0-NEXT: Running pass: AlwaysInlinerPass
44 // CHECK-THIN-O0-NEXT: Running analysis: InnerAnalysisManagerProxy
45 // CHECK-THIN-O0-NEXT: Running analysis: ProfileSummaryAnalysis
46 // CHECK-THIN-O0-NEXT: Running pass: CoroConditionalWrapper
47 // CHECK-THIN-O0-NEXT: Running pass: CanonicalizeAliasesPass
48 // CHECK-THIN-O0-NEXT: Running pass: NameAnonGlobalPass
49 // CHECK-THIN-O0-NEXT: Running pass: AnnotationRemarksPass
50 // CHECK-THIN-O0-NEXT: Running analysis: TargetLibraryAnalysis
51 // CHECK-THIN-O0-NEXT: Running pass: VerifierPass
52 // CHECK-THIN-O0-NEXT: Running pass: ThinLTOBitcodeWriterPass
54 // TODO: The LTO pre-link pipeline currently invokes
55 // buildPerModuleDefaultPipeline(), which contains LoopVectorizePass.
56 // This may change as the pipeline gets implemented.
57 // CHECK-FULL-OPTIMIZED: Running pass: LoopVectorizePass
58 // CHECK-FULL-OPTIMIZED: Running pass: BitcodeWriterPass
60 // The ThinLTO pre-link pipeline shouldn't contain passes like
61 // LoopVectorizePass.
62 // CHECK-THIN-OPTIMIZED-NOT: Running pass: LoopVectorizePass
63 // CHECK-THIN-OPTIMIZED: Running pass: CanonicalizeAliasesPass
64 // CHECK-THIN-OPTIMIZED: Running pass: NameAnonGlobalPass
65 // CHECK-THIN-OPTIMIZED: Running pass: ThinLTOBitcodeWriterPass
67 void Foo(void) {}