brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.5 KiB · c3f3917 Raw
255 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 %s -o - | FileCheck %s -check-prefixes=GFX113; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=-real-true16 %s -o - | FileCheck %s -check-prefixes=GFX114 5declare i32 @llvm.amdgcn.workitem.id.x()6 7define <2 x i64> @f1() #0 {8; GFX11-LABEL: f1:9; GFX11:       ; %bb.0:10; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)11; GFX11-NEXT:    v_mov_b32_e32 v0, 012; GFX11-NEXT:    v_mov_b32_e32 v1, 013; GFX11-NEXT:    v_mov_b32_e32 v2, 014; GFX11-NEXT:    v_mov_b32_e32 v3, 015; GFX11-NEXT:    s_setpc_b64 s[30:31]16  ret <2 x i64> zeroinitializer17}18 19define void @f0() {20; GFX11-LABEL: f0:21; GFX11:       ; %bb.0: ; %bb22; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)23; GFX11-NEXT:    s_mov_b32 s2, s3324; GFX11-NEXT:    s_mov_b32 s33, s3225; GFX11-NEXT:    s_xor_saveexec_b32 s0, -126; GFX11-NEXT:    scratch_store_b32 off, v4, s33 ; 4-byte Folded Spill27; GFX11-NEXT:    s_mov_b32 exec_lo, s028; GFX11-NEXT:    s_add_i32 s32, s32, 1629; GFX11-NEXT:    s_getpc_b64 s[0:1]30; GFX11-NEXT:    s_add_u32 s0, s0, f1@gotpcrel32@lo+431; GFX11-NEXT:    s_addc_u32 s1, s1, f1@gotpcrel32@hi+1232; GFX11-NEXT:    v_writelane_b32 v4, s30, 033; GFX11-NEXT:    s_load_b64 s[0:1], s[0:1], 0x034; GFX11-NEXT:    v_writelane_b32 v4, s31, 135; GFX11-NEXT:    s_waitcnt lgkmcnt(0)36; GFX11-NEXT:    s_swappc_b64 s[30:31], s[0:1]37; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)38; GFX11-NEXT:    v_readlane_b32 s31, v4, 139; GFX11-NEXT:    v_readlane_b32 s30, v4, 040; GFX11-NEXT:    s_mov_b32 s32, s3341; GFX11-NEXT:    s_xor_saveexec_b32 s0, -142; GFX11-NEXT:    scratch_load_b32 v4, off, s33 ; 4-byte Folded Reload43; GFX11-NEXT:    s_mov_b32 exec_lo, s044; GFX11-NEXT:    s_mov_b32 s33, s245; GFX11-NEXT:    s_waitcnt vmcnt(0)46; GFX11-NEXT:    s_setpc_b64 s[30:31]47bb:48  %i = call <2 x i64> @f1()49  ret void50}51 52define amdgpu_kernel void @f2(i32 %arg, i32 %arg1, i32 %arg2, i1 %arg3, i32 %arg4, i1 %arg5, ptr %arg6, i32 %arg7, i32 %arg8, i32 %arg9, i32 %arg10, i1 %arg11) {53; GFX11-LABEL: f2:54; GFX11:       ; %bb.0: ; %bb55; GFX11-NEXT:    s_mov_b64 s[16:17], s[4:5]56; GFX11-NEXT:    v_mov_b32_e32 v31, v057; GFX11-NEXT:    s_load_b32 s19, s[16:17], 0x2458; GFX11-NEXT:    s_mov_b32 s12, s1359; GFX11-NEXT:    s_mov_b64 s[10:11], s[6:7]60; GFX11-NEXT:    s_mov_b64 s[6:7], s[2:3]61; GFX11-NEXT:    v_and_b32_e32 v0, 0x3ff, v3162; GFX11-NEXT:    s_mov_b64 s[4:5], s[0:1]63; GFX11-NEXT:    s_mov_b32 s20, 064; GFX11-NEXT:    s_mov_b32 s0, -165; GFX11-NEXT:    s_mov_b32 s3, exec_lo66; GFX11-NEXT:    s_mov_b32 s32, 067; GFX11-NEXT:    s_waitcnt lgkmcnt(0)68; GFX11-NEXT:    v_mul_lo_u32 v0, s19, v069; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)70; GFX11-NEXT:    v_cmpx_eq_u32_e32 0, v071; GFX11-NEXT:    s_cbranch_execz .LBB2_1372; GFX11-NEXT:  ; %bb.1: ; %bb1473; GFX11-NEXT:    s_load_b128 s[20:23], s[16:17], 0x2c74; GFX11-NEXT:    s_mov_b32 s18, 075; GFX11-NEXT:    s_waitcnt lgkmcnt(0)76; GFX11-NEXT:    s_bitcmp1_b32 s21, 077; GFX11-NEXT:    s_cselect_b32 s24, -1, 078; GFX11-NEXT:    s_bitcmp0_b32 s21, 079; GFX11-NEXT:    s_cbranch_scc0 .LBB2_380; GFX11-NEXT:  ; %bb.2: ; %bb1581; GFX11-NEXT:    s_add_u32 s8, s16, 0x5882; GFX11-NEXT:    s_addc_u32 s9, s17, 083; GFX11-NEXT:    s_getpc_b64 s[0:1]84; GFX11-NEXT:    s_add_u32 s0, s0, f0@gotpcrel32@lo+485; GFX11-NEXT:    s_addc_u32 s1, s1, f0@gotpcrel32@hi+1286; GFX11-NEXT:    s_mov_b32 s13, s1487; GFX11-NEXT:    s_load_b64 s[0:1], s[0:1], 0x088; GFX11-NEXT:    s_mov_b32 s21, s1489; GFX11-NEXT:    s_mov_b32 s14, s1590; GFX11-NEXT:    s_waitcnt lgkmcnt(0)91; GFX11-NEXT:    s_swappc_b64 s[30:31], s[0:1]92; GFX11-NEXT:    s_mov_b32 s14, s2193; GFX11-NEXT:    s_mov_b32 s2, -194; GFX11-NEXT:    s_cbranch_execz .LBB2_495; GFX11-NEXT:    s_branch .LBB2_1296; GFX11-NEXT:  .LBB2_3:97; GFX11-NEXT:    s_mov_b32 s2, 098; GFX11-NEXT:    s_and_not1_b32 vcc_lo, exec_lo, s099; GFX11-NEXT:    s_cbranch_vccnz .LBB2_12100; GFX11-NEXT:  .LBB2_4: ; %bb16101; GFX11-NEXT:    s_load_b32 s0, s[16:17], 0x54102; GFX11-NEXT:    s_bitcmp1_b32 s23, 0103; GFX11-NEXT:    s_cselect_b32 s9, -1, 0104; GFX11-NEXT:    s_and_b32 s1, s23, 1105; GFX11-NEXT:    s_waitcnt lgkmcnt(0)106; GFX11-NEXT:    s_bitcmp1_b32 s0, 0107; GFX11-NEXT:    s_mov_b32 s0, -1108; GFX11-NEXT:    s_cselect_b32 s8, -1, 0109; GFX11-NEXT:    s_cmp_eq_u32 s1, 0110; GFX11-NEXT:    s_cbranch_scc0 .LBB2_8111; GFX11-NEXT:  ; %bb.5: ; %bb18.preheader112; GFX11-NEXT:    s_load_b128 s[28:31], s[16:17], 0x44113; GFX11-NEXT:    v_mov_b32_e32 v0, 0114; GFX11-NEXT:    s_waitcnt lgkmcnt(0)115; GFX11-NEXT:    s_mul_hi_u32 s1, s29, s28116; GFX11-NEXT:    s_mul_i32 s0, s29, s28117; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)118; GFX11-NEXT:    s_lshr_b64 s[0:1], s[0:1], 1119; GFX11-NEXT:    s_mov_b32 s1, 0120; GFX11-NEXT:    s_or_b32 s0, s0, 1121; GFX11-NEXT:    s_lshr_b32 s0, s0, s30122; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)123; GFX11-NEXT:    s_mul_i32 s0, s0, s22124; GFX11-NEXT:    s_mul_i32 s0, s0, s20125; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)126; GFX11-NEXT:    s_or_b32 s0, s19, s0127; GFX11-NEXT:    s_lshl_b64 s[20:21], s[0:1], 1128; GFX11-NEXT:    s_mov_b32 s0, s1129; GFX11-NEXT:    global_load_u16 v1, v0, s[20:21]130; GFX11-NEXT:    v_cndmask_b32_e64 v0, 0, 1, s24131; GFX11-NEXT:    s_waitcnt vmcnt(0)132; GFX11-NEXT:    v_cmp_eq_u32_e32 vcc_lo, 0, v1133; GFX11-NEXT:    v_cndmask_b32_e64 v1, 0, 1, vcc_lo134; GFX11-NEXT:    s_mov_b32 vcc_lo, 0135; GFX11-NEXT:    .p2align 6136; GFX11-NEXT:  .LBB2_6: ; %bb18137; GFX11-NEXT:    ; =>This Inner Loop Header: Depth=1138; GFX11-NEXT:    s_and_b32 s1, 0xffff, s1139; GFX11-NEXT:    s_cselect_b32 s13, -1, 0140; GFX11-NEXT:    v_readfirstlane_b32 s1, v0141; GFX11-NEXT:    v_cndmask_b32_e64 v2, 0, 1, s13142; GFX11-NEXT:    s_and_b32 s13, s8, s13143; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)144; GFX11-NEXT:    s_and_b32 s13, s13, exec_lo145; GFX11-NEXT:    v_readfirstlane_b32 s19, v2146; GFX11-NEXT:    s_cselect_b32 s1, s19, s1147; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)148; GFX11-NEXT:    s_and_b32 s1, s1, 1149; GFX11-NEXT:    s_and_b32 s13, 0xffff, s0150; GFX11-NEXT:    s_cselect_b32 s13, -1, 0151; GFX11-NEXT:    s_and_b32 s20, s9, exec_lo152; GFX11-NEXT:    v_cndmask_b32_e64 v2, 0, 1, s13153; GFX11-NEXT:    v_readfirstlane_b32 s13, v1154; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(SALU_CYCLE_1)155; GFX11-NEXT:    v_readfirstlane_b32 s19, v2156; GFX11-NEXT:    s_cselect_b32 s13, s19, s13157; GFX11-NEXT:    s_bitcmp1_b32 s13, 0158; GFX11-NEXT:    s_cselect_b32 s13, 0x100, 0159; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)160; GFX11-NEXT:    s_or_b32 s0, s13, s0161; GFX11-NEXT:    s_cbranch_vccz .LBB2_6162; GFX11-NEXT:  ; %bb.7: ; %Flow163; GFX11-NEXT:    s_mov_b32 s0, 0164; GFX11-NEXT:  .LBB2_8: ; %Flow12165; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)166; GFX11-NEXT:    s_and_b32 vcc_lo, exec_lo, s0167; GFX11-NEXT:    s_cbranch_vccz .LBB2_12168; GFX11-NEXT:  ; %bb.9:169; GFX11-NEXT:    s_xor_b32 s0, s8, -1170; GFX11-NEXT:  .LBB2_10: ; %bb17171; GFX11-NEXT:    ; =>This Inner Loop Header: Depth=1172; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)173; GFX11-NEXT:    s_and_b32 vcc_lo, exec_lo, s0174; GFX11-NEXT:    s_cbranch_vccz .LBB2_10175; GFX11-NEXT:  ; %bb.11: ; %Flow6176; GFX11-NEXT:    s_mov_b32 s18, -1177; GFX11-NEXT:  .LBB2_12: ; %Flow11178; GFX11-NEXT:    s_and_b32 s20, s2, exec_lo179; GFX11-NEXT:    s_or_not1_b32 s0, s18, exec_lo180; GFX11-NEXT:  .LBB2_13: ; %Flow9181; GFX11-NEXT:    s_or_b32 exec_lo, exec_lo, s3182; GFX11-NEXT:    s_and_saveexec_b32 s3, s0183; GFX11-NEXT:    s_cbranch_execz .LBB2_15184; GFX11-NEXT:  ; %bb.14: ; %bb43185; GFX11-NEXT:    s_add_u32 s8, s16, 0x58186; GFX11-NEXT:    s_addc_u32 s9, s17, 0187; GFX11-NEXT:    s_getpc_b64 s[0:1]188; GFX11-NEXT:    s_add_u32 s0, s0, f0@gotpcrel32@lo+4189; GFX11-NEXT:    s_addc_u32 s1, s1, f0@gotpcrel32@hi+12190; GFX11-NEXT:    s_mov_b32 s13, s14191; GFX11-NEXT:    s_load_b64 s[0:1], s[0:1], 0x0192; GFX11-NEXT:    s_mov_b32 s14, s15193; GFX11-NEXT:    s_waitcnt lgkmcnt(0)194; GFX11-NEXT:    s_swappc_b64 s[30:31], s[0:1]195; GFX11-NEXT:    s_or_b32 s20, s20, exec_lo196; GFX11-NEXT:  .LBB2_15: ; %Flow14197; GFX11-NEXT:    s_or_b32 exec_lo, exec_lo, s3198; GFX11-NEXT:    s_and_saveexec_b32 s0, s20199; GFX11-NEXT:  ; %bb.16: ; %UnifiedUnreachableBlock200; GFX11-NEXT:    ; divergent unreachable201; GFX11-NEXT:  ; %bb.17: ; %UnifiedReturnBlock202; GFX11-NEXT:    s_endpgm203bb:204  %i = tail call i32 @llvm.amdgcn.workitem.id.x()205  %i12 = mul i32 %arg, %i206  %i13 = icmp ult i32 %i12, 1207  br i1 %i13, label %bb14, label %bb43208 209bb14:210  br i1 %arg3, label %bb16, label %bb15211 212bb15:213  call void @f0()214  unreachable215 216bb16:217  br i1 %arg5, label %bb17, label %bb18218 219bb17:220  br i1 %arg11, label %bb17, label %bb43221 222bb18:223  %i19 = phi i16 [ %i38, %bb18 ], [ 0, %bb16 ]224  %i20 = phi i16 [ %i42, %bb18 ], [ 0, %bb16 ]225  %i21 = zext i32 %arg7 to i64226  %i22 = zext i32 %arg8 to i64227  %i23 = mul i64 %i22, %i21228  %i24 = lshr i64 %i23, 1229  %i25 = trunc i64 %i24 to i32230  %i26 = or i32 1, %i25231  %i27 = lshr i32 %i26, %arg9232  %i28 = mul i32 %i27, %arg4233  %i29 = mul i32 %i28, %arg2234  %i30 = or i32 %arg, %i29235  %i31 = zext i32 %i30 to i64236  %i32 = getelementptr { [2 x i8] }, ptr addrspace(1) null, i64 %i31237  %i33 = load i16, ptr addrspace(1) %i32, align 2238  %i34 = icmp ult i16 %i33, 1239  %i35 = icmp ne i16 %i19, 0240  %i36 = select i1 %arg11, i1 %i35, i1 false241  %i37 = select i1 %i36, i1 %i35, i1 %arg3242  %i38 = select i1 %i37, i16 1, i16 0243  %i39 = icmp ne i16 %i20, 0244  %i40 = select i1 %arg5, i1 %i39, i1 %i34245  %i41 = select i1 %i40, i16 256, i16 0246  %i42 = or i16 %i41, %i20247  br label %bb18248 249bb43:250  call void @f0()251  unreachable252}253 254attributes #0 = { noinline optnone }255