[PATCH] D127733: [ARM] Fix MVE gather/scatter merged gep offsets

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 03:28:27 PDT 2022


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samtebbs, NickGuy.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This fixes the combining of constant vector GEP operands in the optimization of MVE gather/scatter addresses, when opaque pointers are enabled. As opaque pointers reduce the number of bitcasts between geps, more can be folded than before. This can cause problems if the index types are now different between the two geps.

This fixes that by making sure each constant is scaled appropriately, which has the effect of transforming the geps to have a scale of 1, changing `[r0, q0, uxtw #1]` gathers to `[r0, q0]` with a larger q0. This helps use a simpler instruction that doesn't need the extra uxtw.


https://reviews.llvm.org/D127733

Files:
  llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
  llvm/test/CodeGen/Thumb2/mve-gather-ind16-scaled.ll
  llvm/test/CodeGen/Thumb2/mve-gather-ind32-scaled.ll
  llvm/test/CodeGen/Thumb2/mve-gather-ptrs.ll
  llvm/test/CodeGen/Thumb2/mve-gather-scatter-ptr-address.ll
  llvm/test/CodeGen/Thumb2/mve-scatter-ind16-scaled.ll
  llvm/test/CodeGen/Thumb2/mve-scatter-ind32-scaled.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127733.436717.patch
Type: text/x-patch
Size: 23682 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220614/cf353153/attachment.bin>


More information about the llvm-commits mailing list