[PATCH] D154309: [LV] Do not add load to group if it moves across conflicting store.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 14 06:39:54 PDT 2023


Ayal added inline comments.


================
Comment at: llvm/lib/Analysis/VectorUtils.cpp:1175
       // the boundaries of the (2, 4) group.
       if (!canReorderMemAccessesForInterleavedGroups(&*AI, &*BI)) {
         // If a dependence exists and A is already in a group, we know that A
----------------
Ayal wrote:
> Sketch of one option to fix insertion of Group into CompletedLoadGroups whenever/as-soon-as needed.
Anna, here's a more concrete sketch, which also breaks out of the enclosing "for AI" loop as needed:

```
      if (Group && isa<LoadInst>(B)) {
        uint32_t Index = 0, Factor = Group->getFactor();
        for (; Index < Factor; ++Index) {
          Instruction *MemberOfGroupB = Group->getMember(Index);
          if (MemberOfGroupB &&
              !canReorderMemAccessesForInterleavedGroups(
                  &*AI, &*AccessStrideInfo.find(MemberOfGroupB)))
            break;
        }
        if (Index < Factor) {
          CompletedLoadGroups.insert(Group);
          break;
        }
      }
```
Curious to learn if it helps.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154309



More information about the llvm-commits mailing list