mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 17:06:07 +00:00

In D130807 we added the `skipprofile` attribute. This commit changes the format so we can either `forbid` or `skip` profiling functions by adding the `noprofile` or `skipprofile` attributes, respectively. The behavior of the original format remains unchanged. Also, add the `skipprofile` attribute when using `-fprofile-function-groups`. This was originally landed as https://reviews.llvm.org/D130808 but was reverted due to a Windows test failure. Differential Revision: https://reviews.llvm.org/D131195
25 lines
984 B
C
25 lines
984 B
C
// RUN: %clang -fprofile-generate -fprofile-function-groups=3 -fprofile-selected-function-group=0 -emit-llvm -S %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}" --check-prefixes=CHECK,SELECT0
|
|
// RUN: %clang -fprofile-generate -fprofile-function-groups=3 -fprofile-selected-function-group=1 -emit-llvm -S %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}" --check-prefixes=CHECK,SELECT1
|
|
// RUN: %clang -fprofile-generate -fprofile-function-groups=3 -fprofile-selected-function-group=2 -emit-llvm -S %s -o - | FileCheck %s --implicit-check-not="; {{.* (noprofile|skipprofile)}}" --check-prefixes=CHECK,SELECT2
|
|
|
|
// Group 0
|
|
|
|
// SELECT1: skipprofile
|
|
// SELECT2: skipprofile
|
|
// CHECK: define {{.*}} @hoo()
|
|
void hoo() {}
|
|
|
|
// Group 1
|
|
// SELECT0: skipprofile
|
|
|
|
// SELECT2: skipprofile
|
|
// CHECK: define {{.*}} @goo()
|
|
void goo() {}
|
|
|
|
// Group 2
|
|
// SELECT0: skipprofile
|
|
// SELECT1: skipprofile
|
|
|
|
// CHECK: define {{.*}} @boo()
|
|
void boo() {}
|