1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -verify-machineinstrs\
3 ; RUN: -mcpu=pwr9 --ppc-enable-pipeliner 2>&1 | FileCheck %s
5 @.str.28 = external unnamed_addr constant [69 x i8], align 1
7 define void @print_res() nounwind {
8 ; CHECK-LABEL: print_res:
10 ; CHECK-NEXT: lwz 3, 0(3)
12 ; CHECK-NEXT: addi 3, 3, -1
13 ; CHECK-NEXT: clrldi 4, 3, 32
14 ; CHECK-NEXT: cmplwi 3, 3
16 ; CHECK-NEXT: isellt 3, 4, 3
18 ; CHECK-NEXT: cmpldi 3, 1
19 ; CHECK-NEXT: iselgt 3, 3, 4
22 ; CHECK-NEXT: stdu 1, -128(1)
24 ; CHECK-NEXT: std 0, 144(1)
26 ; CHECK-NEXT: li 7, -1
27 ; CHECK-NEXT: lbz 5, 0(5)
28 ; CHECK-NEXT: bdz .LBB0_6
29 ; CHECK-NEXT: # %bb.1:
30 ; CHECK-NEXT: xori 6, 5, 84
31 ; CHECK-NEXT: clrldi 5, 7, 32
32 ; CHECK-NEXT: addi 3, 3, 1
33 ; CHECK-NEXT: addi 8, 7, -1
34 ; CHECK-NEXT: lbz 5, 0(5)
35 ; CHECK-NEXT: bdz .LBB0_5
36 ; CHECK-NEXT: # %bb.2:
37 ; CHECK-NEXT: cntlzw 6, 6
38 ; CHECK-NEXT: addi 3, 3, 1
39 ; CHECK-NEXT: srwi 7, 6, 5
40 ; CHECK-NEXT: xori 6, 5, 84
41 ; CHECK-NEXT: clrldi 5, 8, 32
42 ; CHECK-NEXT: addi 8, 8, -1
43 ; CHECK-NEXT: lbz 5, 0(5)
44 ; CHECK-NEXT: bdz .LBB0_4
45 ; CHECK-NEXT: .p2align 4
46 ; CHECK-NEXT: .LBB0_3:
47 ; CHECK-NEXT: clrldi 10, 8, 32
48 ; CHECK-NEXT: cntlzw 9, 6
49 ; CHECK-NEXT: xori 6, 5, 84
50 ; CHECK-NEXT: addi 8, 8, -1
51 ; CHECK-NEXT: lbz 5, 0(10)
52 ; CHECK-NEXT: addi 3, 3, 1
53 ; CHECK-NEXT: add 4, 4, 7
54 ; CHECK-NEXT: srwi 7, 9, 5
55 ; CHECK-NEXT: bdnz .LBB0_3
56 ; CHECK-NEXT: .LBB0_4:
57 ; CHECK-NEXT: add 4, 4, 7
58 ; CHECK-NEXT: .LBB0_5:
59 ; CHECK-NEXT: cntlzw 6, 6
60 ; CHECK-NEXT: srwi 6, 6, 5
61 ; CHECK-NEXT: add 4, 4, 6
62 ; CHECK-NEXT: .LBB0_6:
63 ; CHECK-NEXT: xori 5, 5, 84
64 ; CHECK-NEXT: clrldi 3, 3, 32
67 ; CHECK-NEXT: std 3, 104(1)
68 ; CHECK-NEXT: cntlzw 5, 5
69 ; CHECK-NEXT: addis 3, 2, .LC0@toc@ha
70 ; CHECK-NEXT: li 10, 0
71 ; CHECK-NEXT: ld 3, .LC0@toc@l(3)
72 ; CHECK-NEXT: srwi 5, 5, 5
73 ; CHECK-NEXT: add 4, 4, 5
75 ; CHECK-NEXT: std 5, 120(1)
77 ; CHECK-NEXT: clrldi 6, 4, 32
79 ; CHECK-NEXT: std 5, 96(1)
81 ; CHECK-NEXT: bl printf
83 %1 = load i32, ptr undef, align 4
85 %3 = zext i32 %2 to i64
86 %4 = zext i32 3 to i64
90 %6 = phi i64 [ %16, %5 ], [ 0, %0 ]
91 %7 = phi i32 [ %15, %5 ], [ 0, %0 ]
92 %8 = trunc i64 %6 to i32
94 %10 = zext i32 %9 to i64
95 %11 = getelementptr inbounds i8, ptr null, i64 %10
96 %12 = load i8, ptr %11, align 1
97 %13 = icmp eq i8 %12, 84
98 %14 = zext i1 %13 to i32
100 %16 = add nuw nsw i64 %6, 1
101 %17 = icmp ult i64 %16, %3
102 %18 = icmp ult i64 %16, %4
103 %19 = and i1 %18, %17
104 br i1 %19, label %5, label %20
107 %21 = trunc i64 %16 to i32
108 call void (ptr, ...) @printf(ptr @.str.28, i32 zeroext 3, i32 zeroext undef, i32 zeroext %15, i32 zeroext undef, i32 zeroext 3, ptr undef, i32 zeroext undef, i32 zeroext 3, i32 zeroext %21, ptr undef, i32 zeroext undef) #1
112 declare void @printf(ptr, ...) local_unnamed_addr #0