llvm.org GIT mirror llvm / df936e3
[llvm-opt-report] Fix unroll-count reporting Fix the implementation of OptReportLocationInfo's operator < so that contexts with different unroll counts are reported separately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284957 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 2 years ago
4 changed file(s) with 138 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
0 void bar();
1 void foo(int n) {
2 for (int i = 0; i < n; ++i)
3 bar();
4 }
5
6 void quack() {
7 foo(4);
8 }
9
10 void quack2() {
11 foo(8);
12 }
13
0 --- !Missed
1 Pass: inline
2 Name: NoDefinition
3 DebugLoc: { File: Inputs/q3.c, Line: 4, Column: 5 }
4 Function: foo
5 Args:
6 - Callee: bar
7 - String: ' will not be inlined into '
8 - Caller: foo
9 - String: ' because its definition is unavailable'
10 ...
11 --- !Analysis
12 Pass: inline
13 Name: CanBeInlined
14 DebugLoc: { File: Inputs/q3.c, Line: 8, Column: 3 }
15 Function: quack
16 Args:
17 - Callee: foo
18 - String: ' can be inlined into '
19 - Caller: quack
20 - String: ' with cost='
21 - Cost: '40'
22 - String: ' (threshold='
23 - Threshold: '275'
24 - String: ')'
25 ...
26 --- !Passed
27 Pass: inline
28 Name: Inlined
29 DebugLoc: { File: Inputs/q3.c, Line: 8, Column: 3 }
30 Function: quack
31 Args:
32 - Callee: foo
33 - String: ' inlined into '
34 - Caller: quack
35 ...
36 --- !Passed
37 Pass: loop-unroll
38 Name: FullyUnrolled
39 DebugLoc: { File: Inputs/q3.c, Line: 3, Column: 3 }
40 Function: quack
41 Args:
42 - String: 'completely unrolled loop with '
43 - UnrollCount: '4'
44 - String: ' iterations'
45 ...
46 --- !Analysis
47 Pass: inline
48 Name: CanBeInlined
49 DebugLoc: { File: Inputs/q3.c, Line: 12, Column: 3 }
50 Function: quack2
51 Args:
52 - Callee: foo
53 - String: ' can be inlined into '
54 - Caller: quack2
55 - String: ' with cost='
56 - Cost: '40'
57 - String: ' (threshold='
58 - Threshold: '275'
59 - String: ')'
60 ...
61 --- !Passed
62 Pass: inline
63 Name: Inlined
64 DebugLoc: { File: Inputs/q3.c, Line: 12, Column: 3 }
65 Function: quack2
66 Args:
67 - Callee: foo
68 - String: ' inlined into '
69 - Caller: quack2
70 ...
71 --- !Passed
72 Pass: loop-unroll
73 Name: FullyUnrolled
74 DebugLoc: { File: Inputs/q3.c, Line: 3, Column: 3 }
75 Function: quack2
76 Args:
77 - String: 'completely unrolled loop with '
78 - UnrollCount: '8'
79 - String: ' iterations'
80 ...
81 --- !Analysis
82 Pass: loop-vectorize
83 Name: CantVectorizeCall
84 DebugLoc: { File: Inputs/q3.c, Line: 4, Column: 5 }
85 Function: foo
86 Args:
87 - String: 'loop not vectorized: '
88 - String: call instruction cannot be vectorized
89 ...
90 --- !Missed
91 Pass: loop-vectorize
92 Name: MissedDetails
93 DebugLoc: { File: Inputs/q3.c, Line: 3, Column: 3 }
94 Function: foo
95 Args:
96 - String: 'loop not vectorized: use -Rpass-analysis=loop-vectorize for more info'
97 ...
0 RUN: llvm-opt-report -r %p %p/Inputs/q3.yaml | FileCheck -strict-whitespace %s
1
2 ; CHECK: < {{.*[/\]}}q3.c
3 ; CHECK-NEXT: 1 | void bar();
4 ; CHECK-NEXT: 2 | void foo(int n) {
5 ; CHECK-NEXT: {{\[\[}}
6 ; CHECK-NEXT: > foo:
7 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i)
8 ; CHECK-NEXT: > quack:
9 ; CHECK-NEXT: 3 U4 | for (int i = 0; i < n; ++i)
10 ; CHECK-NEXT: > quack2:
11 ; CHECK-NEXT: 3 U8 | for (int i = 0; i < n; ++i)
12 ; CHECK-NEXT: {{\]\]}}
13 ; CHECK-NEXT: 4 | bar();
14 ; CHECK-NEXT: 5 | }
15 ; CHECK-NEXT: 6 |
16 ; CHECK-NEXT: 7 | void quack() {
17 ; CHECK-NEXT: 8 I | foo(4);
18 ; CHECK-NEXT: 9 | }
19 ; CHECK-NEXT: 10 |
20 ; CHECK-NEXT: 11 | void quack2() {
21 ; CHECK-NEXT: 12 I | foo(8);
22 ; CHECK-NEXT: 13 | }
23 ; CHECK-NEXT: 14 |
24
131131 return true;
132132 else if (InterleaveCount > RHS.InterleaveCount)
133133 return false;
134 else if (InterleaveCount < RHS.InterleaveCount)
134 else if (UnrollCount < RHS.UnrollCount)
135135 return true;
136136 return false;
137137 }