brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 2369630 Raw
45 lines · plain
1;; Check that static counters are allocated for value profiler2 3; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -vp-static-alloc=true -passes=instrprof -S | FileCheck %s --check-prefix=STATIC4; RUN: opt < %s -mtriple=powerpc-ibm-aix-xcoff -passes=instrprof -vp-static-alloc=false -S | FileCheck %s --check-prefix=DYN5; RUN: opt < %s -mtriple=powerpc64-ibm-aix-xcoff -passes=instrprof -vp-static-alloc=false -S | FileCheck %s --check-prefix=DYN6 7@__profn_foo = private constant [3 x i8] c"foo"8@__profn_bar = private constant [3 x i8] c"bar"9 10define i32 @foo(ptr ) {11  call void @llvm.instrprof.increment(ptr @__profn_foo, i64 12884901887, i32 1, i32 0)12  %2 = ptrtoint ptr %0 to i6413  call void @llvm.instrprof.value.profile(ptr @__profn_foo, i64 12884901887, i64 %2, i32 0, i32 0)14  %3 = tail call i32 %0()15  ret i32 %316}17 18; Function Attrs: nounwind19declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #020 21; Function Attrs: nounwind22declare void @llvm.instrprof.value.profile(ptr, i64, i64, i32, i32) #023 24attributes #0 = { nounwind }25 26; STATIC: @__profvp_foo = private global [1 x i64] zeroinitializer, section "{{[^"]+}}"27; STATIC: @__llvm_prf_vnodes28 29; DYN-NOT: @__profvp_foo30; DYN-NOT: @__llvm_prf_vnodes31 32;; __llvm_prf_vnodes and __llvm_prf_nm are not referenced by other metadata sections.33;; We have to conservatively place them in llvm.used.34; STATIC:      @llvm.used = appending global35; STATIC-SAME:   @__llvm_prf_vnodes36; STATIC-SAME:   @__llvm_prf_nm37 38; STATIC: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 0)39; STATIC-EXT: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 zeroext 0)40; STATIC-SEXT: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 signext 0)41 42; STATIC: declare void @__llvm_profile_instrument_target(i64, ptr, i32)43; STATIC-EXT: declare void @__llvm_profile_instrument_target(i64, ptr, i32 zeroext)44; STATIC-SEXT: declare void @__llvm_profile_instrument_target(i64, ptr, i32 signext)45