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:
11 ; CHECK-NEXT: std 0, 16(1)
12 ; CHECK-NEXT: stdu 1, -128(1)
13 ; CHECK-NEXT: lwz 3, 0(3)
14 ; CHECK-NEXT: addi 3, 3, -1
15 ; CHECK-NEXT: clrldi 4, 3, 32
16 ; CHECK-NEXT: cmplwi 0, 3, 1
18 ; CHECK-NEXT: isel 3, 4, 3, 1
20 ; CHECK-NEXT: addi 3, 3, -1
21 ; CHECK-NEXT: cmpldi 3, 2
22 ; CHECK-NEXT: isel 3, 3, 4, 0
24 ; CHECK-NEXT: addi 3, 3, 1
26 ; CHECK-NEXT: li 7, -1
28 ; CHECK-NEXT: lbz 5, 0(5)
30 ; CHECK-NEXT: bdz .LBB0_6
31 ; CHECK-NEXT: # %bb.1:
32 ; CHECK-NEXT: xori 6, 5, 84
33 ; CHECK-NEXT: clrldi 5, 7, 32
34 ; CHECK-NEXT: lbz 5, 0(5)
35 ; CHECK-NEXT: addi 3, 3, 1
36 ; CHECK-NEXT: addi 8, 7, -1
37 ; CHECK-NEXT: bdz .LBB0_5
38 ; CHECK-NEXT: # %bb.2:
39 ; CHECK-NEXT: cntlzw 6, 6
40 ; CHECK-NEXT: srwi 7, 6, 5
41 ; CHECK-NEXT: xori 6, 5, 84
42 ; CHECK-NEXT: clrldi 5, 8, 32
43 ; CHECK-NEXT: addi 8, 8, -1
44 ; CHECK-NEXT: lbz 5, 0(5)
45 ; CHECK-NEXT: addi 3, 3, 1
46 ; CHECK-NEXT: bdz .LBB0_4
47 ; CHECK-NEXT: .p2align 4
48 ; CHECK-NEXT: .LBB0_3: #
49 ; CHECK-NEXT: clrldi 10, 8, 32
50 ; CHECK-NEXT: cntlzw 9, 6
51 ; CHECK-NEXT: xori 6, 5, 84
52 ; CHECK-NEXT: lbz 5, 0(10)
53 ; CHECK-NEXT: addi 8, 8, -1
54 ; CHECK-NEXT: addi 3, 3, 1
55 ; CHECK-NEXT: add 4, 4, 7
56 ; CHECK-NEXT: srwi 7, 9, 5
57 ; CHECK-NEXT: bdnz .LBB0_3
58 ; CHECK-NEXT: .LBB0_4:
59 ; CHECK-NEXT: add 4, 4, 7
60 ; CHECK-NEXT: .LBB0_5:
61 ; CHECK-NEXT: cntlzw 6, 6
62 ; CHECK-NEXT: srwi 6, 6, 5
63 ; CHECK-NEXT: add 4, 4, 6
64 ; CHECK-NEXT: .LBB0_6:
65 ; CHECK-NEXT: xori 5, 5, 84
66 ; CHECK-NEXT: cntlzw 5, 5
67 ; CHECK-NEXT: clrldi 3, 3, 32
68 ; CHECK-NEXT: std 3, 104(1)
69 ; CHECK-NEXT: addis 3, 2, .LC0@toc@ha
70 ; CHECK-NEXT: ld 3, .LC0@toc@l(3)
73 ; CHECK-NEXT: srwi 5, 5, 5
74 ; CHECK-NEXT: add 4, 4, 5
76 ; CHECK-NEXT: std 5, 120(1)
78 ; CHECK-NEXT: std 5, 96(1)
79 ; CHECK-NEXT: clrldi 6, 4, 32
82 ; CHECK-NEXT: li 10, 0
83 ; CHECK-NEXT: bl printf
85 %1 = load i32, i32* undef, align 4
87 %3 = zext i32 %2 to i64
88 %4 = zext i32 3 to i64
92 %6 = phi i64 [ %16, %5 ], [ 0, %0 ]
93 %7 = phi i32 [ %15, %5 ], [ 0, %0 ]
94 %8 = trunc i64 %6 to i32
96 %10 = zext i32 %9 to i64
97 %11 = getelementptr inbounds i8, i8* null, i64 %10
98 %12 = load i8, i8* %11, align 1
99 %13 = icmp eq i8 %12, 84
100 %14 = zext i1 %13 to i32
101 %15 = add i32 %7, %14
102 %16 = add nuw nsw i64 %6, 1
103 %17 = icmp ult i64 %16, %3
104 %18 = icmp ult i64 %16, %4
105 %19 = and i1 %18, %17
106 br i1 %19, label %5, label %20
109 %21 = trunc i64 %16 to i32
110 call void (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.28, i64 0, i64 0), i32 zeroext 3, i32 zeroext undef, i32 zeroext %15, i32 zeroext undef, i32 zeroext 3, i8* undef, i32 zeroext undef, i32 zeroext 3, i32 zeroext %21, i8* undef, i32 zeroext undef) #1
114 declare void @printf(i8*, ...) local_unnamed_addr #0