mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
Summary: Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in pro file, thus we do not want to inline hot callsites in the first phase. Reviewers: tejohnson, eraman Reviewed By: tejohnson Subscribers: mehdi_amini, cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D31202 llvm-svn: 298429
20 lines
605 B
C
20 lines
605 B
C
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=INLINE
|
|
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -flto=thin -o - 2>&1 | FileCheck %s -check-prefix=NOINLINE
|
|
// Checks if hot call is inlined by normal compile, but not inlined by
|
|
// thinlto compile.
|
|
|
|
int baz(int);
|
|
int g;
|
|
|
|
void foo(int n) {
|
|
for (int i = 0; i < n; i++)
|
|
g += baz(i);
|
|
}
|
|
|
|
// INLINE-NOT: call{{.*}}foo
|
|
// NOINLINE: call{{.*}}foo
|
|
void bar(int n) {
|
|
for (int i = 0; i < n; i++)
|
|
foo(i);
|
|
}
|