30 lines · c
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=SAMPLEPGO2// 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=THINLTO3 4int baz(int);5int g;6 7void foo(int n) {8 for (int i = 0; i < n; i++)9 g += baz(i);10}11 12// Checks that loop unroll and icp are invoked by normal compile, but not thinlto compile.13 14// SAMPLEPGO: Running pass: PGOIndirectCallPromotion on [module]15// SAMPLEPGO: Running pass: LoopUnrollPass on bar16 17// THINLTO-NOT: Running pass: PGOIndirectCallPromotion on [module]18// THINLTO-NOT: Running pass: LoopUnrollPass on bar19 20// Checks if hot call is inlined by normal compile, but not inlined by21// thinlto compile.22// SAMPLEPGO-LABEL: define {{(dso_local )?}}void @bar23// THINLTO-LABEL: define {{(dso_local )?}}void @bar24// SAMPLEPGO-NOT: call{{.*}}foo25// THINLTO: call{{.*}}foo26void bar(int n) {27 for (int i = 0; i < n; i++)28 foo(i);29}30