[PATCH] D105824: [LV] Avoid scalable vectorization for loops containing alloca

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 12 09:19:02 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7836
+  case Instruction::Alloca:
+    if (VF.isScalable())
+      return InstructionCost::getInvalid();
----------------
Can you add a comment describing why we don't want to vectorize this for scalable vectors?


================
Comment at: llvm/test/Transforms/LoopVectorize/AArch64/scalable-alloca.ll:29
+
+; CHECK-NOT: <vscale x
+
----------------
Can you force the loop to be vectorized with a scalable VF using a loop-hint? With the current RUN line and without hints, the loop may make the decision for other reasons (like considering a fixed-VF cheaper, rather than outright ignoring a scalable VF that was otherwise forced, but had an invalid cost).

It may also be worth rebasing your patch on `D105806` and adding a CHECK line for one of the remarks (although the remarks may still change depending on review feedback)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105824



More information about the llvm-commits mailing list