Issue 61657
Summary Request for CommandGuide/llvm-opt-report
Labels new issue
Assignees
Reporter k-arrows
    I have opened this issue to write a request for llvm-opt-report command documentation:
https://www.llvm.org/docs/CommandGuide/llvm-opt-report.html

 I would like an explanation for the case where the specific line is output twice like the following test program.

```c
#include <iostream>

#define N 1024

float fa[N];

void init_memory_float(float *start, float* end) {
  float state = 1.0;
 while (start != end) {
    state *= 1.1;
    *start = state;
 start++;
  }
}

int main(){

  init_memory_float(&fa[0], &fa[N]);

  return 0;
}
```

```console
$ clang++ -c -Wall -Wextra repro.cpp -o repro.o -O3 -fsave-optimization-record
$ llvm-opt-report repro.opt.yaml -o repro.lst
$ tail -n 27 repro.lst
< repro.cpp
 1     | #include <iostream>
 2     |
 3     | #define N 1024
 4     |
 5     | float fa[N];
 6     |
 7     | void init_memory_float(float *start, float* end) {
 8     |   float state = 1.0;
 [[
  > init_memory_float(float*, float*):
 9     |   while (start != end) {
  > main:
 9  U4 |   while (start != end) {
 ]]
10     |     state *= 1.1;
11     |     *start = state;
12     | start++;
13     |   }
14     | }
15     |
16     | int main(){
17     |
18 I   |   init_memory_float(&fa[0], &fa[N]);
19 |
20     |   return 0;
21     | }
```

In the above example, line number 9 is output twice. This test program is reduced from llvm-test-suite.
(Original : https://github.com/llvm/llvm-test-suite/blob/main/SingleSource/UnitTests/Vectorizer/gcc-loops.cpp)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to