llvm.org GIT mirror llvm / 7b70b8a
[llvm-opt-report] Don't leave space for opts that never happen Because screen space is precious, if an optimization (vectorization, for example) never happens, don't leave empty space for the associated markers on every line of the output. This makes the output much more compact, and allows for the later inclusion of markers for more (although perhaps rare) optimizations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283626 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 2 years ago
6 changed file(s) with 167 addition(s) and 160 deletion(s). Raw diff Collapse all Expand all
11 RUN: llvm-opt-report -s -r %p %p/Inputs/q2.yaml | FileCheck -strict-whitespace -check-prefix=CHECK-SUCCINCT %s
22
33 ; CHECK: < {{.*[/\]}}q2.c
4 ; CHECK-NEXT: 1 | void bar();
5 ; CHECK-NEXT: 2 | void foo(int n) {
4 ; CHECK-NEXT: 1 | void bar();
5 ; CHECK-NEXT: 2 | void foo(int n) {
66 ; CHECK-NEXT: {{\[\[}}
77 ; CHECK-NEXT: > quack, quack2:
8 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
9 ; CHECK-NEXT: U4 | ^
10 ; CHECK-NEXT: U4 | ^
8 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
9 ; CHECK-NEXT: U4 | ^
10 ; CHECK-NEXT: U4 | ^
1111 ; CHECK-NEXT: > foo:
12 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
12 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
1313 ; CHECK-NEXT: {{\]\]}}
14 ; CHECK-NEXT: 4 | bar();
15 ; CHECK-NEXT: 5 | }
16 ; CHECK-NEXT: 6 |
17 ; CHECK-NEXT: 7 | void quack() {
18 ; CHECK-NEXT: 8 I | foo(4);
19 ; CHECK-NEXT: 9 | }
20 ; CHECK-NEXT: 10 |
21 ; CHECK-NEXT: 11 | void quack2() {
22 ; CHECK-NEXT: 12 I | foo(4);
23 ; CHECK-NEXT: 13 | }
24 ; CHECK-NEXT: 14 |
14 ; CHECK-NEXT: 4 | bar();
15 ; CHECK-NEXT: 5 | }
16 ; CHECK-NEXT: 6 |
17 ; CHECK-NEXT: 7 | void quack() {
18 ; CHECK-NEXT: 8 I | foo(4);
19 ; CHECK-NEXT: 9 | }
20 ; CHECK-NEXT: 10 |
21 ; CHECK-NEXT: 11 | void quack2() {
22 ; CHECK-NEXT: 12 I | foo(4);
23 ; CHECK-NEXT: 13 | }
24 ; CHECK-NEXT: 14 |
2525
2626 ; CHECK-SUCCINCT: < {{.*[/\]}}q2.c
27 ; CHECK-SUCCINCT-NEXT: 1 | void bar();
28 ; CHECK-SUCCINCT-NEXT: 2 | void foo(int n) {
27 ; CHECK-SUCCINCT-NEXT: 1 | void bar();
28 ; CHECK-SUCCINCT-NEXT: 2 | void foo(int n) {
2929 ; CHECK-SUCCINCT-NEXT: {{\[\[}}
3030 ; CHECK-SUCCINCT-NEXT: > quack, quack2:
31 ; CHECK-SUCCINCT-NEXT: 3 | for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
32 ; CHECK-SUCCINCT-NEXT: U | ^
33 ; CHECK-SUCCINCT-NEXT: U | ^
31 ; CHECK-SUCCINCT-NEXT: 3 | for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
32 ; CHECK-SUCCINCT-NEXT: U | ^
33 ; CHECK-SUCCINCT-NEXT: U | ^
3434 ; CHECK-SUCCINCT-NEXT: > foo:
35 ; CHECK-SUCCINCT-NEXT: 3 | for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
35 ; CHECK-SUCCINCT-NEXT: 3 | for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
3636 ; CHECK-SUCCINCT-NEXT: {{\]\]}}
37 ; CHECK-SUCCINCT-NEXT: 4 | bar();
38 ; CHECK-SUCCINCT-NEXT: 5 | }
39 ; CHECK-SUCCINCT-NEXT: 6 |
40 ; CHECK-SUCCINCT-NEXT: 7 | void quack() {
41 ; CHECK-SUCCINCT-NEXT: 8 I | foo(4);
42 ; CHECK-SUCCINCT-NEXT: 9 | }
43 ; CHECK-SUCCINCT-NEXT: 10 |
44 ; CHECK-SUCCINCT-NEXT: 11 | void quack2() {
45 ; CHECK-SUCCINCT-NEXT: 12 I | foo(4);
46 ; CHECK-SUCCINCT-NEXT: 13 | }
47 ; CHECK-SUCCINCT-NEXT: 14 |
37 ; CHECK-SUCCINCT-NEXT: 4 | bar();
38 ; CHECK-SUCCINCT-NEXT: 5 | }
39 ; CHECK-SUCCINCT-NEXT: 6 |
40 ; CHECK-SUCCINCT-NEXT: 7 | void quack() {
41 ; CHECK-SUCCINCT-NEXT: 8 I | foo(4);
42 ; CHECK-SUCCINCT-NEXT: 9 | }
43 ; CHECK-SUCCINCT-NEXT: 10 |
44 ; CHECK-SUCCINCT-NEXT: 11 | void quack2() {
45 ; CHECK-SUCCINCT-NEXT: 12 I | foo(4);
46 ; CHECK-SUCCINCT-NEXT: 13 | }
47 ; CHECK-SUCCINCT-NEXT: 14 |
4848
22 RUN: llvm-opt-report -s -r %p %p/Inputs/qx.yaml | FileCheck -strict-whitespace -check-prefix=CHECK-SUCCINCT %s
33
44 ; CHECK: < {{.*[/\]}}q.cpp
5 ; CHECK-NEXT: 1 | void bar();
6 ; CHECK-NEXT: 2 | void foo(int n) {
5 ; CHECK-NEXT: 1 | void bar();
6 ; CHECK-NEXT: 2 | void foo(int n) {
77 ; CHECK-NEXT: {{\[\[}}
88 ; CHECK-NEXT: > foo(int):
9 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i)
9 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i)
1010 ; CHECK-NEXT: > quack(), quack2():
11 ; CHECK-NEXT: 3 U4 | for (int i = 0; i < n; ++i)
11 ; CHECK-NEXT: 3 U4 | for (int i = 0; i < n; ++i)
1212 ; 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(4);
22 ; CHECK-NEXT: 13 | }
23 ; CHECK-NEXT: 14 |
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(4);
22 ; CHECK-NEXT: 13 | }
23 ; CHECK-NEXT: 14 |
2424
2525 ; CHECK-NODEM: < {{.*[/\]}}q.cpp
26 ; CHECK-NODEM-NEXT: 1 | void bar();
27 ; CHECK-NODEM-NEXT: 2 | void foo(int n) {
26 ; CHECK-NODEM-NEXT: 1 | void bar();
27 ; CHECK-NODEM-NEXT: 2 | void foo(int n) {
2828 ; CHECK-NODEM-NEXT: {{\[\[}}
2929 ; CHECK-NODEM-NEXT: > _Z3fooi:
30 ; CHECK-NODEM-NEXT: 3 | for (int i = 0; i < n; ++i)
30 ; CHECK-NODEM-NEXT: 3 | for (int i = 0; i < n; ++i)
3131 ; CHECK-NODEM-NEXT: > _Z5quackv, _Z6quack2v:
32 ; CHECK-NODEM-NEXT: 3 U4 | for (int i = 0; i < n; ++i)
32 ; CHECK-NODEM-NEXT: 3 U4 | for (int i = 0; i < n; ++i)
3333 ; CHECK-NODEM-NEXT: {{\]\]}}
34 ; CHECK-NODEM-NEXT: 4 | bar();
35 ; CHECK-NODEM-NEXT: 5 | }
36 ; CHECK-NODEM-NEXT: 6 |
37 ; CHECK-NODEM-NEXT: 7 | void quack() {
38 ; CHECK-NODEM-NEXT: 8 I | foo(4);
39 ; CHECK-NODEM-NEXT: 9 | }
40 ; CHECK-NODEM-NEXT: 10 |
41 ; CHECK-NODEM-NEXT: 11 | void quack2() {
42 ; CHECK-NODEM-NEXT: 12 I | foo(4);
43 ; CHECK-NODEM-NEXT: 13 | }
44 ; CHECK-NODEM-NEXT: 14 |
34 ; CHECK-NODEM-NEXT: 4 | bar();
35 ; CHECK-NODEM-NEXT: 5 | }
36 ; CHECK-NODEM-NEXT: 6 |
37 ; CHECK-NODEM-NEXT: 7 | void quack() {
38 ; CHECK-NODEM-NEXT: 8 I | foo(4);
39 ; CHECK-NODEM-NEXT: 9 | }
40 ; CHECK-NODEM-NEXT: 10 |
41 ; CHECK-NODEM-NEXT: 11 | void quack2() {
42 ; CHECK-NODEM-NEXT: 12 I | foo(4);
43 ; CHECK-NODEM-NEXT: 13 | }
44 ; CHECK-NODEM-NEXT: 14 |
4545
4646 ; CHECK-SUCCINCT: < {{.*[/\]}}q.cpp
47 ; CHECK-SUCCINCT-NEXT: 1 | void bar();
48 ; CHECK-SUCCINCT-NEXT: 2 | void foo(int n) {
47 ; CHECK-SUCCINCT-NEXT: 1 | void bar();
48 ; CHECK-SUCCINCT-NEXT: 2 | void foo(int n) {
4949 ; CHECK-SUCCINCT-NEXT: {{\[\[}}
5050 ; CHECK-SUCCINCT-NEXT: > foo(int):
51 ; CHECK-SUCCINCT-NEXT: 3 | for (int i = 0; i < n; ++i)
51 ; CHECK-SUCCINCT-NEXT: 3 | for (int i = 0; i < n; ++i)
5252 ; CHECK-SUCCINCT-NEXT: > quack(), quack2():
53 ; CHECK-SUCCINCT-NEXT: 3 U | for (int i = 0; i < n; ++i)
53 ; CHECK-SUCCINCT-NEXT: 3 U | for (int i = 0; i < n; ++i)
5454 ; CHECK-SUCCINCT-NEXT: {{\]\]}}
55 ; CHECK-SUCCINCT-NEXT: 4 | bar();
56 ; CHECK-SUCCINCT-NEXT: 5 | }
57 ; CHECK-SUCCINCT-NEXT: 6 |
58 ; CHECK-SUCCINCT-NEXT: 7 | void quack() {
59 ; CHECK-SUCCINCT-NEXT: 8 I | foo(4);
60 ; CHECK-SUCCINCT-NEXT: 9 | }
61 ; CHECK-SUCCINCT-NEXT: 10 |
62 ; CHECK-SUCCINCT-NEXT: 11 | void quack2() {
63 ; CHECK-SUCCINCT-NEXT: 12 I | foo(4);
64 ; CHECK-SUCCINCT-NEXT: 13 | }
65 ; CHECK-SUCCINCT-NEXT: 14 |
55 ; CHECK-SUCCINCT-NEXT: 4 | bar();
56 ; CHECK-SUCCINCT-NEXT: 5 | }
57 ; CHECK-SUCCINCT-NEXT: 6 |
58 ; CHECK-SUCCINCT-NEXT: 7 | void quack() {
59 ; CHECK-SUCCINCT-NEXT: 8 I | foo(4);
60 ; CHECK-SUCCINCT-NEXT: 9 | }
61 ; CHECK-SUCCINCT-NEXT: 10 |
62 ; CHECK-SUCCINCT-NEXT: 11 | void quack2() {
63 ; CHECK-SUCCINCT-NEXT: 12 I | foo(4);
64 ; CHECK-SUCCINCT-NEXT: 13 | }
65 ; CHECK-SUCCINCT-NEXT: 14 |
6666
11 RUN: llvm-opt-report -s -r %p %p/Inputs/q.yaml | FileCheck -strict-whitespace -check-prefix=CHECK-SUCCINCT %s
22
33 ; CHECK: < {{.*[/\]}}q.c
4 ; CHECK-NEXT: 1 | void bar();
5 ; CHECK-NEXT: 2 | void foo(int n) {
4 ; CHECK-NEXT: 1 | void bar();
5 ; CHECK-NEXT: 2 | void foo(int n) {
66 ; CHECK-NEXT: {{\[\[}}
77 ; CHECK-NEXT: > foo:
8 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i)
8 ; CHECK-NEXT: 3 | for (int i = 0; i < n; ++i)
99 ; CHECK-NEXT: > quack, quack2:
10 ; CHECK-NEXT: 3 U4 | for (int i = 0; i < n; ++i)
10 ; CHECK-NEXT: 3 U4 | for (int i = 0; i < n; ++i)
1111 ; CHECK-NEXT: {{\]\]}}
12 ; CHECK-NEXT: 4 | bar();
13 ; CHECK-NEXT: 5 | }
14 ; CHECK-NEXT: 6 |
15 ; CHECK-NEXT: 7 | void quack() {
16 ; CHECK-NEXT: 8 I | foo(4);
17 ; CHECK-NEXT: 9 | }
18 ; CHECK-NEXT: 10 |
19 ; CHECK-NEXT: 11 | void quack2() {
20 ; CHECK-NEXT: 12 I | foo(4);
21 ; CHECK-NEXT: 13 | }
22 ; CHECK-NEXT: 14 |
12 ; CHECK-NEXT: 4 | bar();
13 ; CHECK-NEXT: 5 | }
14 ; CHECK-NEXT: 6 |
15 ; CHECK-NEXT: 7 | void quack() {
16 ; CHECK-NEXT: 8 I | foo(4);
17 ; CHECK-NEXT: 9 | }
18 ; CHECK-NEXT: 10 |
19 ; CHECK-NEXT: 11 | void quack2() {
20 ; CHECK-NEXT: 12 I | foo(4);
21 ; CHECK-NEXT: 13 | }
22 ; CHECK-NEXT: 14 |
2323
2424 ; CHECK-SUCCINCT: < {{.*[/\]}}q.c
25 ; CHECK-SUCCINCT-NEXT: 1 | void bar();
26 ; CHECK-SUCCINCT-NEXT: 2 | void foo(int n) {
25 ; CHECK-SUCCINCT-NEXT: 1 | void bar();
26 ; CHECK-SUCCINCT-NEXT: 2 | void foo(int n) {
2727 ; CHECK-SUCCINCT-NEXT: {{\[\[}}
2828 ; CHECK-SUCCINCT-NEXT: > foo:
29 ; CHECK-SUCCINCT-NEXT: 3 | for (int i = 0; i < n; ++i)
29 ; CHECK-SUCCINCT-NEXT: 3 | for (int i = 0; i < n; ++i)
3030 ; CHECK-SUCCINCT-NEXT: > quack, quack2:
31 ; CHECK-SUCCINCT-NEXT: 3 U | for (int i = 0; i < n; ++i)
31 ; CHECK-SUCCINCT-NEXT: 3 U | for (int i = 0; i < n; ++i)
3232 ; CHECK-SUCCINCT-NEXT: {{\]\]}}
33 ; CHECK-SUCCINCT-NEXT: 4 | bar();
34 ; CHECK-SUCCINCT-NEXT: 5 | }
35 ; CHECK-SUCCINCT-NEXT: 6 |
36 ; CHECK-SUCCINCT-NEXT: 7 | void quack() {
37 ; CHECK-SUCCINCT-NEXT: 8 I | foo(4);
38 ; CHECK-SUCCINCT-NEXT: 9 | }
39 ; CHECK-SUCCINCT-NEXT: 10 |
40 ; CHECK-SUCCINCT-NEXT: 11 | void quack2() {
41 ; CHECK-SUCCINCT-NEXT: 12 I | foo(4);
42 ; CHECK-SUCCINCT-NEXT: 13 | }
43 ; CHECK-SUCCINCT-NEXT: 14 |
33 ; CHECK-SUCCINCT-NEXT: 4 | bar();
34 ; CHECK-SUCCINCT-NEXT: 5 | }
35 ; CHECK-SUCCINCT-NEXT: 6 |
36 ; CHECK-SUCCINCT-NEXT: 7 | void quack() {
37 ; CHECK-SUCCINCT-NEXT: 8 I | foo(4);
38 ; CHECK-SUCCINCT-NEXT: 9 | }
39 ; CHECK-SUCCINCT-NEXT: 10 |
40 ; CHECK-SUCCINCT-NEXT: 11 | void quack2() {
41 ; CHECK-SUCCINCT-NEXT: 12 I | foo(4);
42 ; CHECK-SUCCINCT-NEXT: 13 | }
43 ; CHECK-SUCCINCT-NEXT: 14 |
4444
0 RUN: llvm-opt-report -r %p %p/Inputs/sr2.yaml | FileCheck -strict-whitespace %s
11
22 ; CHECK: < {{.*[/\]}}sr2.c
3 ; CHECK-NEXT: 1 | /*
4 ; CHECK-NEXT: 2 | ** Write a 64-bit variable-length integer to memory starting at p[0].
5 ; CHECK-NEXT: 3 | ** The length of data write will be between 1 and 9 bytes. The number
6 ; CHECK-NEXT: 4 | ** of bytes written is returned.
7 ; CHECK-NEXT: 5 | **
8 ; CHECK-NEXT: 6 | ** A variable-length integer consists of the lower 7 bits of each byte
9 ; CHECK-NEXT: 7 | ** for all bytes that have the 8th bit set and one byte with the 8th
10 ; CHECK-NEXT: 8 | ** bit clear. Except, if we get to the 9th byte, it stores the full
11 ; CHECK-NEXT: 9 | ** 8 bits and is the last byte.
12 ; CHECK-NEXT: 10 | */
13 ; CHECK-NEXT: 11 | SQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
14 ; CHECK-NEXT: 12 | int i, j, n;
15 ; CHECK-NEXT: 13 | u8 buf[10];
16 ; CHECK-NEXT: 14 | if( v & (((u64)0xff000000)<<32) ){
17 ; CHECK-NEXT: 15 | p[8] = v;
18 ; CHECK-NEXT: 16 | v >>= 8;
19 ; CHECK-NEXT: 17 | for(i=7; i>=0; i--){
20 ; CHECK-NEXT: 18 | p[i] = (v & 0x7f) | 0x80;
21 ; CHECK-NEXT: 19 | v >>= 7;
22 ; CHECK-NEXT: 20 | }
23 ; CHECK-NEXT: 21 | return 9;
24 ; CHECK-NEXT: 22 | }
25 ; CHECK-NEXT: 23 | n = 0;
26 ; CHECK-NEXT: 24 | do{
27 ; CHECK-NEXT: 25 | buf[n++] = (v & 0x7f) | 0x80;
28 ; CHECK-NEXT: 26 | v >>= 7;
29 ; CHECK-NEXT: 27 | }while( v!=0 );
30 ; CHECK-NEXT: 28 | buf[0] &= 0x7f;
31 ; CHECK-NEXT: 29 | assert( n<=9 );
32 ; CHECK-NEXT: 30 U2V16,2 | for(i=0, j=n-1; j>=0; j--, i++){
33 ; CHECK-NEXT: 31 | p[i] = buf[j];
34 ; CHECK-NEXT: 32 | }
35 ; CHECK-NEXT: 33 | return n;
36 ; CHECK-NEXT: 34 | }
37 ; CHECK-NEXT: 35 |
3 ; CHECK-NEXT: 1 | /*
4 ; CHECK-NEXT: 2 | ** Write a 64-bit variable-length integer to memory starting at p[0].
5 ; CHECK-NEXT: 3 | ** The length of data write will be between 1 and 9 bytes. The number
6 ; CHECK-NEXT: 4 | ** of bytes written is returned.
7 ; CHECK-NEXT: 5 | **
8 ; CHECK-NEXT: 6 | ** A variable-length integer consists of the lower 7 bits of each byte
9 ; CHECK-NEXT: 7 | ** for all bytes that have the 8th bit set and one byte with the 8th
10 ; CHECK-NEXT: 8 | ** bit clear. Except, if we get to the 9th byte, it stores the full
11 ; CHECK-NEXT: 9 | ** 8 bits and is the last byte.
12 ; CHECK-NEXT: 10 | */
13 ; CHECK-NEXT: 11 | SQLITE_PRIVATE int sqlite3PutVarint(unsigned char *p, u64 v){
14 ; CHECK-NEXT: 12 | int i, j, n;
15 ; CHECK-NEXT: 13 | u8 buf[10];
16 ; CHECK-NEXT: 14 | if( v & (((u64)0xff000000)<<32) ){
17 ; CHECK-NEXT: 15 | p[8] = v;
18 ; CHECK-NEXT: 16 | v >>= 8;
19 ; CHECK-NEXT: 17 | for(i=7; i>=0; i--){
20 ; CHECK-NEXT: 18 | p[i] = (v & 0x7f) | 0x80;
21 ; CHECK-NEXT: 19 | v >>= 7;
22 ; CHECK-NEXT: 20 | }
23 ; CHECK-NEXT: 21 | return 9;
24 ; CHECK-NEXT: 22 | }
25 ; CHECK-NEXT: 23 | n = 0;
26 ; CHECK-NEXT: 24 | do{
27 ; CHECK-NEXT: 25 | buf[n++] = (v & 0x7f) | 0x80;
28 ; CHECK-NEXT: 26 | v >>= 7;
29 ; CHECK-NEXT: 27 | }while( v!=0 );
30 ; CHECK-NEXT: 28 | buf[0] &= 0x7f;
31 ; CHECK-NEXT: 29 | assert( n<=9 );
32 ; CHECK-NEXT: 30 U2V16,2 | for(i=0, j=n-1; j>=0; j--, i++){
33 ; CHECK-NEXT: 31 | p[i] = buf[j];
34 ; CHECK-NEXT: 32 | }
35 ; CHECK-NEXT: 33 | return n;
36 ; CHECK-NEXT: 34 | }
37 ; CHECK-NEXT: 35 |
3838
0 RUN: llvm-opt-report -r %p %p/Inputs/unrl.yaml | FileCheck -strict-whitespace %s
11
22 ; CHECK: < {{.*[/\]}}unrl.c
3 ; CHECK-NEXT: 1 | void bar();
4 ; CHECK-NEXT: 2 |
5 ; CHECK-NEXT: 3 | void foo() {
6 ; CHECK-NEXT: 4 U5 | for (int i = 0; i < 5; ++i)
7 ; CHECK-NEXT: 5 | bar();
8 ; CHECK-NEXT: 6 |
9 ; CHECK-NEXT: 7 U11 | for (int i = 0; i < 11; ++i)
10 ; CHECK-NEXT: 8 | bar();
11 ; CHECK-NEXT: 9 | }
12 ; CHECK-NEXT: 10 |
3 ; CHECK-NEXT: 1 | void bar();
4 ; CHECK-NEXT: 2 |
5 ; CHECK-NEXT: 3 | void foo() {
6 ; CHECK-NEXT: 4 U5 | for (int i = 0; i < 5; ++i)
7 ; CHECK-NEXT: 5 | bar();
8 ; CHECK-NEXT: 6 |
9 ; CHECK-NEXT: 7 U11 | for (int i = 0; i < 11; ++i)
10 ; CHECK-NEXT: 8 | bar();
11 ; CHECK-NEXT: 9 | }
12 ; CHECK-NEXT: 10 |
1313
331331 for (auto &LI : FI.second)
332332 MaxLI |= LI.second;
333333
334 bool NothingInlined = !MaxLI.Inlined.Transformed;
335 bool NothingUnrolled = !MaxLI.Unrolled.Transformed;
336 bool NothingVectorized = !MaxLI.Vectorized.Transformed;
337
334338 unsigned VFDigits = llvm::utostr(MaxLI.VectorizationFactor).size();
335339 unsigned ICDigits = llvm::utostr(MaxLI.InterleaveCount).size();
336340 unsigned UCDigits = llvm::utostr(MaxLI.UnrollCount).size();
434438 };
435439
436440 OS << llvm::format_decimal(L, LNDigits) << " ";
437 OS << (LLI.Inlined.Transformed && InlinedCols < 2 ? "I" : " ");
441 OS << (LLI.Inlined.Transformed && InlinedCols < 2 ? "I" :
442 (NothingInlined ? "" : " "));
438443 OS << (LLI.Unrolled.Transformed && UnrolledCols < 2 ?
439 "U" + UStr(LLI) : " " + USpaces);
444 "U" + UStr(LLI) : (NothingUnrolled ? "" : " " + USpaces));
440445 OS << (LLI.Vectorized.Transformed && VectorizedCols < 2 ?
441 "V" + VStr(LLI) : " " + VSpaces);
446 "V" + VStr(LLI) : (NothingVectorized ? "" : " " + VSpaces));
442447
443448 OS << " | " << *LI << "\n";
444449
448453 (J.second.Vectorized.Transformed && VectorizedCols > 1)) {
449454 OS << std::string(LNDigits + 1, ' ');
450455 OS << (J.second.Inlined.Transformed &&
451 InlinedCols > 1 ? "I" : " ");
456 InlinedCols > 1 ? "I" : (NothingInlined ? "" : " "));
452457 OS << (J.second.Unrolled.Transformed &&
453 UnrolledCols > 1 ? "U" + UStr(J.second) : " " + USpaces);
458 UnrolledCols > 1 ? "U" + UStr(J.second) :
459 (NothingUnrolled ? "" : " " + USpaces));
454460 OS << (J.second.Vectorized.Transformed &&
455 VectorizedCols > 1 ? "V" + VStr(J.second) : " " + VSpaces);
461 VectorizedCols > 1 ? "V" + VStr(J.second) :
462 (NothingVectorized ? "" : " " + VSpaces));
456463
457464 OS << " | " << std::string(J.first - 1, ' ') << "^\n";
458465 }