1; RUN: llc -verify-machineinstrs -disable-ppc-instr-form-prep=true -mcpu=pwr9 < %s \ 2; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names | FileCheck %s -check-prefix=CHECK-P9 3; RUN: llc -verify-machineinstrs -disable-ppc-instr-form-prep=true -mcpu=pwr10 < %s \ 4; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names | FileCheck %s -check-prefix=CHECK-P10 5 6target triple = "powerpc64le-unknown-linux-gnu" 7 8%_elem_type_of_a = type <{ double }> 9%_elem_type_of_x = type <{ double }> 10%_elem_type_of_y = type <{ double }> 11 12define void @test(i32* dereferenceable(4) %.ial, i32* noalias dereferenceable(4) %.m, i32* noalias dereferenceable(4) %.n, [0 x %_elem_type_of_a]* %.a, i32* noalias dereferenceable(4) %.lda, [0 x %_elem_type_of_x]* noalias %.x, [0 x %_elem_type_of_y]* noalias %.y) { 13; CHECK-P9-LABEL: test: 14; CHECK-P9: .LBB0_2: # %_loop_2_do_ 15; CHECK-P9: lxv vs1, -16(r4) 16; CHECK-P9: lxv vs2, 0(r4) 17; CHECK-P9-DAG: lxv vs3, -16(r3) 18; CHECK-P9-DAG: lxv vs4, 0(r3) 19; CHECK-P9-DAG: xvmaddadp vs1, vs3, vs1 20; CHECK-P9-DAG: stxv vs1, -16(r4) 21; CHECK-P9-DAG: xvmaddadp vs2, vs4, vs0 22; CHECK-P9: stxv vs2, 0(r4) 23; CHECK-P9: bdnz .LBB0_2 24; 25; FIXME: use pair load/store instructions lxvp/stxvp 26; CHECK-P10-LABEL: test: 27; CHECK-P10: .LBB0_2: # %_loop_2_do_ 28; CHECK-P10: lxv vs1, -16(r4) 29; CHECK-P10: lxv vs2, 0(r4) 30; CHECK-P10-DAG: lxv vs3, -16(r3) 31; CHECK-P10-DAG: lxv vs4, 0(r3) 32; CHECK-P10-DAG: xvmaddadp vs1, vs3, vs1 33; CHECK-P10-DAG: xvmaddadp vs2, vs4, vs0 34; CHECK-P10-DAG: stxv vs1, -16(r4) 35; CHECK-P10: stxv vs2, 0(r4) 36; CHECK-P10: bdnz .LBB0_2 37test_entry: 38 %_conv5 = ptrtoint [0 x %_elem_type_of_a]* %.a to i64 39 %_andi_tmp = and i64 %_conv5, 15 40 %_equ_tmp = icmp eq i64 %_andi_tmp, 0 41 %. = select i1 %_equ_tmp, i32 1, i32 2 42 %_val_m_ = load i32, i32* %.m, align 4 43 %_sub_tmp9 = sub nsw i32 1, %. 44 %_add_tmp10 = add i32 %_sub_tmp9, %_val_m_ 45 %_mod_tmp = srem i32 %_add_tmp10, 16 46 %_sub_tmp11 = sub i32 %_val_m_, %_mod_tmp 47 %_val_n_ = load i32, i32* %.n, align 4 48 %x_rvo_based_addr_17 = getelementptr inbounds [0 x %_elem_type_of_x], [0 x %_elem_type_of_x]* %.x, i64 0, i64 -1 49 %_div_tmp = sdiv i32 %_val_n_, 2 50 %_conv16 = sext i32 %_div_tmp to i64 51 %_ind_cast = getelementptr inbounds %_elem_type_of_x, %_elem_type_of_x* %x_rvo_based_addr_17, i64 %_conv16, i32 0 52 %_val_x_ = load double, double* %_ind_cast, align 8 53 %.splatinsert = insertelement <2 x double> undef, double %_val_x_, i32 0 54 %.splat = shufflevector <2 x double> %.splatinsert, <2 x double> undef, <2 x i32> zeroinitializer 55 %_grt_tmp21 = icmp sgt i32 %., %_sub_tmp11 56 br i1 %_grt_tmp21, label %_return_bb, label %_loop_2_do_.lr.ph 57 58_loop_2_do_.lr.ph: ; preds = %test_entry 59 %_val_lda_ = load i32, i32* %.lda, align 4 60 %_conv = sext i32 %_val_lda_ to i64 61 %_mult_tmp = shl nsw i64 %_conv, 3 62 %_sub_tmp4 = sub nuw nsw i64 -8, %_mult_tmp 63 %y_rvo_based_addr_19 = getelementptr inbounds [0 x %_elem_type_of_y], [0 x %_elem_type_of_y]* %.y, i64 0, i64 -1 64 %a_byte_ptr_ = bitcast [0 x %_elem_type_of_a]* %.a to i8* 65 %a_rvo_based_addr_ = getelementptr inbounds i8, i8* %a_byte_ptr_, i64 %_sub_tmp4 66 %0 = zext i32 %. to i64 67 %1 = sext i32 %_sub_tmp11 to i64 68 br label %_loop_2_do_ 69 70_loop_2_do_: ; preds = %_loop_2_do_.lr.ph, %_loop_2_do_ 71 %indvars.iv = phi i64 [ %0, %_loop_2_do_.lr.ph ], [ %indvars.iv.next, %_loop_2_do_ ] 72 %_ix_x_len19 = shl nuw nsw i64 %indvars.iv, 3 73 %y_ix_dim_0_20 = getelementptr inbounds %_elem_type_of_y, %_elem_type_of_y* %y_rvo_based_addr_19, i64 %indvars.iv 74 %2 = bitcast %_elem_type_of_y* %y_ix_dim_0_20 to <2 x double>* 75 %3 = load <2 x double>, <2 x double>* %2, align 1 76 %4 = getelementptr %_elem_type_of_y, %_elem_type_of_y* %y_ix_dim_0_20, i64 2 77 %5 = bitcast %_elem_type_of_y* %4 to <2 x double>* 78 %6 = load <2 x double>, <2 x double>* %5, align 1 79 %a_ix_dim_1_ = getelementptr inbounds i8, i8* %a_rvo_based_addr_, i64 %_ix_x_len19 80 %7 = bitcast i8* %a_ix_dim_1_ to <2 x double>* 81 %8 = load <2 x double>, <2 x double>* %7, align 1 82 %9 = getelementptr i8, i8* %a_ix_dim_1_, i64 16 83 %10 = bitcast i8* %9 to <2 x double>* 84 %11 = load <2 x double>, <2 x double>* %10, align 1 85 %12 = tail call nsz contract <2 x double> @llvm.fma.v2f64(<2 x double> %8, <2 x double> %3, <2 x double> %3) 86 %13 = tail call nsz contract <2 x double> @llvm.fma.v2f64(<2 x double> %11, <2 x double> %.splat, <2 x double> %6) 87 store <2 x double> %12, <2 x double>* %2, align 1 88 store <2 x double> %13, <2 x double>* %5, align 1 89 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 16 90 %_grt_tmp = icmp sgt i64 %indvars.iv.next, %1 91 br i1 %_grt_tmp, label %_return_bb, label %_loop_2_do_ 92 93_return_bb: ; preds = %_loop_2_do_, %test_entry 94 ret void 95} 96 97declare <2 x double> @llvm.fma.v2f64(<2 x double>, <2 x double>, <2 x double>) 98