2014-08-29 18:17:52 +08:00
|
|
|
// RUN: %clang_cc1 -triple aarch64_be-linux-gnu -ffreestanding -emit-llvm -O0 -o - %s | FileCheck --check-prefix IR %s
|
2014-05-08 01:41:15 +08:00
|
|
|
|
|
|
|
struct bt3 { signed b2:10; signed b3:10; } b16;
|
|
|
|
|
2014-08-29 18:17:52 +08:00
|
|
|
// Get the high 32-bits and then shift appropriately for big-endian.
|
2014-05-08 01:41:15 +08:00
|
|
|
signed callee_b0f(struct bt3 bp11) {
|
2014-08-29 18:17:52 +08:00
|
|
|
// IR: callee_b0f(i64 [[ARG:%.*]])
|
2015-07-10 19:31:43 +08:00
|
|
|
// IR: store i64 [[ARG]], i64* [[PTR:%.*]], align 8
|
2014-08-29 18:17:52 +08:00
|
|
|
// IR: [[BITCAST:%.*]] = bitcast i64* [[PTR]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes.
Summary:
This change is step three in the series of changes to remove alignment argument from
memcpy/memmove/memset in favour of alignment attributes. Steps:
Step 1) Remove alignment parameter and create alignment parameter attributes for
memcpy/memmove/memset. ( rL322965, rC322964, rL322963 )
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
source and dest alignments. ( rL323597 )
Step 3) Update Clang to use the new IRBuilder API.
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
and those that use use MemIntrinsicInst::[get|set]Alignment() to use getDestAlignment()
and getSourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
MemIntrinsicInst::[get|set]Alignment() methods.
Reference
http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html
Reviewers: rjmccall
Subscribers: jyknight, nemanjai, nhaehnle, javed.absar, sbc100, aheejin, kbarton, fedor.sergeev, cfe-commits
Differential Revision: https://reviews.llvm.org/D41677
llvm-svn: 323617
2018-01-29 01:27:45 +08:00
|
|
|
// IR: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* align 8 [[BITCAST]], i64 4
|
2014-05-08 01:41:15 +08:00
|
|
|
return bp11.b2;
|
|
|
|
}
|