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 --pipeliner-force-ii=4 2>&1 | FileCheck %s
5 define void @main() nounwind #0 {
9 ; CHECK-NEXT: std 30, -16(1) # 8-byte Folded Spill
10 ; CHECK-NEXT: stdu 1, -48(1)
11 ; CHECK-NEXT: std 0, 64(1)
12 ; CHECK-NEXT: bl strtol
14 ; CHECK-NEXT: mr 30, 3
15 ; CHECK-NEXT: bl calloc
17 ; CHECK-NEXT: clrldi 4, 30, 32
19 ; CHECK-NEXT: addi 3, 3, -4
21 ; CHECK-NEXT: mullw 4, 5, 5
23 ; CHECK-NEXT: bdz .LBB0_3
24 ; CHECK-NEXT: # %bb.1:
25 ; CHECK-NEXT: stwu 4, 4(3)
26 ; CHECK-NEXT: mullw 4, 6, 6
27 ; CHECK-NEXT: addi 5, 6, 1
28 ; CHECK-NEXT: bdz .LBB0_3
29 ; CHECK-NEXT: .p2align 4
30 ; CHECK-NEXT: .LBB0_2:
31 ; CHECK-NEXT: stwu 4, 4(3)
32 ; CHECK-NEXT: mullw 4, 5, 5
33 ; CHECK-NEXT: addi 5, 5, 1
34 ; CHECK-NEXT: bdnz .LBB0_2
35 ; CHECK-NEXT: .LBB0_3:
36 ; CHECK-NEXT: stwu 4, 4(3)
37 ; CHECK-NEXT: addi 1, 1, 48
38 ; CHECK-NEXT: ld 0, 16(1)
39 ; CHECK-NEXT: ld 30, -16(1) # 8-byte Folded Reload
42 %1 = tail call i64 @strtol()
43 %2 = trunc i64 %1 to i32
44 %3 = tail call noalias i8* @calloc()
45 %4 = bitcast i8* %3 to i32*
46 %5 = zext i32 %2 to i64
50 %7 = phi i64 [ %11, %6 ], [ 0, %0 ]
51 %8 = trunc i64 %7 to i32
52 %9 = mul nsw i32 %8, %8
53 %10 = getelementptr inbounds i32, i32* %4, i64 %7
54 store i32 %9, i32* %10, align 4
55 %11 = add nuw nsw i64 %7, 1
56 %12 = icmp eq i64 %11, %5
57 br i1 %12, label %13, label %6
63 declare i8* @calloc() local_unnamed_addr
64 declare i64 @strtol() local_unnamed_addr