1
- ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1
+ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
2
2
; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -switch-range-to-icmp < %s | FileCheck %s
3
3
; RUN: opt -S -data-layout="p:32:32-p1:16:16" -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -switch-range-to-icmp < %s | FileCheck -check-prefix=CHECK -check-prefix=DL %s
4
4
5
5
declare void @foo1 ()
6
6
7
7
declare void @foo2 ()
8
8
9
- define void @test1 (i32 %V ) {
9
+ define void @test1 (i32 %V ) !prof !0 {
10
10
; CHECK-LABEL: @test1(
11
11
; CHECK-NEXT: switch i32 [[V:%.*]], label [[F:%.*]] [
12
12
; CHECK-NEXT: i32 17, label [[T:%.*]]
13
13
; CHECK-NEXT: i32 4, label [[T]]
14
- ; CHECK-NEXT: ]
14
+ ; CHECK-NEXT: ], !prof [[PROF1:![0-9]+]]
15
15
; CHECK: common.ret:
16
16
; CHECK-NEXT: ret void
17
17
; CHECK: T:
@@ -24,7 +24,7 @@ define void @test1(i32 %V) {
24
24
%C1 = icmp eq i32 %V , 4 ; <i1> [#uses=1]
25
25
%C2 = icmp eq i32 %V , 17 ; <i1> [#uses=1]
26
26
%CN = or i1 %C1 , %C2 ; <i1> [#uses=1]
27
- br i1 %CN , label %T , label %F
27
+ br i1 %CN , label %T , label %F , !prof !1
28
28
T: ; preds = %0
29
29
call void @foo1 ( )
30
30
ret void
@@ -116,12 +116,12 @@ F: ; preds = %0
116
116
ret void
117
117
}
118
118
119
- define void @test2 (i32 %V ) {
119
+ define void @test2 (i32 %V ) !prof !0 {
120
120
; CHECK-LABEL: @test2(
121
121
; CHECK-NEXT: switch i32 [[V:%.*]], label [[T:%.*]] [
122
122
; CHECK-NEXT: i32 17, label [[F:%.*]]
123
123
; CHECK-NEXT: i32 4, label [[F]]
124
- ; CHECK-NEXT: ]
124
+ ; CHECK-NEXT: ], !prof [[PROF2:![0-9]+]]
125
125
; CHECK: common.ret:
126
126
; CHECK-NEXT: ret void
127
127
; CHECK: T:
@@ -134,7 +134,7 @@ define void @test2(i32 %V) {
134
134
%C1 = icmp ne i32 %V , 4 ; <i1> [#uses=1]
135
135
%C2 = icmp ne i32 %V , 17 ; <i1> [#uses=1]
136
136
%CN = and i1 %C1 , %C2 ; <i1> [#uses=1]
137
- br i1 %CN , label %T , label %F
137
+ br i1 %CN , label %T , label %F , !prof !1
138
138
T: ; preds = %0
139
139
call void @foo1 ( )
140
140
ret void
@@ -1313,3 +1313,16 @@ if.then:
1313
1313
if.end:
1314
1314
ret void
1315
1315
}
1316
+
1317
+ !0 = !{!"function_entry_count" , i32 100 }
1318
+ !1 = !{!"branch_weights" , i32 6 , i32 10 }
1319
+ ;.
1320
+ ; DL: attributes #[[ATTR0:[0-9]+]] = { noredzone nounwind ssp }
1321
+ ; DL: attributes #[[ATTR1:[0-9]+]] = { nounwind }
1322
+ ; DL: attributes #[[ATTR2]] = { noredzone nounwind }
1323
+ ; DL: attributes #[[ATTR3]] = { noredzone }
1324
+ ;.
1325
+ ; DL: [[META0:![0-9]+]] = !{!"function_entry_count", i32 100}
1326
+ ; DL: [[PROF1]] = !{!"branch_weights", i32 10, i32 3, i32 3}
1327
+ ; DL: [[PROF2]] = !{!"branch_weights", i32 6, i32 5, i32 5}
1328
+ ;.
0 commit comments