[polly] r322963 - Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).

Daniel Neilson via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 09:12:48 PST 2018


Author: dneilson
Date: Fri Jan 19 09:12:48 2018
New Revision: 322963

URL: http://llvm.org/viewvc/llvm-project?rev=322963&view=rev
Log:
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).

Summary:
 Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the polly tests for this change.

 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 removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.

 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)

 At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.

Modified:
    polly/trunk/test/ScopInfo/memcpy.ll
    polly/trunk/test/ScopInfo/memmove.ll
    polly/trunk/test/ScopInfo/memset.ll

Modified: polly/trunk/test/ScopInfo/memcpy.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/memcpy.ll?rev=322963&r1=322962&r2=322963&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/memcpy.ll (original)
+++ polly/trunk/test/ScopInfo/memcpy.ll Fri Jan 19 09:12:48 2018
@@ -23,7 +23,7 @@
 ; IR:   %[[r4:[a-zA-Z0-9]*]] = bitcast i64* %scevgep8 to i8*
 ;
 ; IR: polly.stmt.for.body3:
-; IR:   call void @llvm.memcpy.p0i8.p0i8.i64(i8* %[[r2]], i8* %[[r4]], i64 37, i32 4, i1 false)
+; IR:   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %[[r2]], i8* align 4 %[[r4]], i64 37, i1 false)
 ;
 ;
 ;    #include <string.h>

Modified: polly/trunk/test/ScopInfo/memmove.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/memmove.ll?rev=322963&r1=322962&r2=322963&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/memmove.ll (original)
+++ polly/trunk/test/ScopInfo/memmove.ll Fri Jan 19 09:12:48 2018
@@ -23,7 +23,7 @@
 ; IR:   %[[r4:[a-zA-Z0-9]*]] = bitcast i64* %scevgep8 to i8*
 ;
 ; IR: polly.stmt.for.body3:
-; IR:   call void @llvm.memmove.p0i8.p0i8.i64(i8* %[[r2]], i8* %[[r4]], i64 32, i32 4, i1 false)
+; IR:   call void @llvm.memmove.p0i8.p0i8.i64(i8* align 4 %[[r2]], i8* align 4 %[[r4]], i64 32, i1 false)
 ;
 ;    #include <string.h>
 ;

Modified: polly/trunk/test/ScopInfo/memset.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/memset.ll?rev=322963&r1=322962&r2=322963&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/memset.ll (original)
+++ polly/trunk/test/ScopInfo/memset.ll Fri Jan 19 09:12:48 2018
@@ -16,7 +16,7 @@
 ; IR:   %[[r1:[a-zA-Z0-9]*]] = bitcast i32* %A to i8*
 ;
 ; IR: polly.stmt.for.body3:
-; IR:   call void @llvm.memset.p0i8.i64(i8* %[[r1]], i8 36, i64 187, i32 4, i1 false)
+; IR:   call void @llvm.memset.p0i8.i64(i8* align 4 %[[r1]], i8 36, i64 187, i1 false)
 ;
 ;    #include <string.h>
 ;




More information about the llvm-commits mailing list