2016-01-16 00:33:06 +08:00
|
|
|
; RUN: llc < %s -mtriple=armv7-apple-ios -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-IOS --check-prefix=CHECK
|
|
|
|
; RUN: llc < %s -mtriple=thumbv7m-none-macho -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-DARWIN --check-prefix=CHECK
|
|
|
|
; RUN: llc < %s -mtriple=arm-none-eabi -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI --check-prefix=CHECK
|
|
|
|
; RUN: llc < %s -mtriple=arm-none-eabihf -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI --check-prefix=CHECK
|
|
|
|
; RUN: llc < %s -mtriple=arm-none-androideabi -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI --check-prefix=CHECK
|
|
|
|
; RUN: llc < %s -mtriple=arm-none-gnueabi -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI --check-prefix=CHECK
|
|
|
|
; RUN: llc < %s -mtriple=arm-none-gnueabihf -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI --check-prefix=CHECK
|
2016-06-25 05:14:33 +08:00
|
|
|
; RUN: llc < %s -mtriple=arm-none-musleabi -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI --check-prefix=CHECK
|
|
|
|
; RUN: llc < %s -mtriple=arm-none-musleabihf -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI --check-prefix=CHECK
|
2011-05-23 05:41:23 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f1(i8* %dest, i8* %src) "no-frame-pointer-elim"="true" {
|
2006-12-06 01:57:23 +08:00
|
|
|
entry:
|
2015-03-18 20:01:59 +08:00
|
|
|
; CHECK-LABEL: f1
|
2011-05-23 05:41:23 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 0, i1 false)
|
2011-05-23 05:41:23 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 0, i1 false)
|
2011-05-23 05:41:23 +08:00
|
|
|
|
2015-03-18 20:01:59 +08:00
|
|
|
; EABI memset swaps arguments
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-IOS: mov r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-DARWIN: movs r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-EABI: mov r2, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memset
|
|
|
|
; CHECK-GNUEABI: mov r1, #1
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 0, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
|
|
|
; EABI uses memclr if value set to 0
|
2015-03-18 20:01:59 +08:00
|
|
|
; CHECK-IOS: mov r1, #0
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-03-18 20:01:59 +08:00
|
|
|
; CHECK-DARWIN: movs r1, #0
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
|
|
|
; CHECK-EABI: bl __aeabi_memclr
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 0, i1 false)
|
2015-11-09 20:40:30 +08:00
|
|
|
|
2015-05-12 21:13:38 +08:00
|
|
|
; EABI uses aligned function variants if possible
|
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove4
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 4, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy4
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 4, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
|
|
|
; CHECK-DARWIN: bl _memset
|
|
|
|
; CHECK-EABI: bl __aeabi_memset4
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 4, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
|
|
|
; CHECK-DARWIN: bl _memset
|
|
|
|
; CHECK-EABI: bl __aeabi_memclr4
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 4, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove8
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy8
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
|
|
|
; CHECK-DARWIN: bl _memset
|
|
|
|
; CHECK-EABI: bl __aeabi_memset8
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 8, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
|
|
|
; CHECK-DARWIN: bl _memset
|
|
|
|
; CHECK-EABI: bl __aeabi_memclr8
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 8, i1 false)
|
2015-05-12 21:13:38 +08:00
|
|
|
|
2015-03-18 20:01:59 +08:00
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; Check that alloca arguments to memory intrinsics are automatically aligned if at least 8 bytes in size
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f2(i8* %dest, i32 %n) "no-frame-pointer-elim"="true" {
|
2015-03-18 20:01:59 +08:00
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: f2
|
|
|
|
|
|
|
|
; IOS (ARMv7) should 8-byte align, others should 4-byte align
|
|
|
|
; CHECK-IOS: add r1, sp, #32
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
2015-03-18 20:01:59 +08:00
|
|
|
; CHECK-DARWIN: add r1, sp, #28
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memmove
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK-EABI: {{add r1, sp, #28|sub r1, r(7|11), #20}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memmove
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK-GNUEABI: {{add r1, sp, #28|sub r1, r(7|11), #20}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr0 = alloca [9 x i8], align 1
|
|
|
|
%0 = bitcast [9 x i8]* %arr0 to i8*
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
; CHECK: add r1, sp, #16
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr1 = alloca [9 x i8], align 1
|
|
|
|
%1 = bitcast [9 x i8]* %arr1 to i8*
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
; CHECK-IOS: mov r0, sp
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-IOS: mov r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-DARWIN: add r0, sp, #4
|
|
|
|
; CHECK-DARWIN: movs r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
2015-03-18 20:01:59 +08:00
|
|
|
; CHECK-EABI: add r0, sp, #4
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-EABI: mov r2, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memset
|
|
|
|
; CHECK-GNUEABI: add r0, sp, #4
|
|
|
|
; CHECK-GNUEABI: mov r1, #1
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr2 = alloca [9 x i8], align 1
|
|
|
|
%2 = bitcast [9 x i8]* %arr2 to i8*
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; Check that alloca arguments are not aligned if less than 8 bytes in size
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f3(i8* %dest, i32 %n) "no-frame-pointer-elim"="true" {
|
2015-03-18 20:01:59 +08:00
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: f3
|
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r1, sp, #17|sub(.w)? r1, r(7|11), #15}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr0 = alloca [7 x i8], align 1
|
|
|
|
%0 = bitcast [7 x i8]* %arr0 to i8*
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r1, sp, #10|sub(.w)? r1, r(7|11), #22}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr1 = alloca [7 x i8], align 1
|
|
|
|
%1 = bitcast [7 x i8]* %arr1 to i8*
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r0, sp, #3|sub(.w)? r0, r(7|11), #29}}
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-IOS: mov r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-DARWIN: movs r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-EABI: mov r2, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memset
|
|
|
|
; CHECK-GNUEABI: mov r1, #1
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr2 = alloca [7 x i8], align 1
|
|
|
|
%2 = bitcast [7 x i8]* %arr2 to i8*
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; Check that alloca arguments are not aligned if size+offset is less than 8 bytes
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f4(i8* %dest, i32 %n) "no-frame-pointer-elim"="true" {
|
2015-03-18 20:01:59 +08:00
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: f4
|
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #23|sub(.w)? r., r(7|11), #17}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr0 = alloca [9 x i8], align 1
|
|
|
|
%0 = getelementptr inbounds [9 x i8], [9 x i8]* %arr0, i32 0, i32 4
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(10|14)|sub(.w) r., r(7|11), #26}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr1 = alloca [9 x i8], align 1
|
|
|
|
%1 = getelementptr inbounds [9 x i8], [9 x i8]* %arr1, i32 0, i32 4
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(1|5)|sub(.w) r., r(7|11), #35}}
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-IOS: mov r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-DARWIN: movs r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-EABI: mov r2, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memset
|
|
|
|
; CHECK-GNUEABI: mov r1, #1
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr2 = alloca [9 x i8], align 1
|
|
|
|
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %arr2, i32 0, i32 4
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; Check that alloca arguments are not aligned if the offset is not a multiple of 4
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f5(i8* %dest, i32 %n) "no-frame-pointer-elim"="true" {
|
2015-03-18 20:01:59 +08:00
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: f5
|
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #27|sub(.w)? r., r(7|11), #21}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr0 = alloca [13 x i8], align 1
|
|
|
|
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 1
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(10|14)|sub(.w)? r., r(7|11), #34}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr1 = alloca [13 x i8], align 1
|
|
|
|
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 1
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(1|5)|sub(.w)? r., r(7|11), #47}}
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-IOS: mov r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-DARWIN: movs r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-EABI: mov r2, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memset
|
|
|
|
; CHECK-GNUEABI: mov r1, #1
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr2 = alloca [13 x i8], align 1
|
|
|
|
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 1
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; Check that alloca arguments are not aligned if the offset is unknown
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f6(i8* %dest, i32 %n, i32 %i) "no-frame-pointer-elim"="true" {
|
2015-03-18 20:01:59 +08:00
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: f6
|
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #27|sub(.w)? r., r(7|11), #(25|29)}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr0 = alloca [13 x i8], align 1
|
|
|
|
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 %i
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(10|14)|sub(.w)? r., r(7|11), #42}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr1 = alloca [13 x i8], align 1
|
|
|
|
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 %i
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(1|5)|sub(.w)? r., r(7|11), #55}}
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-IOS: mov r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-DARWIN: movs r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-EABI: mov r2, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memset
|
|
|
|
; CHECK-GNUEABI: mov r1, #1
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr2 = alloca [13 x i8], align 1
|
|
|
|
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 %i
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; Check that alloca arguments are not aligned if the GEP is not inbounds
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f7(i8* %dest, i32 %n) "no-frame-pointer-elim"="true" {
|
2015-03-18 20:01:59 +08:00
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: f7
|
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #27|sub(.w)? r., r(7|11), #21}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr0 = alloca [13 x i8], align 1
|
|
|
|
%0 = getelementptr [13 x i8], [13 x i8]* %arr0, i32 0, i32 4
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(10|14)|sub(.w)? r., r(7|11), #34}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr1 = alloca [13 x i8], align 1
|
|
|
|
%1 = getelementptr [13 x i8], [13 x i8]* %arr1, i32 0, i32 4
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(1|5)|sub(.w)? r., r(7|11), #47}}
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-IOS: mov r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-DARWIN: movs r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-EABI: mov r2, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memset
|
|
|
|
; CHECK-GNUEABI: mov r1, #1
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr2 = alloca [13 x i8], align 1
|
|
|
|
%2 = getelementptr [13 x i8], [13 x i8]* %arr2, i32 0, i32 4
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; Check that alloca arguments are not aligned when the offset is past the end of the allocation
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f8(i8* %dest, i32 %n) "no-frame-pointer-elim"="true" {
|
2015-03-18 20:01:59 +08:00
|
|
|
entry:
|
|
|
|
; CHECK-LABEL: f8
|
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #27|sub(.w)? r., r(7|11), #21}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memmove
|
|
|
|
; CHECK-DARWIN: bl _memmove
|
|
|
|
; CHECK-EABI: bl __aeabi_memmove
|
|
|
|
; CHECK-GNUEABI: bl memmove
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr0 = alloca [13 x i8], align 1
|
|
|
|
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 16
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(10|14)|sub(.w)? r., r(7|11), #34}}
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memcpy
|
|
|
|
; CHECK-DARWIN: bl _memcpy
|
|
|
|
; CHECK-EABI: bl __aeabi_memcpy
|
|
|
|
; CHECK-GNUEABI: bl memcpy
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr1 = alloca [13 x i8], align 1
|
|
|
|
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 16
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
; CHECK: {{add(.w)? r., sp, #(1|5)|sub(.w)? r., r(7|11), #47}}
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-IOS: mov r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-IOS: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-DARWIN: movs r1, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-DARWIN: bl _memset
|
2015-05-12 21:13:38 +08:00
|
|
|
; CHECK-EABI: mov r2, #1
|
2015-11-09 20:40:30 +08:00
|
|
|
; CHECK-EABI: bl __aeabi_memset
|
|
|
|
; CHECK-GNUEABI: mov r1, #1
|
|
|
|
; CHECK-GNUEABI: bl memset
|
2015-03-18 20:01:59 +08:00
|
|
|
%arr2 = alloca [13 x i8], align 1
|
|
|
|
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 16
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
|
2015-03-18 20:01:59 +08:00
|
|
|
|
|
|
|
unreachable
|
2006-12-06 01:57:23 +08:00
|
|
|
}
|
|
|
|
|
2015-04-13 18:47:39 +08:00
|
|
|
; Check that global variables are aligned if they are large enough, but only if
|
|
|
|
; they are defined in this object and don't have an explicit section.
|
|
|
|
@arr1 = global [7 x i8] c"\01\02\03\04\05\06\07", align 1
|
|
|
|
@arr2 = global [8 x i8] c"\01\02\03\04\05\06\07\08", align 1
|
|
|
|
@arr3 = global [7 x i8] c"\01\02\03\04\05\06\07", section "foo,bar", align 1
|
|
|
|
@arr4 = global [8 x i8] c"\01\02\03\04\05\06\07\08", section "foo,bar", align 1
|
|
|
|
@arr5 = weak global [7 x i8] c"\01\02\03\04\05\06\07", align 1
|
|
|
|
@arr6 = weak_odr global [7 x i8] c"\01\02\03\04\05\06\07", align 1
|
|
|
|
@arr7 = external global [7 x i8], align 1
|
2016-07-19 02:28:52 +08:00
|
|
|
@arr8 = internal global [128 x i8] undef
|
|
|
|
@arr9 = weak_odr global [128 x i8] undef
|
[ARM] Generate consistent frame records for Thumb2
There is not an official documented ABI for frame pointers in Thumb2,
but we should try to emit something which is useful.
We use r7 as the frame pointer for Thumb code, which currently means
that if a function needs to save a high register (r8-r11), it will get
pushed to the stack between the frame pointer (r7) and link register
(r14). This means that while a stack unwinder can follow the chain of
frame pointers up the stack, it cannot know the offset to lr, so does
not know which functions correspond to the stack frames.
To fix this, we need to push the callee-saved registers in two batches,
with the first push saving the low registers, fp and lr, and the second
push saving the high registers. This is already implemented, but
previously only used for iOS. This patch turns it on for all Thumb2
targets when frame pointers are required by the ABI, and the frame
pointer is r7 (Windows uses r11, so this isn't a problem there). If
frame pointer elimination is enabled we still emit a single push/pop
even if we need a frame pointer for other reasons, to avoid increasing
code size.
We must also ensure that lr is pushed to the stack when using a frame
pointer, so that we end up with a complete frame record. Situations that
could cause this were rare, because we already push lr in most
situations so that we can return using the pop instruction.
Differential Revision: https://reviews.llvm.org/D23516
llvm-svn: 279506
2016-08-23 17:19:22 +08:00
|
|
|
define void @f9(i8* %dest, i32 %n) "no-frame-pointer-elim"="true" {
|
2015-04-13 18:47:39 +08:00
|
|
|
entry:
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr1, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @arr2, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr3, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @arr4, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr5, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr6, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @arr7, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
2016-07-19 02:28:52 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @arr8, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @arr9, i32 0, i32 0), i32 %n, i32 1, i1 false)
|
2015-04-13 18:47:39 +08:00
|
|
|
|
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: {{\.data|\.section.+data}}
|
2016-01-26 08:03:25 +08:00
|
|
|
; CHECK-NOT: .p2align
|
2015-04-13 18:47:39 +08:00
|
|
|
; CHECK: arr1:
|
2016-01-26 08:03:25 +08:00
|
|
|
; CHECK-IOS: .p2align 3
|
|
|
|
; CHECK-DARWIN: .p2align 2
|
|
|
|
; CHECK-EABI-NOT: .p2align
|
|
|
|
; CHECK-GNUEABI-NOT: .p2align
|
2015-04-13 18:47:39 +08:00
|
|
|
; CHECK: arr2:
|
|
|
|
; CHECK: {{\.section.+foo,bar}}
|
2016-01-26 08:03:25 +08:00
|
|
|
; CHECK-NOT: .p2align
|
2015-04-13 18:47:39 +08:00
|
|
|
; CHECK: arr3:
|
2016-01-26 08:03:25 +08:00
|
|
|
; CHECK-NOT: .p2align
|
2015-04-13 18:47:39 +08:00
|
|
|
; CHECK: arr4:
|
|
|
|
; CHECK: {{\.data|\.section.+data}}
|
2016-01-26 08:03:25 +08:00
|
|
|
; CHECK-NOT: .p2align
|
2015-04-13 18:47:39 +08:00
|
|
|
; CHECK: arr5:
|
2016-01-26 08:03:25 +08:00
|
|
|
; CHECK-NOT: .p2align
|
2015-04-13 18:47:39 +08:00
|
|
|
; CHECK: arr6:
|
2016-07-19 02:28:52 +08:00
|
|
|
; CHECK: .p2align 4
|
|
|
|
; CHECK: arr8:
|
|
|
|
; CHECK: .p2align 4
|
|
|
|
; CHECK: arr9:
|
|
|
|
|
2015-04-13 18:47:39 +08:00
|
|
|
; CHECK-NOT: arr7:
|
|
|
|
|
2015-11-19 13:56:52 +08:00
|
|
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
|
|
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
|
|
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|