File: counter_promo_mexits.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (79 lines) | stat: -rw-r--r-- 3,302 bytes parent folder | download | duplicates (15)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
; RUN: opt < %s --passes=pgo-instr-gen,instrprof -do-counter-promotion=true -speculative-counter-promotion-max-exiting=3 -S | FileCheck --check-prefix=PROMO %s

@g = common local_unnamed_addr global i32 0, align 4

define void @foo(i32 %arg) local_unnamed_addr {
; PROMO-LABEL: @foo
bb:
  %tmp = add nsw i32 %arg, -1
  br label %bb1
bb1:                                              ; preds = %bb11, %bb
  %tmp2 = phi i32 [ 0, %bb ], [ %tmp12, %bb11 ]
  %tmp3 = icmp sgt i32 %tmp2, %arg
  br i1 %tmp3, label %bb7, label %bb4

bb4:                                              ; preds = %bb1
  tail call void @bar(i32 1)
  %tmp5 = load i32, ptr @g, align 4
  %tmp6 = icmp sgt i32 %tmp5, 100
  br i1 %tmp6, label %bb15_0, label %bb11

bb7:                                              ; preds = %bb1
  %tmp8 = icmp slt i32 %tmp2, %tmp
  br i1 %tmp8, label %bb9, label %bb10

bb9:                                              ; preds = %bb7
  tail call void @bar(i32 2)
  br label %bb11

bb10:                                             ; preds = %bb7
  tail call void @bar(i32 3)
  br label %bb11

bb11:                                             ; preds = %bb10, %bb9, %bb4
  %tmp12 = add nuw nsw i32 %tmp2, 1
  %tmp13 = icmp slt i32 %tmp2, 99
  br i1 %tmp13, label %bb1, label %bb14

bb14:                                             ; preds = %bb11
; PROMO-LABEL: bb14:
  tail call void @bar(i32 0)
  br label %bb15
; PROMO:  %pgocount.promoted{{.*}} = load i64, ptr @__profc_foo, align 4
; PROMO-NEXT: add 
; PROMO-NEXT: store i64 %3, ptr @__profc_foo, align 4
; PROMO-NEXT:  %pgocount.promoted{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 1), align 4
; PROMO-NEXT: add 
; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}1)
; PROMO-NEXT:  %pgocount.promoted{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 2), align 4
; PROMO-NEXT: add 
; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}2)
; PROMO-NEXT:  %pgocount{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 3), align 4
; PROMO-NEXT: add 
; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}3)


bb15_0:                                             ; preds = %bb11
; PROMO-LABEL: bb15_0:
  br label %bb15
; PROMO:  %pgocount.promoted{{.*}} = load i64, ptr @__profc_foo, align 4
; PROMO-NEXT: add 
; PROMO-NEXT: store {{.*}} @__profc_foo, align 4
; PROMO-NEXT:  %pgocount.promoted{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 1), align 4
; PROMO-NEXT: add 
; PROMO-NEXT: store {{.*}} ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 1), align 4
; PROMO-NEXT:  %pgocount.promoted{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 2), align 4
; PROMO-NEXT: add 
; PROMO-NEXT: store {{.*}} ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 2), align 4
; PROMO-NEXT:  %pgocount{{.*}} = load {{.*}} @__profc_foo{{.*}} 4)
; PROMO-NEXT: add 
; PROMO-NEXT: store {{.*}} ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 4), align 4
; PROMO-NOT: @__profc_foo{{.*}})


bb15:                                             ; preds = %bb14, %bb4
  tail call void @bar(i32 1)
  ret void
}

declare void @bar(i32) local_unnamed_addr