1 RUN: llvm-opt-report -r %p %p/Inputs/or.yaml | FileCheck -strict-whitespace %s
2 RUN: llvm-opt-report -s -r %p %p/Inputs/or.yaml | FileCheck -strict-whitespace -check-prefix=CHECK-SUCCINCT %s
4 ; CHECK: < {{.*[/\]}}or.c
5 ; CHECK-NEXT: 1 | void bar();
6 ; CHECK-NEXT: 2 | void foo() { bar(); }
8 ; CHECK-NEXT: 4 | #include "or.h"
10 ; CHECK-NEXT: 6 | void Test(int *res, int *c, int *d, int *p, int n) {
11 ; CHECK-NEXT: 7 | int i;
13 ; CHECK-NEXT: 9 | #pragma clang loop vectorize(assume_safety)
14 ; CHECK-NEXT: 10 V4,2 | for (i = 0; i < 1600; i++) {
15 ; CHECK-NEXT: 11 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
18 ; CHECK-NEXT: 14 U16 | for (i = 0; i < 16; i++) {
19 ; CHECK-NEXT: 15 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
22 ; CHECK-NEXT: 18 I | foo();
24 ; CHECK-NEXT: 20 | foo(); bar(); foo();
30 ; CHECK: < {{.*[/\]}}or.h
31 ; CHECK-NEXT: 1 | void TestH(int *res, int *c, int *d, int *p, int n) {
32 ; CHECK-NEXT: 2 | int i;
34 ; CHECK-NEXT: 4 | #pragma clang loop vectorize(assume_safety)
35 ; CHECK-NEXT: 5 V4,2 | for (i = 0; i < 1600; i++) {
36 ; CHECK-NEXT: 6 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
39 ; CHECK-NEXT: 9 U16 | for (i = 0; i < 16; i++) {
40 ; CHECK-NEXT: 10 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
43 ; CHECK-NEXT: 13 I | foo();
45 ; CHECK-NEXT: 15 | foo(); bar(); foo();
51 ; CHECK-SUCCINCT: < {{.*[/\]}}or.c
52 ; CHECK-SUCCINCT-NEXT: 1 | void bar();
53 ; CHECK-SUCCINCT-NEXT: 2 | void foo() { bar(); }
54 ; CHECK-SUCCINCT-NEXT: 3 |
55 ; CHECK-SUCCINCT-NEXT: 4 | #include "or.h"
56 ; CHECK-SUCCINCT-NEXT: 5 |
57 ; CHECK-SUCCINCT-NEXT: 6 | void Test(int *res, int *c, int *d, int *p, int n) {
58 ; CHECK-SUCCINCT-NEXT: 7 | int i;
59 ; CHECK-SUCCINCT-NEXT: 8 |
60 ; CHECK-SUCCINCT-NEXT: 9 | #pragma clang loop vectorize(assume_safety)
61 ; CHECK-SUCCINCT-NEXT: 10 V | for (i = 0; i < 1600; i++) {
62 ; CHECK-SUCCINCT-NEXT: 11 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
63 ; CHECK-SUCCINCT-NEXT: 12 | }
64 ; CHECK-SUCCINCT-NEXT: 13 |
65 ; CHECK-SUCCINCT-NEXT: 14 U | for (i = 0; i < 16; i++) {
66 ; CHECK-SUCCINCT-NEXT: 15 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
67 ; CHECK-SUCCINCT-NEXT: 16 | }
68 ; CHECK-SUCCINCT-NEXT: 17 |
69 ; CHECK-SUCCINCT-NEXT: 18 I | foo();
70 ; CHECK-SUCCINCT-NEXT: 19 |
71 ; CHECK-SUCCINCT-NEXT: 20 | foo(); bar(); foo();
72 ; CHECK-SUCCINCT-NEXT: I | ^
73 ; CHECK-SUCCINCT-NEXT: I | ^
74 ; CHECK-SUCCINCT-NEXT: 21 | }
75 ; CHECK-SUCCINCT-NEXT: 22 |
77 CHECK-SUCCINCT: < {{.*[/\]}}or.h
78 ; CHECK-SUCCINCT-NEXT: 1 | void TestH(int *res, int *c, int *d, int *p, int n) {
79 ; CHECK-SUCCINCT-NEXT: 2 | int i;
80 ; CHECK-SUCCINCT-NEXT: 3 |
81 ; CHECK-SUCCINCT-NEXT: 4 | #pragma clang loop vectorize(assume_safety)
82 ; CHECK-SUCCINCT-NEXT: 5 V | for (i = 0; i < 1600; i++) {
83 ; CHECK-SUCCINCT-NEXT: 6 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
84 ; CHECK-SUCCINCT-NEXT: 7 | }
85 ; CHECK-SUCCINCT-NEXT: 8 |
86 ; CHECK-SUCCINCT-NEXT: 9 U | for (i = 0; i < 16; i++) {
87 ; CHECK-SUCCINCT-NEXT: 10 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
88 ; CHECK-SUCCINCT-NEXT: 11 | }
89 ; CHECK-SUCCINCT-NEXT: 12 |
90 ; CHECK-SUCCINCT-NEXT: 13 I | foo();
91 ; CHECK-SUCCINCT-NEXT: 14 |
92 ; CHECK-SUCCINCT-NEXT: 15 | foo(); bar(); foo();
93 ; CHECK-SUCCINCT-NEXT: I | ^
94 ; CHECK-SUCCINCT-NEXT: I | ^
95 ; CHECK-SUCCINCT-NEXT: 16 | }
96 ; CHECK-SUCCINCT-NEXT: 17 |