1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=avx | FileCheck %s
3 define i8 @test_offset(ptr %base) {
4 ; CHECK-LABEL: test_offset:
5 ; CHECK: # %bb.0: # %entry
6 ; CHECK-NEXT: pushq %rax
7 ; CHECK-NEXT: .cfi_def_cfa_offset 16
8 ; CHECK-NEXT: movb $0, 7(%rdi)
9 ; CHECK-NEXT: movw $0, 5(%rdi)
10 ; CHECK-NEXT: movl $0, 1(%rdi)
11 ; CHECK-NEXT: movl -4(%rdi), %eax
12 ; CHECK-NEXT: movl %eax, -{{[0-9]+}}(%rsp)
13 ; CHECK-NEXT: movzbl (%rdi), %eax
14 ; CHECK-NEXT: movb %al, -{{[0-9]+}}(%rsp)
15 ; CHECK-NEXT: movl 1(%rdi), %eax
16 ; CHECK-NEXT: movl %eax, -{{[0-9]+}}(%rsp)
17 ; CHECK-NEXT: movzwl 5(%rdi), %eax
18 ; CHECK-NEXT: movw %ax, -{{[0-9]+}}(%rsp)
19 ; CHECK-NEXT: movzbl 7(%rdi), %eax
20 ; CHECK-NEXT: movb %al, -{{[0-9]+}}(%rsp)
21 ; CHECK-NEXT: movl 8(%rdi), %eax
22 ; CHECK-NEXT: movl %eax, -{{[0-9]+}}(%rsp)
23 ; CHECK-NEXT: movzbl -{{[0-9]+}}(%rsp), %eax
24 ; CHECK-NEXT: popq %rcx
25 ; CHECK-NEXT: .cfi_def_cfa_offset 8
28 %z = alloca [128 x i8], align 16
29 %gep0 = getelementptr inbounds i8, ptr %base, i64 7
30 store volatile i8 0, ptr %gep0
31 %gep1 = getelementptr inbounds i8, ptr %base, i64 5
32 store volatile i16 0, ptr %gep1
33 %gep2 = getelementptr inbounds i8, ptr %base, i64 1
34 store volatile i32 0, ptr %gep2
36 %y1 = getelementptr inbounds i8, ptr %base, i64 -4
37 call void @llvm.memcpy.p0.p0.i64(ptr %z, ptr %y1, i64 16, i1 false)
39 %gep4 = getelementptr inbounds [128 x i8], ptr %z, i64 0, i64 4
40 %ret = load i8, ptr %gep4
44 ; Function Attrs: argmemonly nounwind
45 declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)