File: instrprof_burst_sampling_full.ll

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (45 lines) | stat: -rw-r--r-- 1,953 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s --passes=instrprof -sampled-instrumentation --sampled-instr-period=1009 --sampled-instr-burst-duration=32 -S | FileCheck %s

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

$__llvm_profile_raw_version = comdat any

@__llvm_profile_raw_version = constant i64 72057594037927940, comdat
@__profn_f = private constant [1 x i8] c"f"

define void @f() {
; CHECK-LABEL: define void @f() {
; CHECK-NEXT:  [[ENTRY:.*:]]
; CHECK-NEXT:    [[TMP0:%.*]] = load i16, ptr @__llvm_profile_sampling, align 2
; CHECK-NEXT:    [[TMP1:%.*]] = icmp ule i16 [[TMP0]], 32
; CHECK-NEXT:    br i1 [[TMP1]], label %[[BB2:.*]], label %[[BB4:.*]], !prof [[PROF0:![0-9]+]]
; CHECK:       [[BB2]]:
; CHECK-NEXT:    [[PGOCOUNT:%.*]] = load i64, ptr @__profc_f, align 8
; CHECK-NEXT:    [[TMP3:%.*]] = add i64 [[PGOCOUNT]], 1
; CHECK-NEXT:    store i64 [[TMP3]], ptr @__profc_f, align 8
; CHECK-NEXT:    br label %[[BB4]]
; CHECK:       [[BB4]]:
; CHECK-NEXT:    [[TMP5:%.*]] = add i16 [[TMP0]], 1
; CHECK-NEXT:    [[TMP6:%.*]] = icmp uge i16 [[TMP5]], 1009
; CHECK-NEXT:    br i1 [[TMP6]], label %[[BB7:.*]], label %[[BB8:.*]], !prof [[PROF1:![0-9]+]]
; CHECK:       [[BB7]]:
; CHECK-NEXT:    store i16 0, ptr @__llvm_profile_sampling, align 2
; CHECK-NEXT:    br label %[[BB9:.*]]
; CHECK:       [[BB8]]:
; CHECK-NEXT:    store i16 [[TMP5]], ptr @__llvm_profile_sampling, align 2
; CHECK-NEXT:    br label %[[BB9]]
; CHECK:       [[BB9]]:
; CHECK-NEXT:    ret void
;
entry:
  call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_f, i32 0, i32 0), i64 12884901887, i32 1, i32 0)
  ret void
}

declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
;.
; CHECK: [[PROF0]] = !{!"branch_weights", i32 32, i32 978}
; CHECK: [[PROF1]] = !{!"branch_weights", i32 1, i32 1009}
;.