summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/tbaa-struct.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-11-18 22:18:45 +0000
committerPete Cooper <peter_cooper@apple.com>2015-11-18 22:18:45 +0000
commit77871bc698d266df121c7c40466219d634fe0bca (patch)
tree5f961a9ac6b56bd055aa7a1414ca734ce21492a8 /test/CodeGen/tbaa-struct.cpp
parent0489066880b1af2a2db399126e20447e5eb19f99 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/tbaa-struct.cpp')
-rw-r--r--test/CodeGen/tbaa-struct.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/CodeGen/tbaa-struct.cpp b/test/CodeGen/tbaa-struct.cpp
index 2623c42c9a..260e22a36d 100644
--- a/test/CodeGen/tbaa-struct.cpp
+++ b/test/CodeGen/tbaa-struct.cpp
@@ -12,7 +12,7 @@ void copy(struct A *a, struct A *b) {
*a = *b;
}
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* %{{.*}}, i64 16, i32 4, i1 false), !tbaa.struct [[TS:!.*]]
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 16, i1 false), !tbaa.struct [[TS:!.*]]
struct B {
char c1;
@@ -24,7 +24,7 @@ void copy2(struct B *a, struct B *b) {
*a = *b;
}
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* %{{.*}}, i64 24, i32 4, i1 false), !tbaa.struct [[TS2:!.*]]
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 24, i1 false), !tbaa.struct [[TS2:!.*]]
typedef _Complex int T2;
typedef _Complex char T5;
@@ -36,7 +36,7 @@ void copy3 (T1 *a, T1 *b) {
*a = *b;
}
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* %{{.*}}, i64 12, i32 4, i1 false), !tbaa.struct [[TS3:!.*]]
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %{{.*}}, i8* align 4 %{{.*}}, i64 12, i1 false), !tbaa.struct [[TS3:!.*]]
// Make sure that zero-length bitfield works.
#define ATTR __attribute__ ((ms_struct))
@@ -49,7 +49,7 @@ struct five {
void copy4(struct five *a, struct five *b) {
*a = *b;
}
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* %{{.*}}, i64 3, i32 1, i1 false), !tbaa.struct [[TS4:!.*]]
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %{{.*}}, i8* align 1 %{{.*}}, i64 3, i1 false), !tbaa.struct [[TS4:!.*]]
struct six {
char a;
@@ -60,7 +60,7 @@ struct six {
void copy5(struct six *a, struct six *b) {
*a = *b;
}
-// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %{{.*}}, i8* %{{.*}}, i64 6, i32 1, i1 false), !tbaa.struct [[TS5:!.*]]
+// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %{{.*}}, i8* align 1 %{{.*}}, i64 6, i1 false), !tbaa.struct [[TS5:!.*]]
// CHECK: [[TS]] = !{i64 0, i64 2, !{{.*}}, i64 4, i64 4, !{{.*}}, i64 8, i64 1, !{{.*}}, i64 12, i64 4, !{{.*}}}
// CHECK: [[CHAR:!.*]] = !{!"omnipotent char", !{{.*}}}