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

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 01:51:13 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1515
 
+  bool canVectorizeInstructionTypes(Loop *TheLoop, ElementCount VF) {
+    bool IllegalTy = false;
----------------
joechrisellis wrote:
> I think this is equivalent to:
> 
> ```
> bool canVectorizeInstructionTypes(Loop *TheLoop, ElementCount VF) {
>   for (BasicBlock *BB : TheLoop->blocks())
>     for (Instruction &I : BB->instructionsWithoutDebug()) {
>       auto *Ty = I.getType();
>       if (!Ty->isVoidTy() &&
>           !TTI.isLegalToVectorizeElementType(Ty, VF.isScalable()))
>         return false;
>     }
>   return true;
> }
> ```
> 
> Has the nice side effect of getting rid of the double negative. 🙂 
I don't think we need to pass `TheLoop` in here, since I think it's a member of the class already?


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

https://reviews.llvm.org/D102253



More information about the llvm-commits mailing list