[PATCH] D104624: [LoopVectorize] Add support for scalable vectorization of invariant stores

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 08:50:13 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7356
+        } else {
+          assert((isa<LoadInst>(&I) || !VF.isScalable()) &&
+                 "Cannot yet scalarize uniform stores");
----------------
fhahn wrote:
> I guess with that we are still crashing on targets with scalable vectors but without gather/scatter? Is there a way to also handle the case without gather/scatters without crashing?
I think there is potentially a way to do this, but may involve changing VPReplicateRecipe::execute to only store out the last lane value. I wasn't sure how difficult this was, or whether this was even an acceptable solution. So I chose this simpler route for now, especially since I wasn't sure how much we really had to worry about lack of scatter support at the moment. I was thinking to revisit this again at some point and investigate the possibility of changing the replicate recipe. I think essentially for fixed width we generate N stores to the same address, and let subsequent passes optimise all but the last away.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104624



More information about the llvm-commits mailing list