Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/llvm-intrinsics/instrprof.ll

raw
1 ; RUN: llvm-as %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv
3 ; RUN: llvm-spirv %t.spv -to-text -o %t.spt
4 ; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
5 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.bc
6 ; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-LLVM
7
8 ; ModuleID = 'source.bc'
9 source_filename = "llvm-link"
10 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
11 target triple = "spir64-unknown-unknown"
12
13 $handler = comdat any
14
15 @__profn__ = weak_odr hidden constant [7 x i8] c"handler"
16
17 ; CHECK-SPIRV-NOT: llvm.instrprof.increment
18 ; CHECK-SPIRV-NOT: llvm.instrprof.increment.step
19 ; CHECK-SPIRV-NOT: llvm.instrprof.value.profile
20
21 ; CHECK-LLVM-NOT: call void @llvm.instrprof.increment
22 ; CHECK-LLVM-NOT: declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
23 ; CHECK-LLVM-NOT: call void @llvm.instrprof.increment.step
24 ; CHECK-LLVM-NOT: declare void @llvm.instrprof.increment.step(i8*, i64, i32, i32, i64)
25 ; CHECK-LLVM-NOT: call void @llvm.instrprof.value.profile
26 ; CHECK-LLVM-NOT: declare void @llvm.instrprof.value.profile(i8*, i64, i64, i32, i32)
27
28 ; Function Attrs: convergent mustprogress norecurse
29 define weak_odr dso_local spir_kernel void @handler() #0 comdat !kernel_arg_buffer_location !1 {
30 entry:
31 call void @llvm.instrprof.increment(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__profn__, i32 0, i32 0), i64 0, i32 1, i32 0)
32 call void @llvm.instrprof.increment.step(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__profn__, i32 0, i32 0), i64 0, i32 1, i32 0, i64 0)
33 call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__profn__, i32 0, i32 0), i64 0, i64 0, i32 1, i32 0)
34 ret void
35 }
36
37 ; Function Attrs: nounwind
38 declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #1
39
40 ; Function Attrs: nounwind
41 declare void @llvm.instrprof.increment.step(i8*, i64, i32, i32, i64) #1
42
43 ; Function Attrs: nounwind
44 declare void @llvm.instrprof.value.profile(i8*, i64, i64, i32, i32) #1
45
46 attributes #0 = { convergent mustprogress norecurse }
47 attributes #1 = { nounwind }
48
49 !1 = !{i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1}