Open vfdff opened 1 month ago
@vfdff do you know if this works as expected for fixed-width vector factors (i.e. when dropping +sve
?) . the vector factor for the loop with +sve
should be vscale x 2
, it is possible that the tool doesn't parse scalable VFs properly
Yes, it works fine for fixed-width vector factors. so it looks like your guess is correct.
llvm-opt-report show the vector length is 2 with the following instruction in file demo.opt.lst
step1: clang -Ofast -march=armv8.5-a -mllvm -force-vector-interleave=1 -S demo.c -fsave-optimization-record step2: llvm-opt-report demo.opt.yaml -o demo.opt.lst
< demo.c 1 | __attribute__((noinline)) 2 | void demo (double * a, int N){ 3 V2,1 | for (int i = 0; i < N; i++) 4 | a[i] = 2.0 * a[i]; 5 | }
We can also get the indicate vector length is 2 according the final output assemble file demo.s
.LBB0_7: // =>This Inner Loop Header: Depth=1
.loc 1 4 17 // demo.c:4:17
ldr q0, [x11]
.loc 1 3 26 // demo.c:3:26
subs x10, x10, #2
.loc 1 4 15 // demo.c:4:15
fadd v0.2d, v0.2d, v0.2d
.loc 1 4 9 is_stmt 0 // demo.c:4:9
str q0, [x11], #16
.loc 1 3 26 is_stmt 1 // demo.c:3:26
b.ne .LBB0_7
According llvm-opt-report.html, the V is used to indicate vector length
demo.c :
issure reproduce: It show the vector length is 1 with the following instruction in file demo.opt.lst
We can see the indicate vector length is 2 according the final output assemble file demo.s, which is different from the above report generated by llvm-opt-report.
BTW: opt-viewer.py can report correctly