[PATCH] D125747: [RISCV] Enable scalable vectorization by default for RVV

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 27 08:22:58 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/test/Transforms/LoopVectorize/RISCV/unroll-in-loop-vectorizer.ll:6
 ;
 define void @small_loop(i32* nocapture %inArray, i32 %size) nounwind {
 ; CHECK-LABEL: @small_loop(
----------------
reames wrote:
> craig.topper wrote:
> > reames wrote:
> > > reames wrote:
> > > > As an aside, I took a look at the assembly for this example.  Th codegen for the vector loop ends up being less than great.  For instance:
> > > > * We have a extend trapped in the loop for some reason
> > > > * We rerun vsetvli on every iteration (despite it producing a fixed result)
> > > > * We have a rem in the vector preheader.  That's rather expensive.  (Well, actually, we end up with a *libcall* because the attributes don't include +m, but I ignored that.)
> > > To be fair, the first two issues also exist with fixed length vectorization of the same example.  
> > What kind of extend?
> zext - it looks easily removable, I'm surprised to see it after O2.  This shouldn't be a hard fix.  It appears in both vector and scalar loops.  
Can you share what you're seeing? I see a zero extend in the preheader but not in the loops.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125747/new/

https://reviews.llvm.org/D125747



More information about the llvm-commits mailing list