Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / pgo-sample-thinlto-summary.c
blob23233c8f44f5ca7c5d6f5c3e5c64a5286767fb08
1 // RUN: %clang_cc1 -fdebug-pass-manager -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=SAMPLEPGO
2 // RUN: %clang_cc1 -fdebug-pass-manager -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -flto=thin -o - 2>&1 | FileCheck %s -check-prefix=THINLTO
4 int baz(int);
5 int g;
7 void foo(int n) {
8 for (int i = 0; i < n; i++)
9 g += baz(i);
12 // Checks that loop unroll and icp are invoked by normal compile, but not thinlto compile.
14 // SAMPLEPGO: Running pass: PGOIndirectCallPromotion on [module]
15 // SAMPLEPGO: Running pass: LoopUnrollPass on bar
17 // THINLTO-NOT: Running pass: PGOIndirectCallPromotion on [module]
18 // THINLTO-NOT: Running pass: LoopUnrollPass on bar
20 // Checks if hot call is inlined by normal compile, but not inlined by
21 // thinlto compile.
22 // SAMPLEPGO-LABEL: define {{(dso_local )?}}void @bar
23 // THINLTO-LABEL: define {{(dso_local )?}}void @bar
24 // SAMPLEPGO-NOT: call{{.*}}foo
25 // THINLTO: call{{.*}}foo
26 void bar(int n) {
27 for (int i = 0; i < n; i++)
28 foo(i);