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=instcombine -S | FileCheck %s
3
3
4
4
declare i1 @gen1 ()
5
5
6
+ ;.
7
+ ; CHECK: @glb = global i8 0
8
+ ;.
6
9
define i1 @cond_eq_and (i8 %X , i8 %Y , i8 noundef %C ) {
7
10
; CHECK-LABEL: @cond_eq_and(
8
11
; CHECK-NEXT: [[COND:%.*]] = icmp eq i8 [[X:%.*]], [[C:%.*]]
@@ -16,16 +19,16 @@ define i1 @cond_eq_and(i8 %X, i8 %Y, i8 noundef %C) {
16
19
ret i1 %res
17
20
}
18
21
19
- define i1 @cond_eq_and_const (i8 %X , i8 %Y ) {
22
+ define i1 @cond_eq_and_const (i8 %X , i8 %Y ) !prof !0 {
20
23
; CHECK-LABEL: @cond_eq_and_const(
21
24
; CHECK-NEXT: [[COND:%.*]] = icmp eq i8 [[X:%.*]], 10
22
25
; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt i8 [[Y:%.*]], 10
23
- ; CHECK-NEXT: [[RES:%.*]] = select i1 [[COND]], i1 [[TMP1]], i1 false
26
+ ; CHECK-NEXT: [[RES:%.*]] = select i1 [[COND]], i1 [[TMP1]], i1 false, !prof [[PROF1:![0-9]+]]
24
27
; CHECK-NEXT: ret i1 [[RES]]
25
28
;
26
29
%cond = icmp eq i8 %X , 10
27
30
%lhs = icmp ult i8 %X , %Y
28
- %res = select i1 %cond , i1 %lhs , i1 false
31
+ %res = select i1 %cond , i1 %lhs , i1 false , !prof !1
29
32
ret i1 %res
30
33
}
31
34
@@ -42,16 +45,16 @@ define i1 @cond_eq_or(i8 %X, i8 %Y, i8 noundef %C) {
42
45
ret i1 %res
43
46
}
44
47
45
- define i1 @cond_eq_or_const (i8 %X , i8 %Y ) {
48
+ define i1 @cond_eq_or_const (i8 %X , i8 %Y ) !prof !0 {
46
49
; CHECK-LABEL: @cond_eq_or_const(
47
50
; CHECK-NEXT: [[COND:%.*]] = icmp ne i8 [[X:%.*]], 10
48
51
; CHECK-NEXT: [[TMP1:%.*]] = icmp ugt i8 [[Y:%.*]], 10
49
- ; CHECK-NEXT: [[RES:%.*]] = select i1 [[COND]], i1 true, i1 [[TMP1]]
52
+ ; CHECK-NEXT: [[RES:%.*]] = select i1 [[COND]], i1 true, i1 [[TMP1]], !prof [[PROF1]]
50
53
; CHECK-NEXT: ret i1 [[RES]]
51
54
;
52
55
%cond = icmp ne i8 %X , 10
53
56
%lhs = icmp ult i8 %X , %Y
54
- %res = select i1 %cond , i1 true , i1 %lhs
57
+ %res = select i1 %cond , i1 true , i1 %lhs , !prof !1
55
58
ret i1 %res
56
59
}
57
60
@@ -793,3 +796,10 @@ define <2 x i1> @not_logical_and2(i1 %b, <2 x i32> %a) {
793
796
%or = select <2 x i1 > %and , <2 x i1 > <i1 true , i1 true >, <2 x i1 > %implied
794
797
ret <2 x i1 > %or
795
798
}
799
+
800
+ !0 = !{!"function_entry_count" , i64 1000 }
801
+ !1 = !{!"branch_weights" , i32 2 , i32 3 }
802
+ ;.
803
+ ; CHECK: [[META0:![0-9]+]] = !{!"function_entry_count", i64 1000}
804
+ ; CHECK: [[PROF1]] = !{!"branch_weights", i32 2, i32 3}
805
+ ;.
0 commit comments