[llvm] r322965 - Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 01:56:53 PST 2018


On Fri, Jan 19, 2018 at 6:13 PM, Daniel Neilson via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: dneilson
> Date: Fri Jan 19 09:13:12 2018
> New Revision: 322965
>
> URL: http://llvm.org/viewvc/llvm-project?rev=322965&view=rev
> Log:
> Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
>
> Summary:
>  This is a resurrection of work first proposed and discussed in Aug 2015:
>    http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
> and initially landed (but then backed out) in Nov 2015:
>    http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html
>
>  The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
> which is required to be a constant integer. It represents the alignment of the
> dest (and source), and so must be the minimum of the actual alignment of the
> two.
>
>  This change is the first in a series that allows source and dest to each
> have their own alignments by using the alignment attribute on their arguments.
>
>  In this change we:
> 1) Remove the alignment argument.
> 2) Add alignment attributes to the source & dest arguments. We, temporarily,
>    require that the alignments for source & dest be equal.
>
>  For example, code which used to read:
>   call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
> will now read
>   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
>
>  Downstream users may have to update their lit tests that check for
> @llvm.memcpy/memmove/memset call/declaration patterns. The following extended sed script
> may help with updating the majority of your tests, but it does not catch all possible
> patterns so some manual checking and updating will be required.

Can you put something in the trunk release notes about this?


More information about the llvm-commits mailing list