1 ; RUN: llc -mtriple=arm64-apple-ios -mattr=+strict-align < %s | FileCheck %s
3 ; Small (16 bytes here) unaligned memcpy() should be a function call if
4 ; strict-alignment is turned on.
5 define void @t0(i8* %out, i8* %in) {
8 ; CHECK-NEXT: bl _memcpy
10 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %out, i8* %in, i64 16, i1 false)
14 ; Small (16 bytes here) aligned memcpy() should be inlined even if
15 ; strict-alignment is turned on.
16 define void @t1(i8* align 8 %out, i8* align 8 %in) {
18 ; CHECK: ldp x{{[0-9]+}}, x{{[0-9]+}}, [x1]
19 ; CHECK-NEXT: stp x{{[0-9]+}}, x{{[0-9]+}}, [x0]
21 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 8 %out, i8* align 8 %in, i64 16, i1 false)
25 ; Tiny (4 bytes here) unaligned memcpy() should be inlined with byte sized
26 ; loads and stores if strict-alignment is turned on.
27 define void @t2(i8* %out, i8* %in) {
29 ; CHECK: ldrb w{{[0-9]+}}, [x1, #3]
30 ; CHECK-NEXT: ldrb w{{[0-9]+}}, [x1, #2]
31 ; CHECK-NEXT: ldrb w{{[0-9]+}}, [x1, #1]
32 ; CHECK-NEXT: ldrb w{{[0-9]+}}, [x1]
33 ; CHECK-NEXT: strb w{{[0-9]+}}, [x0, #3]
34 ; CHECK-NEXT: strb w{{[0-9]+}}, [x0, #2]
35 ; CHECK-NEXT: strb w{{[0-9]+}}, [x0, #1]
36 ; CHECK-NEXT: strb w{{[0-9]+}}, [x0]
38 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %out, i8* %in, i64 4, i1 false)
42 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i1)