[PATCH] D102834: [SLPVectorizer] WIP Implement initial memory versioning (WIP!)

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 07:03:31 PDT 2021


ABataev added a comment.

In D102834#2771013 <https://reviews.llvm.org/D102834#2771013>, @fhahn wrote:

> In D102834#2771002 <https://reviews.llvm.org/D102834#2771002>, @ABataev wrote:
>
>> How about emitting proper aliasing metadata in the generated basicblocks? It should solve many problems with the SLP without extra changes and may help some other passes too. I mean, memaccesses in `entry.slpversioned:` should be noaliased and in `entry.scalar:` maybe aliased.
>
> That sounds like a good idea! The question is how to best decide for which accesses to generate RT checks. At the moment, I think that's only possible for the first vectorizable tree per BB we generate code for. Is it easy to get the first and last instruction in a vectorizable tree? Then we could just clone this range.

You can easily get the first instruction - `VectorizableTree.front()`. Stores can be only in the front of the vectorizable tree. As to the last instruction, I think we need to scan all tree entries and find all gather nodes with memaccess which may alias with stores. The main problem that the versioning better to perform before we try to build the tree, otherwise we may decide to gather some instructions instead of trying vectorizing them because of possible aliasing. And it may not be profitable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102834



More information about the llvm-commits mailing list