CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
63 lines
1.6 KiB
C
63 lines
1.6 KiB
C
/*
|
|
RUN: rm -fr %t.profdir
|
|
RUN: %clang_profgen=%t.profdir/default_%m.profraw -o %t -O2 %s
|
|
RUN: %run %t 2>&1 | FileCheck %s --check-prefix=NO_EXIT_WRITE
|
|
RUN: llvm-profdata merge -o %t.profdata %t.profdir
|
|
RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s --check-prefix=PROF
|
|
|
|
NO_EXIT_WRITE: Profile data not written to file: already written
|
|
*/
|
|
|
|
int __llvm_profile_dump(void);
|
|
void __llvm_profile_reset_counters(void);
|
|
int foo(int);
|
|
int bar(int);
|
|
int skip(int);
|
|
|
|
int main(int argc, const char *argv[]) {
|
|
int Ret = foo(0); /* region 1 */
|
|
__llvm_profile_dump();
|
|
|
|
/* not profiled -- cleared later. */
|
|
skip(0); /* skipped region */
|
|
|
|
__llvm_profile_reset_counters();
|
|
Ret += bar(0); /* region 2 */
|
|
__llvm_profile_dump();
|
|
|
|
skip(1);
|
|
|
|
__llvm_profile_reset_counters();
|
|
/* foo's profile will be merged. */
|
|
foo(1); /* region 3 */
|
|
__llvm_profile_dump();
|
|
|
|
return Ret;
|
|
}
|
|
|
|
__attribute__((noinline)) int foo(int X) {
|
|
/* PROF: define {{.*}} @foo({{.*}}!prof ![[ENT:[0-9]+]]
|
|
PROF: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD1:[0-9]+]]
|
|
*/
|
|
return X <= 0 ? -X : X;
|
|
}
|
|
|
|
__attribute__((noinline)) int skip(int X) {
|
|
/* PROF: define {{.*}} @skip(
|
|
PROF: br i1 %{{.*}}, label %{{.*}}, label %{{[^,]+$}}
|
|
*/
|
|
return X <= 0 ? -X : X;
|
|
}
|
|
|
|
__attribute__((noinline)) int bar(int X) {
|
|
/* PROF-LABEL: define {{.*}} @bar(
|
|
PROF: br i1 %{{.*}}, label %{{.*}}, label %{{.*}}, !prof ![[PD2:[0-9]+]]
|
|
*/
|
|
return X <= 0 ? -X : X;
|
|
}
|
|
|
|
/*
|
|
PROF: ![[ENT]] = !{!"function_entry_count", i64 2}
|
|
PROF: ![[PD1]] = !{!"branch_weights", i32 2, i32 2}
|
|
*/
|