llvm.org GIT mirror llvm / 3372c78
[X86] Add test case from PR34292 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352274 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 1 year, 4 months ago
1 changed file(s) with 57 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=CHECK,X64
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+adx | FileCheck %s --check-prefixes=CHECK,ADX
3
4 ; PR34292
5 @_ZL1c = external global i8
6 define void @sum_unroll(i64* nocapture readonly, i64* nocapture) {
7 ; CHECK-LABEL: sum_unroll:
8 ; CHECK: # %bb.0:
9 ; CHECK-NEXT: movb {{.*}}(%rip), %al
10 ; CHECK-NEXT: movq (%rdi), %rcx
11 ; CHECK-NEXT: addb $-1, %al
12 ; CHECK-NEXT: adcq %rcx, (%rsi)
13 ; CHECK-NEXT: movq 8(%rdi), %rax
14 ; CHECK-NEXT: adcq %rax, 8(%rsi)
15 ; CHECK-NEXT: movq 16(%rdi), %rax
16 ; CHECK-NEXT: adcq %rax, 16(%rsi)
17 ; CHECK-NEXT: movq 24(%rdi), %rax
18 ; CHECK-NEXT: adcq %rax, 24(%rsi)
19 ; CHECK-NEXT: setb {{.*}}(%rip)
20 ; CHECK-NEXT: retq
21 %3 = load i8, i8* @_ZL1c, align 1
22 %4 = load i64, i64* %0, align 8
23 %5 = load i64, i64* %1, align 8
24 %6 = tail call { i8, i64 } @llvm.x86.addcarry.64(i8 %3, i64 %4, i64 %5)
25 %7 = extractvalue { i8, i64 } %6, 1
26 store i64 %7, i64* %1, align 8
27 %8 = extractvalue { i8, i64 } %6, 0
28 %9 = getelementptr inbounds i64, i64* %0, i64 1
29 %10 = load i64, i64* %9, align 8
30 %11 = getelementptr inbounds i64, i64* %1, i64 1
31 %12 = load i64, i64* %11, align 8
32 %13 = tail call { i8, i64 } @llvm.x86.addcarry.64(i8 %8, i64 %10, i64 %12)
33 %14 = extractvalue { i8, i64 } %13, 1
34 store i64 %14, i64* %11, align 8
35 %15 = extractvalue { i8, i64 } %13, 0
36 %16 = getelementptr inbounds i64, i64* %0, i64 2
37 %17 = load i64, i64* %16, align 8
38 %18 = getelementptr inbounds i64, i64* %1, i64 2
39 %19 = load i64, i64* %18, align 8
40 %20 = tail call { i8, i64 } @llvm.x86.addcarry.64(i8 %15, i64 %17, i64 %19)
41 %21 = extractvalue { i8, i64 } %20, 1
42 store i64 %21, i64* %18, align 8
43 %22 = extractvalue { i8, i64 } %20, 0
44 %23 = getelementptr inbounds i64, i64* %0, i64 3
45 %24 = load i64, i64* %23, align 8
46 %25 = getelementptr inbounds i64, i64* %1, i64 3
47 %26 = load i64, i64* %25, align 8
48 %27 = tail call { i8, i64 } @llvm.x86.addcarry.64(i8 %22, i64 %24, i64 %26)
49 %28 = extractvalue { i8, i64 } %27, 1
50 store i64 %28, i64* %25, align 8
51 %29 = extractvalue { i8, i64 } %27, 0
52 store i8 %29, i8* @_ZL1c, align 1
53 ret void
54 }
55
56 declare { i8, i64 } @llvm.x86.addcarry.64(i8, i64, i64)