1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O3 -mcpu=pwr9 -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
4 define dso_local void @wibble(ptr nocapture readonly %arg, i32 signext %arg1, ptr nocapture %arg2, ptr nocapture %arg3) {
6 ; CHECK: # %bb.0: # %bb
7 ; CHECK-NEXT: lfs 0, 0(3)
9 ; CHECK-NEXT: cmpwi 4, 2
10 ; CHECK-NEXT: xsaddsp 0, 0, 0
11 ; CHECK-NEXT: blt 0, .LBB0_5
12 ; CHECK-NEXT: # %bb.1: # %bb6
13 ; CHECK-NEXT: clrldi 4, 4, 32
14 ; CHECK-NEXT: addi 4, 4, -1
17 ; CHECK-NEXT: b .LBB0_3
18 ; CHECK-NEXT: .p2align 5
19 ; CHECK-NEXT: .LBB0_2: # %bb11
21 ; CHECK-NEXT: iselgt 7, 4, 7
22 ; CHECK-NEXT: addi 4, 4, 1
23 ; CHECK-NEXT: bdz .LBB0_5
24 ; CHECK-NEXT: .LBB0_3: # %bb11
26 ; CHECK-NEXT: lfsu 1, 4(3)
27 ; CHECK-NEXT: fcmpu 0, 1, 0
28 ; CHECK-NEXT: ble 0, .LBB0_2
29 ; CHECK-NEXT: # %bb.4:
30 ; CHECK-NEXT: xsaddsp 0, 1, 1
31 ; CHECK-NEXT: b .LBB0_2
32 ; CHECK-NEXT: .LBB0_5: # %bb8
33 ; CHECK-NEXT: stw 7, 0(5)
34 ; CHECK-NEXT: stfs 0, 0(6)
37 %tmp = load float, ptr %arg, align 4
38 %tmp4 = fmul float %tmp, 2.000000e+00
39 %tmp5 = icmp sgt i32 %arg1, 1
40 br i1 %tmp5, label %bb6, label %bb8
43 %tmp7 = zext i32 %arg1 to i64
46 bb8: ; preds = %bb11, %bb
47 %tmp9 = phi float [ %tmp4, %bb ], [ %tmp19, %bb11 ]
48 %tmp10 = phi i32 [ 7, %bb ], [ %tmp22, %bb11 ]
49 store i32 %tmp10, ptr %arg2, align 4
50 store float %tmp9, ptr %arg3, align 4
53 bb11: ; preds = %bb11, %bb6
54 %tmp12 = phi i64 [ 1, %bb6 ], [ %tmp23, %bb11 ]
55 %tmp13 = phi i32 [ 7, %bb6 ], [ %tmp22, %bb11 ]
56 %tmp14 = phi float [ %tmp4, %bb6 ], [ %tmp19, %bb11 ]
57 %tmp15 = getelementptr inbounds float, ptr %arg, i64 %tmp12
58 %tmp16 = load float, ptr %tmp15, align 4
59 %tmp17 = fcmp ogt float %tmp16, %tmp14
60 %tmp18 = fmul float %tmp16, 2.000000e+00
61 %tmp19 = select i1 %tmp17, float %tmp18, float %tmp14
62 %tmp20 = trunc i64 %tmp12 to i32
63 %tmp21 = add i32 %tmp20, 7
64 %tmp22 = select i1 %tmp17, i32 %tmp21, i32 %tmp13
65 %tmp23 = add nuw nsw i64 %tmp12, 1
66 %tmp24 = icmp eq i64 %tmp23, %tmp7
67 br i1 %tmp24, label %bb8, label %bb11