-
Notifications
You must be signed in to change notification settings - Fork 274
Too much 'vsetvli' instuctions #282
Comments
A known problem. There has been no significant work on the gcc vector port in over a year. All of the current work is in LLVM which should be used instead of gcc for RISC-V Vector support. |
Hi @jim-wilson , currently gcc is still important for most of the community, is there any plan to make any improvements on this known issue, or if we want to improve it, could you give us some hints on how to? Thanks |
Thank you for your commit. I wonder if there a plan to support RISC-V Vector. Because currently, GCC is much more stable than LLVM and most customers are familiar with GCC. Thus, they prefer to compile RISC-V vector project with GCC compiler. We are willing to improve it but it is hard to solve this problem. Could you give us some hit on how to? |
I think it needs a few man years of work to be usable. If you aren't already experienced gcc developers, then maybe a few more man years to learn how to do the work. It isn't up to date with the evolving RVV ISA spec, it isn't up to date with the evolving RVV intrinsics spec, there are ugly hacks in the vectorizing optimization passes required to make it work, there is no autovectorization support, it is missing basic optimizations like eliminating duplicate vsetvli instructions, etc. The current status is that it is only useful as a toy for demos. SiFive and a few other organizations are contributing to the LLVM vector support, but no one is contributing to the gcc vector support. Alibaba has expressed some interest in contributing recently but it isn't clear how we will handle their patches yet. The current stuff was mostly done by SiFive, but SiFive is not currently interested in funding this work. I don't do LLVM work, I only do GCC work. But this is a very large project to make this work well and be clean enough to upstream. |
Thanks for your clear explaination, I was not a gcc developer, just a user of it, I previously thought the rvv support in gcc is almost ready to use, now it is still have a long way to go, and of course with hard work done by your team in SiFive which already enable the rvv support is a great base for the community. |
Hello!
I have tried the latest GCC which supports the latest rvv intrinsic functions API and find that it adds many 'vsetvli' instructions. But actually, all these 'vl' setting instructions are not needed and should be optimized.
Take rvv_saxpy.c as example. Here is part of 'saxpy_vec' function I compiled.
There are at least two 'vsetvli' instructions are useless.
The text was updated successfully, but these errors were encountered: