Skip to content

Commit 34fbc71

Browse files
PGO: Make branch-weights regression test more robust.
1 parent 68785d9 commit 34fbc71

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/test/run-make-fulldeps/pgo-branch-weights/filecheck-patterns.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
# First, establish that certain !prof labels are attached to the expected
33
# functions and branching instructions.
44

5-
CHECK: define void @function_called_twice(i32 %c) {{.*}} !prof !29 {
6-
CHECK: br i1 {{.*}}, label {{.*}}, label {{.*}}, !prof !30
5+
CHECK: define void @function_called_twice(i32 %c) {{.*}} !prof [[function_called_twice_id:![0-9]+]] {
6+
CHECK: br i1 {{.*}}, label {{.*}}, label {{.*}}, !prof [[branch_weights0:![0-9]+]]
77

8-
CHECK: define void @function_called_42_times(i32 %c) {{.*}} !prof !31 {
8+
CHECK: define void @function_called_42_times(i32 %c) {{.*}} !prof [[function_called_42_times_id:![0-9]+]] {
99
CHECK: switch i32 %c, label {{.*}} [
1010
CHECK-NEXT: i32 97, label {{.*}}
1111
CHECK-NEXT: i32 98, label {{.*}}
12-
CHECK-NEXT: ], !prof !32
12+
CHECK-NEXT: ], !prof [[branch_weights1:![0-9]+]]
1313

14-
CHECK: define void @function_called_never(i32 {{.*}} !prof !33 {
14+
CHECK: define void @function_called_never(i32 {{.*}} !prof [[function_called_never_id:![0-9]+]] {
1515

1616

1717

1818
# Now check that those !prof tags hold the expected counts
1919

20-
CHECK: !29 = !{!"function_entry_count", i64 2}
21-
CHECK: !30 = !{!"branch_weights", i32 2, i32 0}
22-
CHECK: !31 = !{!"function_entry_count", i64 42}
23-
CHECK: !32 = !{!"branch_weights", i32 2, i32 12, i32 28}
24-
CHECK: !33 = !{!"function_entry_count", i64 0}
20+
CHECK: [[function_called_twice_id]] = !{!"function_entry_count", i64 2}
21+
CHECK: [[branch_weights0]] = !{!"branch_weights", i32 2, i32 0}
22+
CHECK: [[function_called_42_times_id]] = !{!"function_entry_count", i64 42}
23+
CHECK: [[branch_weights1]] = !{!"branch_weights", i32 2, i32 12, i32 28}
24+
CHECK: [[function_called_never_id]] = !{!"function_entry_count", i64 0}

0 commit comments

Comments
 (0)