[PATCH] D102253: [LV] Prevent vectorization with unsupported element types.

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 29 10:31:41 PDT 2021


kmclaughlin added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5685
+      auto *Ty = I.getType();
+      if (!Ty->isVoidTy() && !Ty->isIntegerTy(1) &&
+          !TTI.isElementTypeLegalForScalableVector(Ty)) {
----------------
sdesmalen wrote:
> Hi @kmclaughlin I tried out this patch and found there is a case that's missing, namely where the instruction is a `StoreInst`, which itself has `void` as its type, but then stores a loop invariant i128/f128 value to  a variant address.
> 
> Also, looking at this condition again, why is IntegerTy(1) handled differently here? For SVE we have predicate vectors, so it should be covered by isElementTypeLegalForScalableVector?
Hi @sdesmalen, I've added a test for the missing store case which you found.
The IntegerTy(1) here should be covered by `isElementTypeLegalForScalableVector` - I've moved this accordingly.


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

https://reviews.llvm.org/D102253



More information about the llvm-commits mailing list