1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -march=amdgcn -mcpu=gfx1100 -verify-machineinstrs < %s | FileCheck %s -check-prefix=GCN 3 4; This is a slightly modified IR from real case to make it concise. 5define amdgpu_ps void @_amdgpu_ps_main(i32 inreg %PrimMask, <2 x float> %InterpCenter) #0 { 6; GCN-LABEL: _amdgpu_ps_main: 7; GCN: ; %bb.0: ; %.entry 8; GCN-NEXT: s_mov_b32 s1, exec_lo 9; GCN-NEXT: s_wqm_b32 exec_lo, exec_lo 10; GCN-NEXT: s_mov_b32 m0, s0 11; GCN-NEXT: v_mov_b32_e32 v2, v0 12; GCN-NEXT: lds_param_load v3, attr1.x wait_vdst:15 13; GCN-NEXT: lds_param_load v4, attr1.y wait_vdst:15 14; GCN-NEXT: lds_param_load v5, attr1.z wait_vdst:15 15; GCN-NEXT: lds_param_load v6, attr1.w wait_vdst:15 16; GCN-NEXT: v_mbcnt_lo_u32_b32 v7, -1, 0 17; GCN-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1) 18; GCN-NEXT: v_mbcnt_hi_u32_b32 v7, -1, v7 19; GCN-NEXT: v_and_b32_e32 v7, 1, v7 20; GCN-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_4) | instid1(VALU_DEP_4) 21; GCN-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v7 22; GCN-NEXT: v_interp_p10_f32 v8, v4, v2, v4 wait_exp:2 23; GCN-NEXT: v_interp_p10_f32 v10, v5, v2, v5 wait_exp:1 24; GCN-NEXT: v_interp_p10_f32 v9, v6, v2, v6 25; GCN-NEXT: v_interp_p10_f32 v2, v3, v2, v3 wait_exp:7 26; GCN-NEXT: v_interp_p2_f32 v4, v4, v1, v8 wait_exp:7 27; GCN-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4) 28; GCN-NEXT: v_interp_p2_f32 v5, v5, v1, v10 wait_exp:7 29; GCN-NEXT: v_interp_p2_f32 v6, v6, v1, v9 wait_exp:7 30; GCN-NEXT: s_delay_alu instid0(VALU_DEP_4) | instskip(NEXT) | instid1(VALU_DEP_4) 31; GCN-NEXT: v_interp_p2_f32 v2, v3, v1, v2 wait_exp:7 32; GCN-NEXT: v_mov_b32_dpp v4, v4 dpp8:[1,0,3,2,5,4,7,6] 33; GCN-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_2) 34; GCN-NEXT: v_mov_b32_dpp v6, v6 dpp8:[1,0,3,2,5,4,7,6] 35; GCN-NEXT: v_cndmask_b32_e32 v3, v4, v5, vcc_lo 36; GCN-NEXT: v_cndmask_b32_e32 v4, v5, v4, vcc_lo 37; GCN-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_1) | instid1(VALU_DEP_3) 38; GCN-NEXT: v_cndmask_b32_e32 v5, v2, v6, vcc_lo 39; GCN-NEXT: v_cndmask_b32_e32 v2, v6, v2, vcc_lo 40; GCN-NEXT: v_mov_b32_dpp v4, v4 dpp8:[1,0,3,2,5,4,7,6] 41; GCN-NEXT: s_delay_alu instid0(VALU_DEP_3) 42; GCN-NEXT: v_mov_b32_dpp v5, v5 dpp8:[1,0,3,2,5,4,7,6] 43; GCN-NEXT: s_mov_b32 exec_lo, s1 44; GCN-NEXT: exp dual_src_blend0 v3, v2, off, off 45; GCN-NEXT: exp dual_src_blend1 v4, v5, off, off done 46; GCN-NEXT: s_endpgm 47.entry: 48 %InterpCenter.i0 = extractelement <2 x float> %InterpCenter, i64 0 49 %InterpCenter.i1 = extractelement <2 x float> %InterpCenter, i64 1 50 %i6 = call float @llvm.amdgcn.lds.param.load(i32 immarg 0, i32 immarg 1, i32 %PrimMask) 51 %i7 = call float @llvm.amdgcn.lds.param.load(i32 immarg 1, i32 immarg 1, i32 %PrimMask) 52 %i8 = call float @llvm.amdgcn.lds.param.load(i32 immarg 2, i32 immarg 1, i32 %PrimMask) 53 %i9 = call float @llvm.amdgcn.lds.param.load(i32 immarg 3, i32 immarg 1, i32 %PrimMask) 54 55 %i14 = call float @llvm.amdgcn.interp.inreg.p10(float %i8, float %InterpCenter.i0, float %i8) 56 %i15 = call float @llvm.amdgcn.interp.inreg.p2(float %i8, float %InterpCenter.i1, float %i14) 57 58 %i16 = call float @llvm.amdgcn.interp.inreg.p10(float %i7, float %InterpCenter.i0, float %i7) 59 %i17 = call float @llvm.amdgcn.interp.inreg.p2(float %i7, float %InterpCenter.i1, float %i16) 60 61 %i18 = call float @llvm.amdgcn.interp.inreg.p10(float %i6, float %InterpCenter.i0, float %i6) 62 %i19 = call float @llvm.amdgcn.interp.inreg.p2(float %i6, float %InterpCenter.i1, float %i18) 63 64 %i20 = call float @llvm.amdgcn.interp.inreg.p10(float %i9, float %InterpCenter.i0, float %i9) 65 %i21 = call float @llvm.amdgcn.interp.inreg.p2(float %i9, float %InterpCenter.i1, float %i20) 66 67 %i34 = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) 68 %i35 = call i32 @llvm.amdgcn.mbcnt.hi(i32 -1, i32 %i34) 69 %i36 = and i32 %i35, 1 70 %.not = icmp eq i32 %i36, 0 71 72 %i37 = bitcast float %i15 to i32 73 %i38 = bitcast float %i17 to i32 74 %i39 = call i32 @llvm.amdgcn.mov.dpp8.i32(i32 %i38, i32 14570689) 75 %i40 = select i1 %.not, i32 %i37, i32 %i39 76 %i41 = bitcast i32 %i40 to float 77 %i42 = select i1 %.not, i32 %i39, i32 %i37 78 %i43 = call i32 @llvm.amdgcn.mov.dpp8.i32(i32 %i42, i32 14570689) 79 %i44 = bitcast i32 %i43 to float 80 81 %i45 = bitcast float %i19 to i32 82 %i46 = bitcast float %i21 to i32 83 %i47 = call i32 @llvm.amdgcn.mov.dpp8.i32(i32 %i46, i32 14570689) 84 %i48 = select i1 %.not, i32 %i45, i32 %i47 85 %i49 = bitcast i32 %i48 to float 86 %i50 = select i1 %.not, i32 %i47, i32 %i45 87 %i51 = call i32 @llvm.amdgcn.mov.dpp8.i32(i32 %i50, i32 14570689) 88 %i52 = bitcast i32 %i51 to float 89 call void @llvm.amdgcn.exp.f32(i32 immarg 21, i32 immarg 3, float %i41, float %i49, float undef, float undef, i1 immarg false, i1 immarg true) 90 call void @llvm.amdgcn.exp.f32(i32 immarg 22, i32 immarg 3, float %i44, float %i52, float undef, float undef, i1 immarg true, i1 immarg true) 91 ret void 92} 93 94declare i32 @llvm.amdgcn.mbcnt.lo(i32, i32) #2 95declare i32 @llvm.amdgcn.mbcnt.hi(i32, i32) #2 96declare i32 @llvm.amdgcn.mov.dpp8.i32(i32, i32 immarg) #3 97declare void @llvm.amdgcn.exp.f32(i32 immarg, i32 immarg, float, float, float, float, i1 immarg, i1 immarg) #4 98declare float @llvm.amdgcn.interp.inreg.p10(float, float, float) #1 99declare float @llvm.amdgcn.interp.inreg.p2(float, float, float) #1 100declare float @llvm.amdgcn.lds.param.load(i32 immarg, i32 immarg, i32) #1 101 102attributes #0 = { nounwind } 103attributes #1 = { nounwind readnone speculatable willreturn } 104attributes #2 = { nounwind readnone willreturn } 105attributes #3 = { convergent nounwind readnone willreturn } 106attributes #4 = { inaccessiblememonly nounwind willreturn writeonly } 107