[PATCH] D147336: [IVDescriptors] Add pointer InductionDescriptors with non-constant strides (try 2)

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 09:25:10 PDT 2023


reames created this revision.
reames added reviewers: fhahn, dmgreen.
Herald added subscribers: luke, StephenFan, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, bollu, simoncook, johnrusso, rbar, asb, hiraditya, mcrosier.
Herald added a project: All.
reames requested review of this revision.
Herald added subscribers: pcwang-thead, MaskRay.
Herald added a project: LLVM.

This will be a reland of 498aa534f472 <https://reviews.llvm.org/rG498aa534f472d28db893aa9a8627d0b46e17f312> which was reverted in 965a090f02c <https://reviews.llvm.org/rG965a090f02cbab2dc08b78e274ce9d65e4d1221f>.  The crash observed was caused by swapping Part and Lane in the existing expansion code.  I also added test coverage for the scalar unroll case in 093f0fa4.

      

This matches the handling for integer IVs. I left the non-opaque cases alone, mostly because they're largely irrelevant today.

      

With this out of the way, many vectorization examples fail on aliasing checks which bail out of non-constant strides.  The cases we can vectorize with this patch alone involve either a single memory access in a loop, or we generate runtime checks and thus don't need the aliasing checks to succeed.

      

This will also enable non-constant stride pointer recurrences for other consumers. I've audited said code, and don't see any obvious issues.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147336

Files:
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll
  llvm/test/Transforms/LoopVectorize/pointer-induction-unroll.ll
  llvm/test/Transforms/LoopVectorize/pointer-induction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147336.510058.patch
Type: text/x-patch
Size: 20703 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230331/a9d3408b/attachment.bin>


More information about the llvm-commits mailing list