[PATCH] D77813: [ARM] Distribute MVE post-increments

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 11:09:14 PDT 2020


dmgreen created this revision.
dmgreen added reviewers: SjoerdMeijer, samparker, efriedma, simon_tatham, ostannard.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.

This adds some extra processing into the Pre-RA ARM load/store optimizer to detect and merge MVE loads/stores and adds of the same base. This we don't always turn into a post-inc during ISel, and due to the DAG nature of the graph we don't always know an order to use for the nodes, not knowing which nodes to make post-inc and which to use the new post-inc of. After ISel, we have an order that we can use to post-inc the following instructions.

So this looks for Loads/Store with a starting offset of 0, and an add/sub from the same base, and a number of other loads/stores. We then do some checks and convert the load/store into a postinc variant. Any loads/stores after it have the offset subtracted from their immediates. For example:

  LDR #4           LDR #4
  LDR #0           LDR_POSTINC #16
  LDR #8           LDR #-8
  LDR #12          LDR #-4
  ADD #16

It only handles MVE loads/stores at the moment. Normal loads/store will be added in a followup patch, they just have some extra details to ensure that we keep generating LDRD/LDM successfully.


https://reviews.llvm.org/D77813

Files:
  llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
  llvm/test/CodeGen/ARM/O3-pipeline.ll
  llvm/test/CodeGen/Thumb2/mve-float16regloops.ll
  llvm/test/CodeGen/Thumb2/mve-float32regloops.ll
  llvm/test/CodeGen/Thumb2/mve-ldst-postinc.ll
  llvm/test/CodeGen/Thumb2/mve-postinc-distribute.ll
  llvm/test/CodeGen/Thumb2/mve-postinc-distribute.mir
  llvm/test/CodeGen/Thumb2/mve-satmul-loops.ll
  llvm/test/CodeGen/Thumb2/mve-vld2-post.ll
  llvm/test/CodeGen/Thumb2/mve-vld4-post.ll
  llvm/test/CodeGen/Thumb2/mve-vldst4.ll
  llvm/test/CodeGen/Thumb2/mve-vst2-post.ll
  llvm/test/CodeGen/Thumb2/mve-vst4-post.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77813.256334.patch
Type: text/x-patch
Size: 66837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200409/f1294771/attachment.bin>


More information about the llvm-commits mailing list