[PATCH] D42974: [SROA] Take advantage of separate alignments for memcpy source and destination

Daniel Neilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 10:47:56 PST 2018


dneilson created this revision.
dneilson added a reviewer: chandlerc.
Herald added a subscriber: eraman.
Herald added a reviewer: bollu.

This change is part of step five in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. In particular, this changes the
SROA pass to cease using the old getAlignment() & setAlignment() APIs of MemoryIntrinsic in
favour of getting source & dest specific alignments through the new API. This allows us
to enhance visitMemTransferInst to be more aggressive setting the alignment in memcpy
calls that it creates, as well as to only change the alignment of a memcpy/memmove
argument that it replaces.

Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( https://reviews.llvm.org/rL322965, https://reviews.llvm.org/rC322964, https://reviews.llvm.org/rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( https://reviews.llvm.org/rL323597 )
Step 3) Update Clang to use the new IRBuilder API. ( https://reviews.llvm.org/rC323617 )
Step 4) Update Polly to use the new IRBuilder API. ( https://reviews.llvm.org/rL323618 )
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use [get|set]DestAlignment()
and [get|set]SourceAlignment() instead. ( https://reviews.llvm.org/rL323886, https://reviews.llvm.org/rL323891, https://reviews.llvm.org/rL324148, https://reviews.llvm.org/rL324273 )
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.

Reference

  http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html


Repository:
  rL LLVM

https://reviews.llvm.org/D42974

Files:
  lib/Transforms/Scalar/SROA.cpp
  lib/Transforms/Utils/InlineFunction.cpp
  test/Transforms/SROA/basictest.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42974.133041.patch
Type: text/x-patch
Size: 7593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180206/b81c9d83/attachment.bin>


More information about the llvm-commits mailing list