1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names \
3 ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
4 define dso_local void @test(ptr nocapture %fp, i32 signext %Arg, i32 signext %Len) local_unnamed_addr #0 {
6 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: .cfi_def_cfa_offset 64
9 ; CHECK-NEXT: .cfi_offset lr, 16
10 ; CHECK-NEXT: .cfi_offset r28, -32
11 ; CHECK-NEXT: .cfi_offset r29, -24
12 ; CHECK-NEXT: .cfi_offset r30, -16
13 ; CHECK-NEXT: std r28, -32(r1) # 8-byte Folded Spill
14 ; CHECK-NEXT: std r29, -24(r1) # 8-byte Folded Spill
15 ; CHECK-NEXT: std r30, -16(r1) # 8-byte Folded Spill
16 ; CHECK-NEXT: stdu r1, -64(r1)
17 ; CHECK-NEXT: cmpwi r5, 1
18 ; CHECK-NEXT: mr r29, r4
19 ; CHECK-NEXT: std r2, 24(r1)
20 ; CHECK-NEXT: std r0, 80(r1)
21 ; CHECK-NEXT: mr r30, r3
22 ; CHECK-NEXT: bc 12, lt, .LBB0_4
23 ; CHECK-NEXT: # %bb.1: # %entry
24 ; CHECK-NEXT: cmpwi r29, 11
25 ; CHECK-NEXT: bc 12, lt, .LBB0_4
26 ; CHECK-NEXT: # %bb.2: # %for.body.us.preheader
27 ; CHECK-NEXT: addi r3, r5, -1
28 ; CHECK-NEXT: clrldi r3, r3, 32
29 ; CHECK-NEXT: addi r28, r3, 1
30 ; CHECK-NEXT: .p2align 5
31 ; CHECK-NEXT: .LBB0_3: # %for.body.us
33 ; CHECK-NEXT: mtctr r30
34 ; CHECK-NEXT: mr r3, r29
35 ; CHECK-NEXT: mr r12, r30
37 ; CHECK-NEXT: ld 2, 24(r1)
38 ; CHECK-NEXT: addi r28, r28, -1
39 ; CHECK-NEXT: cmpldi r28, 0
40 ; CHECK-NEXT: bc 12, gt, .LBB0_3
41 ; CHECK-NEXT: .LBB0_4: # %for.cond.cleanup
42 ; CHECK-NEXT: mtctr r30
43 ; CHECK-NEXT: mr r3, r29
44 ; CHECK-NEXT: mr r12, r30
46 ; CHECK-NEXT: ld 2, 24(r1)
47 ; CHECK-NEXT: addi r1, r1, 64
48 ; CHECK-NEXT: ld r0, 16(r1)
49 ; CHECK-NEXT: ld r30, -16(r1) # 8-byte Folded Reload
50 ; CHECK-NEXT: ld r29, -24(r1) # 8-byte Folded Reload
51 ; CHECK-NEXT: ld r28, -32(r1) # 8-byte Folded Reload
55 %cmp7 = icmp sgt i32 %Len, 0
56 %cmp1 = icmp sgt i32 %Arg, 10
57 %or.cond = and i1 %cmp7, %cmp1
58 br i1 %or.cond, label %for.body.us, label %for.cond.cleanup
60 for.body.us: ; preds = %entry, %for.body.us
61 %i.08.us = phi i32 [ %inc.us, %for.body.us ], [ 0, %entry ]
62 tail call void %fp(i32 signext %Arg) #1
63 %inc.us = add nuw nsw i32 %i.08.us, 1
64 %exitcond = icmp eq i32 %inc.us, %Len
65 br i1 %exitcond, label %for.cond.cleanup, label %for.body.us
67 for.cond.cleanup: ; preds = %for.body.us, %entry
68 tail call void %fp(i32 signext %Arg) #1