<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61657>61657</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Request for CommandGuide/llvm-opt-report
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
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)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVs1u2zgQfhr6MpAhkpJtHXxwknqRSwts2-2xoKmxzS1FakkqTvr0C1K2pDg_28UuYAhhZuab4cf5E96rg0Fck_KGlHcz0YWjdesfmXDOnvxsZ-un9T0cxQOCbdFgDeGoPCjvO4Rg4eRUQ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