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
22; RUN: opt < %s -mtriple=x86_64-unknown-unknown -passes=mergeicmps -verify-dom-info -S | FileCheck %s --check-prefix=X86
33
44%S = type { i32 , i32 , i32 , i32 , i32 }
@@ -15,7 +15,7 @@ define zeroext i1 @opeq1(
1515; X86-NEXT: ret i1 [[TMP2]]
1616;
1717 ptr nocapture readonly dereferenceable (16 ) %a ,
18- ptr nocapture readonly dereferenceable (16 ) %b ) local_unnamed_addr nofree nosync {
18+ ptr nocapture readonly dereferenceable (16 ) %b ) local_unnamed_addr nofree nosync !prof !2 {
1919
2020entry:
2121 %ptr = alloca i32
@@ -24,23 +24,23 @@ entry:
2424 ; Does other work, has no interference, merge block
2525 store i32 42 , ptr %ptr
2626 %cmp.i = icmp eq i32 %0 , %1
27- br i1 %cmp.i , label %land.rhs.i , label %opeq1.exit
27+ br i1 %cmp.i , label %land.rhs.i , label %opeq1.exit , !prof !3
2828
2929land.rhs.i:
3030 %second.i = getelementptr inbounds %S , ptr %a , i64 0 , i32 1
3131 %2 = load i32 , ptr %second.i , align 4
3232 %second2.i = getelementptr inbounds %S , ptr %b , i64 0 , i32 1
3333 %3 = load i32 , ptr %second2.i , align 4
3434 %cmp2.i = icmp eq i32 %2 , %3
35- br i1 %cmp2.i , label %land.rhs.i.2 , label %opeq1.exit
35+ br i1 %cmp2.i , label %land.rhs.i.2 , label %opeq1.exit , !prof !4
3636
3737land.rhs.i.2 :
3838 %third.i = getelementptr inbounds %S , ptr %a , i64 0 , i32 2
3939 %4 = load i32 , ptr %third.i , align 4
4040 %third2.i = getelementptr inbounds %S , ptr %b , i64 0 , i32 2
4141 %5 = load i32 , ptr %third2.i , align 4
4242 %cmp3.i = icmp eq i32 %4 , %5
43- br i1 %cmp3.i , label %land.rhs.i.3 , label %opeq1.exit
43+ br i1 %cmp3.i , label %land.rhs.i.3 , label %opeq1.exit , !prof !5
4444
4545land.rhs.i.3 :
4646 %fourth.i = getelementptr inbounds %S , ptr %a , i64 0 , i32 3
@@ -55,15 +55,15 @@ opeq1.exit:
5555 ret i1 %8
5656}
5757
58- define zeroext i1 @part_sequent_eq_with_metadata () {
58+ define zeroext i1 @part_sequent_eq_with_metadata () !prof !2 {
5959; X86-LABEL: @part_sequent_eq_with_metadata(
6060; X86-NEXT: bb01:
6161; X86-NEXT: [[A:%.*]] = alloca [[S:%.*]], align 8
6262; X86-NEXT: [[B:%.*]] = alloca [[S]], align 8
63- ; X86-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4, !range [[RNG0 :![0-9]+]], !noundef !1
64- ; X86-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4, !range [[RNG0 ]], !noundef !1
63+ ; X86-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4, !range [[RNG1 :![0-9]+]], !noundef [[META2:![0-9]+]]
64+ ; X86-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4, !range [[RNG1 ]], !noundef [[META2]]
6565; X86-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP0]], [[TMP1]]
66- ; X86-NEXT: br i1 [[TMP2]], label %"bb1+bb2+bb3", label [[EXIT:%.*]]
66+ ; X86-NEXT: br i1 [[TMP2]], label %"bb1+bb2+bb3", label [[EXIT:%.*]], !prof [[PROF3:![0-9]+]]
6767; X86: "bb1+bb2+bb3":
6868; X86-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[S]], ptr [[A]], i64 0, i32 2
6969; X86-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[S]], ptr [[B]], i64 0, i32 2
8080 %value0 = load i32 , ptr %a , align 4 , !range !0 , !noundef !1
8181 %value1 = load i32 , ptr %b , align 4 , !range !0 , !noundef !1
8282 %cmp.i = icmp eq i32 %value0 , %value1
83- br i1 %cmp.i , label %bb1 , label %exit
83+ br i1 %cmp.i , label %bb1 , label %exit , !prof !3
8484
8585bb1:
8686 %second.i = getelementptr inbounds %S , ptr %a , i64 0 , i32 2
8787 %value2 = load i32 , ptr %second.i , align 4
8888 %second2.i = getelementptr inbounds %S , ptr %b , i64 0 , i32 2
8989 %value3 = load i32 , ptr %second2.i , align 4
9090 %cmp2.i = icmp eq i32 %value2 , %value3
91- br i1 %cmp2.i , label %bb2 , label %exit
91+ br i1 %cmp2.i , label %bb2 , label %exit , !prof !4
9292
9393bb2:
9494 %third.i = getelementptr inbounds %S , ptr %a , i64 0 , i32 3
9595 %value4 = load i32 , ptr %third.i , align 4
9696 %third2.i = getelementptr inbounds %S , ptr %b , i64 0 , i32 3
9797 %value5 = load i32 , ptr %third2.i , align 4
9898 %cmp3.i = icmp eq i32 %value4 , %value5
99- br i1 %cmp3.i , label %bb3 , label %exit
99+ br i1 %cmp3.i , label %bb3 , label %exit , !prof !5
100100
101101bb3:
102102 %fourth.i = getelementptr inbounds %S , ptr %a , i64 0 , i32 4
@@ -113,3 +113,16 @@ exit:
113113
114114!0 = !{i32 0 , i32 2 }
115115!1 = !{}
116+ !2 = !{!"function_entry_count" , i32 100 }
117+ !3 = !{!"branch_weights" , i32 2 , i32 3 }
118+ !4 = !{!"branch_weights" , i32 5 , i32 7 }
119+ !5 = !{!"branch_weights" , i32 11 , i32 13 }
120+ ;.
121+ ; X86: attributes #[[ATTR0:[0-9]+]] = { nofree nosync }
122+ ; X86: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: read) }
123+ ;.
124+ ; X86: [[META0:![0-9]+]] = !{!"function_entry_count", i32 100}
125+ ; X86: [[RNG1]] = !{i32 0, i32 2}
126+ ; X86: [[META2]] = !{}
127+ ; X86: [[PROF3]] = !{!"branch_weights", i32 2, i32 3}
128+ ;.
0 commit comments