1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s -check-prefix=X64
3 ; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s -check-prefix=X86
5 %struct.SA = type { i32 , i32 , i32 , i32 ,i32 }
7 define void @test_func(%struct.SA* nocapture %ctx, i32 %n) local_unnamed_addr {
8 ; X64-LABEL: test_func:
9 ; X64: # %bb.0: # %entry
10 ; X64-NEXT: movl (%rdi), %eax
11 ; X64-NEXT: movl 16(%rdi), %ecx
12 ; X64-NEXT: leal (%rax,%rcx), %edx
13 ; X64-NEXT: leal 1(%rax,%rcx), %eax
14 ; X64-NEXT: movl %eax, 12(%rdi)
15 ; X64-NEXT: leal 1(%rcx,%rdx), %eax
16 ; X64-NEXT: movl %eax, 16(%rdi)
19 ; X86-LABEL: test_func:
20 ; X86: # %bb.0: # %entry
21 ; X86-NEXT: pushl %esi
22 ; X86-NEXT: .cfi_def_cfa_offset 8
23 ; X86-NEXT: .cfi_offset %esi, -8
24 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
25 ; X86-NEXT: movl (%eax), %ecx
26 ; X86-NEXT: movl 16(%eax), %edx
27 ; X86-NEXT: leal 1(%ecx,%edx), %esi
28 ; X86-NEXT: addl %edx, %ecx
29 ; X86-NEXT: movl %esi, 12(%eax)
30 ; X86-NEXT: leal 1(%edx,%ecx), %ecx
31 ; X86-NEXT: movl %ecx, 16(%eax)
33 ; X86-NEXT: .cfi_def_cfa_offset 4
36 %h0 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 0
37 %0 = load i32, i32* %h0, align 8
38 %h3 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 3
39 %h4 = getelementptr inbounds %struct.SA, %struct.SA* %ctx, i64 0, i32 4
40 %1 = load i32, i32* %h4, align 8
42 %add4 = add i32 %add, %1
43 store i32 %add4, i32* %h3, align 4
44 %add29 = add i32 %add4 , %1
45 store i32 %add29, i32* %h4, align 8