<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/99443>99443</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [llvm-opt-report] Incorrectly indicate vector length
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          vfdff
      </td>
    </tr>
</table>

<pre>
    * According [llvm-opt-report.html](https://llvm.org/docs/CommandGuide/llvm-opt-report.html), the V is used to indicate vector length
  > V: The loop is vectorized. The following numbers indicate the vector length and the interleave factor.

* demo.c : 
```
__attribute__((noinline))
void demo (double * a, int N){
 for (int i = 0; i < N; i++)
   a[i] = 2.0 * a[i];
}
``` 

* **issure reproduce**: It show the vector length is **1** with the following instruction in file **demo.opt.lst**
 > **step1**: clang -Ofast -Wall -march=armv8.5-a+sve -mllvm -force-vector-interleave=1 -S  demo.c -fsave-optimization-record
 > **step2**: llvm-opt-report demo.opt.yaml -o demo.opt.lst
```
[root@localhost 2.1]# cat demo.opt.lst
< demo.c
1      | __attribute__((noinline))
2      | void demo (double * a, int N){
3 V1,1 |  for (int i = 0; i < N; i++)
4      |    a[i] = 2.0 * a[i];
5      | }
```

* We can see the indicate vector length is **4** according the final output assemble file **demo.s**, which is different from the above report generated by llvm-opt-report.
```
.LBB0_7:                                // =>This Inner Loop Header: Depth=1
        .loc    1 4 17                          // demo.c:4:17
        ld1d    { z0.d }, p0/z, [x0, x11, lsl 3]
        .loc    1 4 15 is_stmt 0                // demo.c:4:15
        fadd    z0.d, z0.d, z0.d
        .loc    1 4 9                           // demo.c:4:9
        st1d    { z0.d }, p0, [x0, x11, lsl 3]
        .loc    1 3 26 is_stmt 1                // demo.c:3:26
        add     x11, x11, x10
        cmp     x9, x11
        b.ne    .LBB0_7
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJ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