[PATCH] D97465: [LoopVectorize] Refine hasIrregularType predicate

LemonBoy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 04:31:22 PDT 2021


LemonBoy added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:380-381
+  // This is only true if there is no padding between the array elements.
   return DL.getTypeAllocSizeInBits(Ty) != DL.getTypeSizeInBits(Ty);
 }
 
----------------
lebedev.ri wrote:
> I wonder why can't we still vectorize such cases,
> by instead loading `<N x DL.getTypeAllocSizeInBits(Ty)>` vector and then truncating it?
> (beware of endianness)
This was meant to be a hotfix targeting LLVM12.
I've experimented with the widen+truncate strategy and the results are promising (at least on x86), I'll submit a patch once I clean up the code.




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

https://reviews.llvm.org/D97465



More information about the llvm-commits mailing list