diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-11-18 22:18:45 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-11-18 22:18:45 +0000 |
commit | 7bfd5cb7be04b6963aa7a587bb82b723f686c6b4 (patch) | |
tree | e507353f19f6e410b37fe94325a34557b6e3cb8a /clang/test/CodeGen/ppc64-align-struct.c | |
parent | 72bc23ef02bad3873d3572b2be529404a461d449 (diff) | |
download | bcm5719-llvm-7bfd5cb7be04b6963aa7a587bb82b723f686c6b4.tar.gz bcm5719-llvm-7bfd5cb7be04b6963aa7a587bb82b723f686c6b4.zip |
Change memcpy/memset/memmove to have dest and source alignments.
This is a follow on from a similar LLVM commit: r253511.
Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html
These intrinsics currently have an explicit alignment argument which is
required to be a constant integer. It represents the alignment of the
source and dest, and so must be the minimum of those.
This change allows source and dest to each have their own alignments
by using the alignment attribute on their arguments. The alignment
argument itself is removed.
The only code change to clang is hidden in CGBuilder.h which now passes
both dest and source alignment to IRBuilder, instead of taking the minimum of
dest and source alignments.
Reviewed by Hal Finkel.
llvm-svn: 253512
Diffstat (limited to 'clang/test/CodeGen/ppc64-align-struct.c')
-rw-r--r-- | clang/test/CodeGen/ppc64-align-struct.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/CodeGen/ppc64-align-struct.c b/clang/test/CodeGen/ppc64-align-struct.c index 6a04d0cd84f..6fba2d262a4 100644 --- a/clang/test/CodeGen/ppc64-align-struct.c +++ b/clang/test/CodeGen/ppc64-align-struct.c @@ -56,7 +56,7 @@ void test7 (int x, struct test7 y) // CHECK: [[T0:%.*]] = bitcast i8* %[[CUR]] to %struct.test1* // CHECK: [[DEST:%.*]] = bitcast %struct.test1* %y to i8* // CHECK: [[SRC:%.*]] = bitcast %struct.test1* [[T0]] to i8* -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[DEST]], i8* [[SRC]], i64 8, i32 4, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 [[DEST]], i8* align 8 [[SRC]], i64 8, i1 false) struct test1 test1va (int x, ...) { struct test1 y; @@ -79,7 +79,7 @@ struct test1 test1va (int x, ...) // CHECK: [[T0:%.*]] = bitcast i8* %[[ALIGN]] to %struct.test2* // CHECK: [[DEST:%.*]] = bitcast %struct.test2* %y to i8* // CHECK: [[SRC:%.*]] = bitcast %struct.test2* [[T0]] to i8* -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[DEST]], i8* [[SRC]], i64 16, i32 16, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 [[DEST]], i8* align 16 [[SRC]], i64 16, i1 false) struct test2 test2va (int x, ...) { struct test2 y; @@ -102,7 +102,7 @@ struct test2 test2va (int x, ...) // CHECK: [[T0:%.*]] = bitcast i8* %[[ALIGN]] to %struct.test3* // CHECK: [[DEST:%.*]] = bitcast %struct.test3* %y to i8* // CHECK: [[SRC:%.*]] = bitcast %struct.test3* [[T0]] to i8* -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[DEST]], i8* [[SRC]], i64 32, i32 16, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 [[DEST]], i8* align 16 [[SRC]], i64 32, i1 false) struct test3 test3va (int x, ...) { struct test3 y; @@ -121,7 +121,7 @@ struct test3 test3va (int x, ...) // CHECK: [[T0:%.*]] = bitcast i8* %[[CUR]] to %struct.test4* // CHECK: [[DEST:%.*]] = bitcast %struct.test4* %y to i8* // CHECK: [[SRC:%.*]] = bitcast %struct.test4* [[T0]] to i8* -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[DEST]], i8* [[SRC]], i64 12, i32 4, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 [[DEST]], i8* align 8 [[SRC]], i64 12, i1 false) struct test4 test4va (int x, ...) { struct test4 y; @@ -140,7 +140,7 @@ struct test4 test4va (int x, ...) // CHECK: [[T0:%.*]] = bitcast i8* %[[CUR]] to %struct.test_longdouble* // CHECK: [[DEST:%.*]] = bitcast %struct.test_longdouble* %y to i8* // CHECK: [[SRC:%.*]] = bitcast %struct.test_longdouble* [[T0]] to i8* -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[DEST]], i8* [[SRC]], i64 16, i32 8, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 [[DEST]], i8* align 8 [[SRC]], i64 16, i1 false) struct test_longdouble { long double x; }; struct test_longdouble testva_longdouble (int x, ...) { @@ -164,7 +164,7 @@ struct test_longdouble testva_longdouble (int x, ...) // CHECK: [[T0:%.*]] = bitcast i8* %[[ALIGN]] to %struct.test_vector* // CHECK: [[DEST:%.*]] = bitcast %struct.test_vector* %y to i8* // CHECK: [[SRC:%.*]] = bitcast %struct.test_vector* [[T0]] to i8* -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* [[DEST]], i8* [[SRC]], i64 16, i32 16, i1 false) +// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 [[DEST]], i8* align 16 [[SRC]], i64 16, i1 false) struct test_vector { vector int x; }; struct test_vector testva_vector (int x, ...) { |