[PATCH] D154714: LAA: handle GEPs with >2 operands in findForkedSCEVs()

Ramkumar Ramachandra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 06:27:33 PDT 2023


artagnon created this revision.
artagnon added reviewers: fhahn, reames, bjope, nikic.
Herald added subscribers: StephenFan, javed.absar, hiraditya.
Herald added a project: All.
artagnon requested review of this revision.
Herald added subscribers: llvm-commits, wangpc.
Herald added a project: LLVM.

Consider vectorizing the following case:

  struct layer_data {
    unsigned char arr[2048];
  } *ld;
  
  void Next_Packet() {
    int l = 0;
    while (l<2048)
    {
      ld->arr[l++] = 3;
      ld->arr[l++] = 4;
    }
  }

The GEPs for the assignments have three operands: the ptr ld, a
zero-index into ld, and another indexing depending on the loop induction
variable. However, findForkedSCEVs() suffers from the limitation that it
can only handle GEPs with two operands. Lift this limitation, and
successfully vectorize the above example, albeit with runtime
memory-checks.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154714

Files:
  llvm/lib/Analysis/LoopAccessAnalysis.cpp
  llvm/test/Analysis/LoopAccessAnalysis/forked-pointers.ll
  llvm/test/Transforms/LoopVectorize/forked-pointers.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154714.538121.patch
Type: text/x-patch
Size: 18000 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230707/7294b13a/attachment-0001.bin>


More information about the llvm-commits mailing list