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/builtin-memfns.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/builtin-memfns.c')
-rw-r--r-- | clang/test/CodeGen/builtin-memfns.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/CodeGen/builtin-memfns.c b/clang/test/CodeGen/builtin-memfns.c index 4a06160ccbc..d19963eef75 100644 --- a/clang/test/CodeGen/builtin-memfns.c +++ b/clang/test/CodeGen/builtin-memfns.c @@ -53,15 +53,15 @@ int test6(char *X) { // PR12094 int test7(int *p) { struct snd_pcm_hw_params_t* hwparams; // incomplete type. - - // CHECK: call void @llvm.memset{{.*}}256, i32 4, i1 false) + + // CHECK: call void @llvm.memset{{.*}}(i8* align 4 %{{[0-9]*}}, {{.*}}, i{{[0-9]*}} 256, i1 false) __builtin_memset(p, 0, 256); // Should be alignment = 4 - // CHECK: call void @llvm.memset{{.*}}256, i32 1, i1 false) + // CHECK: call void @llvm.memset{{.*}}(i8* align 1 %{{[0-9]*}}, {{.*}}, i{{[0-9]*}} 256, i1 false) __builtin_memset((char*)p, 0, 256); // Should be alignment = 1 __builtin_memset(hwparams, 0, 256); // No crash alignment = 1 - // CHECK: call void @llvm.memset{{.*}}256, i32 1, i1 false) + // CHECK: call void @llvm.memset{{.*}}(i8* align 1 %{{[0-9]*}}, {{.*}}, i{{[0-9]*}} 256, i1 false) } // <rdar://problem/11314941> @@ -73,13 +73,13 @@ struct PS { struct PS ps; void test8(int *arg) { // CHECK: @test8 - // CHECK: call void @llvm.memcpy{{.*}} 16, i32 1, i1 false) + // CHECK: call void @llvm.memcpy{{.*}}(i8* align 4 {{.*}}, i8* align 1 {{.*}}, i{{[0-9]*}} 16, i1 false) __builtin_memcpy(arg, ps.modes, sizeof(struct PS)); } __attribute((aligned(16))) int x[4], y[4]; void test9() { // CHECK: @test9 - // CHECK: call void @llvm.memcpy{{.*}} 16, i32 16, i1 false) + // CHECK: call void @llvm.memcpy{{.*}}(i8* align 16 {{.*}}, i8* align 16 {{.*}}, i{{[0-9]*}} 16, i1 false) __builtin_memcpy(x, y, sizeof(y)); } |