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(float* nocapture readonly %arg, i32 signext %arg1, i32* nocapture %arg2, float* 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
15 ; CHECK-NEXT: addi 4, 4, -1
18 ; CHECK-NEXT: b .LBB0_3
19 ; CHECK-NEXT: .p2align 5
20 ; CHECK-NEXT: .LBB0_2: # %bb11
22 ; CHECK-NEXT: iselgt 7, 4, 7
23 ; CHECK-NEXT: addi 4, 4, 1
24 ; CHECK-NEXT: bdz .LBB0_5
25 ; CHECK-NEXT: .LBB0_3: # %bb11
27 ; CHECK-NEXT: lfsu 1, 4(3)
28 ; CHECK-NEXT: fcmpu 0, 1, 0
29 ; CHECK-NEXT: ble 0, .LBB0_2
30 ; CHECK-NEXT: # %bb.4:
31 ; CHECK-NEXT: xsaddsp 0, 1, 1
32 ; CHECK-NEXT: b .LBB0_2
33 ; CHECK-NEXT: .LBB0_5: # %bb8
34 ; CHECK-NEXT: stw 7, 0(5)
35 ; CHECK-NEXT: stfs 0, 0(6)
38 %tmp = load float, float* %arg, align 4
39 %tmp4 = fmul float %tmp, 2.000000e+00
40 %tmp5 = icmp sgt i32 %arg1, 1
41 br i1 %tmp5, label %bb6, label %bb8
44 %tmp7 = zext i32 %arg1 to i64
47 bb8: ; preds = %bb11, %bb
48 %tmp9 = phi float [ %tmp4, %bb ], [ %tmp19, %bb11 ]
49 %tmp10 = phi i32 [ 7, %bb ], [ %tmp22, %bb11 ]
50 store i32 %tmp10, i32* %arg2, align 4
51 store float %tmp9, float* %arg3, align 4
54 bb11: ; preds = %bb11, %bb6
55 %tmp12 = phi i64 [ 1, %bb6 ], [ %tmp23, %bb11 ]
56 %tmp13 = phi i32 [ 7, %bb6 ], [ %tmp22, %bb11 ]
57 %tmp14 = phi float [ %tmp4, %bb6 ], [ %tmp19, %bb11 ]
58 %tmp15 = getelementptr inbounds float, float* %arg, i64 %tmp12
59 %tmp16 = load float, float* %tmp15, align 4
60 %tmp17 = fcmp ogt float %tmp16, %tmp14
61 %tmp18 = fmul float %tmp16, 2.000000e+00
62 %tmp19 = select i1 %tmp17, float %tmp18, float %tmp14
63 %tmp20 = trunc i64 %tmp12 to i32
64 %tmp21 = add i32 %tmp20, 7
65 %tmp22 = select i1 %tmp17, i32 %tmp21, i32 %tmp13
66 %tmp23 = add nuw nsw i64 %tmp12, 1
67 %tmp24 = icmp eq i64 %tmp23, %tmp7
68 br i1 %tmp24, label %bb8, label %bb11