483 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GCN,GCN-SDAG %s3; RUN: llc -global-isel -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GCN,GCN-GISEL %s4 5; Test S_WAIT_XCNT insertion for global_load/store clauses.6; Introduced additional operations in between the clauses to have the register dependency7; between the operands of VMEM operations and the def ops of VALU instructions that followed.8 9define void @test_i8load_v4i8store(ptr addrspace(1) %ptr_a, ptr addrspace(1) %ptr_b, ptr addrspace(1) %ptr_c, ptr addrspace(1) %ptr_d, ptr addrspace(1) %out) {10; GCN-SDAG-LABEL: test_i8load_v4i8store:11; GCN-SDAG: ; %bb.0:12; GCN-SDAG-NEXT: s_wait_loadcnt_dscnt 0x013; GCN-SDAG-NEXT: s_wait_kmcnt 0x014; GCN-SDAG-NEXT: global_load_u8 v6, v[2:3], off15; GCN-SDAG-NEXT: global_load_u8 v7, v[4:5], off16; GCN-SDAG-NEXT: global_load_u8 v10, v[0:1], off17; GCN-SDAG-NEXT: s_wait_loadcnt 0x218; GCN-SDAG-NEXT: s_wait_xcnt 0x019; GCN-SDAG-NEXT: v_lshlrev_b16 v0, 8, v620; GCN-SDAG-NEXT: s_wait_loadcnt 0x121; GCN-SDAG-NEXT: v_lshlrev_b16 v1, 8, v722; GCN-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_1)23; GCN-SDAG-NEXT: v_or_b32_e32 v1, v7, v124; GCN-SDAG-NEXT: s_wait_loadcnt 0x025; GCN-SDAG-NEXT: v_dual_lshlrev_b32 v1, 16, v1 :: v_dual_bitop2_b32 v0, v10, v0 bitop3:0x5426; GCN-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)27; GCN-SDAG-NEXT: v_and_b32_e32 v0, 0xffff, v028; GCN-SDAG-NEXT: v_or_b32_e32 v0, v0, v129; GCN-SDAG-NEXT: global_store_b32 v[8:9], v0, off30; GCN-SDAG-NEXT: s_set_pc_i64 s[30:31]31;32; GCN-GISEL-LABEL: test_i8load_v4i8store:33; GCN-GISEL: ; %bb.0:34; GCN-GISEL-NEXT: s_wait_loadcnt_dscnt 0x035; GCN-GISEL-NEXT: s_wait_kmcnt 0x036; GCN-GISEL-NEXT: global_load_u8 v6, v[0:1], off37; GCN-GISEL-NEXT: global_load_u8 v7, v[2:3], off38; GCN-GISEL-NEXT: global_load_u8 v10, v[4:5], off39; GCN-GISEL-NEXT: s_wait_loadcnt 0x140; GCN-GISEL-NEXT: s_wait_xcnt 0x241; GCN-GISEL-NEXT: v_lshl_or_b32 v0, v7, 8, v642; GCN-GISEL-NEXT: s_wait_loadcnt 0x043; GCN-GISEL-NEXT: s_wait_xcnt 0x144; GCN-GISEL-NEXT: v_dual_lshlrev_b32 v1, 16, v10 :: v_dual_lshlrev_b32 v2, 24, v1045; GCN-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)46; GCN-GISEL-NEXT: v_or3_b32 v0, v0, v1, v247; GCN-GISEL-NEXT: global_store_b32 v[8:9], v0, off48; GCN-GISEL-NEXT: s_set_pc_i64 s[30:31]49 %a = load i8, ptr addrspace(1) %ptr_a50 %b = load i8, ptr addrspace(1) %ptr_b51 %c = load i8, ptr addrspace(1) %ptr_c52 %d = load i8, ptr addrspace(1) %ptr_d53 %ins_0 = insertelement <4 x i8> poison, i8 %a, i32 054 %ins_1 = insertelement <4 x i8> %ins_0, i8 %b, i32 155 %ins_2 = insertelement <4 x i8> %ins_1, i8 %c, i32 256 %ins_3 = insertelement <4 x i8> %ins_2, i8 %c, i32 357 store <4 x i8> %ins_3, ptr addrspace(1) %out58 ret void59}60 61define i16 @test_v7i16_load_store(ptr addrspace(1) %ptr1, ptr addrspace(1) %ptr2) {62; GCN-SDAG-LABEL: test_v7i16_load_store:63; GCN-SDAG: ; %bb.0:64; GCN-SDAG-NEXT: s_wait_loadcnt_dscnt 0x065; GCN-SDAG-NEXT: s_wait_kmcnt 0x066; GCN-SDAG-NEXT: global_load_b128 v[4:7], v[0:1], off67; GCN-SDAG-NEXT: global_load_b128 v[8:11], v[2:3], off68; GCN-SDAG-NEXT: s_wait_xcnt 0x069; GCN-SDAG-NEXT: v_mov_b64_e32 v[2:3], 1270; GCN-SDAG-NEXT: s_wait_loadcnt 0x071; GCN-SDAG-NEXT: v_pk_add_u16 v1, v6, v1072; GCN-SDAG-NEXT: v_pk_add_u16 v12, v7, v1173; GCN-SDAG-NEXT: v_mov_b64_e32 v[6:7], 874; GCN-SDAG-NEXT: v_mov_b64_e32 v[10:11], 075; GCN-SDAG-NEXT: v_pk_add_u16 v5, v5, v976; GCN-SDAG-NEXT: v_lshrrev_b32_e32 v0, 16, v177; GCN-SDAG-NEXT: v_pk_add_u16 v4, v4, v878; GCN-SDAG-NEXT: s_clause 0x279; GCN-SDAG-NEXT: global_store_b16 v[2:3], v12, off80; GCN-SDAG-NEXT: global_store_b32 v[6:7], v1, off81; GCN-SDAG-NEXT: global_store_b64 v[10:11], v[4:5], off82; GCN-SDAG-NEXT: s_set_pc_i64 s[30:31]83;84; GCN-GISEL-LABEL: test_v7i16_load_store:85; GCN-GISEL: ; %bb.0:86; GCN-GISEL-NEXT: s_wait_loadcnt_dscnt 0x087; GCN-GISEL-NEXT: s_wait_kmcnt 0x088; GCN-GISEL-NEXT: global_load_b128 v[4:7], v[0:1], off89; GCN-GISEL-NEXT: global_load_b128 v[8:11], v[2:3], off90; GCN-GISEL-NEXT: s_wait_xcnt 0x091; GCN-GISEL-NEXT: v_mov_b64_e32 v[2:3], 092; GCN-GISEL-NEXT: v_mov_b64_e32 v[12:13], 293; GCN-GISEL-NEXT: v_mov_b64_e32 v[14:15], 494; GCN-GISEL-NEXT: v_mov_b64_e32 v[16:17], 695; GCN-GISEL-NEXT: v_mov_b64_e32 v[18:19], 896; GCN-GISEL-NEXT: v_mov_b64_e32 v[20:21], 1097; GCN-GISEL-NEXT: v_mov_b64_e32 v[22:23], 1298; GCN-GISEL-NEXT: s_wait_loadcnt 0x099; GCN-GISEL-NEXT: v_pk_add_u16 v1, v6, v10100; GCN-GISEL-NEXT: v_pk_add_u16 v4, v4, v8101; GCN-GISEL-NEXT: v_pk_add_u16 v5, v5, v9102; GCN-GISEL-NEXT: v_pk_add_u16 v6, v7, v11103; GCN-GISEL-NEXT: s_clause 0x6104; GCN-GISEL-NEXT: global_store_b16 v[2:3], v4, off105; GCN-GISEL-NEXT: global_store_d16_hi_b16 v[12:13], v4, off106; GCN-GISEL-NEXT: global_store_b16 v[14:15], v5, off107; GCN-GISEL-NEXT: global_store_d16_hi_b16 v[16:17], v5, off108; GCN-GISEL-NEXT: global_store_b16 v[18:19], v1, off109; GCN-GISEL-NEXT: global_store_d16_hi_b16 v[20:21], v1, off110; GCN-GISEL-NEXT: global_store_b16 v[22:23], v6, off111; GCN-GISEL-NEXT: v_lshrrev_b32_e32 v0, 16, v1112; GCN-GISEL-NEXT: s_set_pc_i64 s[30:31]113 %vec1 = load <7 x i16>, ptr addrspace(1) %ptr1114 %insert = insertelement <7 x i16> %vec1, i16 20, i32 4115 %vec2 = load <7 x i16>, ptr addrspace(1) %ptr2116 %add = add <7 x i16> %vec1, %vec2117 store <7 x i16> %add, ptr addrspace(1) null118 %elt = extractelement <7 x i16> %add, i32 5119 ret i16 %elt120}121 122define i32 @test_v64i32_load_store(ptr addrspace(1) %ptr, i32 %idx, ptr addrspace(1) %out) {123; GCN-SDAG-LABEL: test_v64i32_load_store:124; GCN-SDAG: ; %bb.0:125; GCN-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0126; GCN-SDAG-NEXT: s_wait_kmcnt 0x0127; GCN-SDAG-NEXT: v_dual_mov_b32 v39, v4 :: v_dual_mov_b32 v38, v3128; GCN-SDAG-NEXT: s_clause 0xf129; GCN-SDAG-NEXT: global_load_b128 v[2:5], v[0:1], off offset:224130; GCN-SDAG-NEXT: global_load_b128 v[6:9], v[0:1], off offset:240131; GCN-SDAG-NEXT: global_load_b128 v[10:13], v[0:1], off offset:192132; GCN-SDAG-NEXT: global_load_b128 v[14:17], v[0:1], off offset:208133; GCN-SDAG-NEXT: global_load_b128 v[18:21], v[0:1], off offset:160134; GCN-SDAG-NEXT: global_load_b128 v[22:25], v[0:1], off offset:176135; GCN-SDAG-NEXT: global_load_b128 v[26:29], v[0:1], off offset:128136; GCN-SDAG-NEXT: global_load_b128 v[30:33], v[0:1], off offset:144137; GCN-SDAG-NEXT: global_load_b128 v[34:37], v[0:1], off offset:96138; GCN-SDAG-NEXT: global_load_b128 v[48:51], v[0:1], off offset:112139; GCN-SDAG-NEXT: global_load_b128 v[52:55], v[0:1], off offset:64140; GCN-SDAG-NEXT: global_load_b128 v[64:67], v[0:1], off offset:80141; GCN-SDAG-NEXT: global_load_b128 v[68:71], v[0:1], off offset:32142; GCN-SDAG-NEXT: global_load_b128 v[80:83], v[0:1], off offset:48143; GCN-SDAG-NEXT: global_load_b128 v[84:87], v[0:1], off144; GCN-SDAG-NEXT: global_load_b128 v[96:99], v[0:1], off offset:16145; GCN-SDAG-NEXT: s_wait_loadcnt 0xf146; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[2:5], off offset:224147; GCN-SDAG-NEXT: s_wait_loadcnt 0xe148; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[6:9], off offset:240149; GCN-SDAG-NEXT: s_wait_loadcnt 0xd150; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[10:13], off offset:192151; GCN-SDAG-NEXT: s_wait_loadcnt 0xc152; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[14:17], off offset:208153; GCN-SDAG-NEXT: s_wait_loadcnt 0xb154; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[18:21], off offset:160155; GCN-SDAG-NEXT: s_wait_loadcnt 0xa156; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[22:25], off offset:176157; GCN-SDAG-NEXT: s_wait_loadcnt 0x9158; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[26:29], off offset:128159; GCN-SDAG-NEXT: s_wait_loadcnt 0x8160; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[30:33], off offset:144161; GCN-SDAG-NEXT: s_wait_loadcnt 0x7162; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[34:37], off offset:96163; GCN-SDAG-NEXT: s_wait_loadcnt 0x6164; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[48:51], off offset:112165; GCN-SDAG-NEXT: s_wait_loadcnt 0x5166; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[52:55], off offset:64167; GCN-SDAG-NEXT: s_wait_loadcnt 0x4168; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[64:67], off offset:80169; GCN-SDAG-NEXT: s_wait_loadcnt 0x3170; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[68:71], off offset:32171; GCN-SDAG-NEXT: s_wait_loadcnt 0x2172; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[80:83], off offset:48173; GCN-SDAG-NEXT: s_wait_loadcnt 0x1174; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[84:87], off175; GCN-SDAG-NEXT: s_wait_loadcnt 0x0176; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[96:99], off offset:16177; GCN-SDAG-NEXT: s_wait_xcnt 0x10178; GCN-SDAG-NEXT: v_mov_b32_e32 v0, v98179; GCN-SDAG-NEXT: s_set_pc_i64 s[30:31]180;181; GCN-GISEL-LABEL: test_v64i32_load_store:182; GCN-GISEL: ; %bb.0:183; GCN-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0184; GCN-GISEL-NEXT: s_wait_kmcnt 0x0185; GCN-GISEL-NEXT: v_dual_mov_b32 v38, v3 :: v_dual_mov_b32 v39, v4186; GCN-GISEL-NEXT: s_clause 0xf187; GCN-GISEL-NEXT: global_load_b128 v[2:5], v[0:1], off offset:32188; GCN-GISEL-NEXT: global_load_b128 v[6:9], v[0:1], off offset:48189; GCN-GISEL-NEXT: global_load_b128 v[10:13], v[0:1], off190; GCN-GISEL-NEXT: global_load_b128 v[14:17], v[0:1], off offset:16191; GCN-GISEL-NEXT: global_load_b128 v[18:21], v[0:1], off offset:64192; GCN-GISEL-NEXT: global_load_b128 v[22:25], v[0:1], off offset:80193; GCN-GISEL-NEXT: global_load_b128 v[26:29], v[0:1], off offset:96194; GCN-GISEL-NEXT: global_load_b128 v[30:33], v[0:1], off offset:112195; GCN-GISEL-NEXT: global_load_b128 v[34:37], v[0:1], off offset:128196; GCN-GISEL-NEXT: global_load_b128 v[48:51], v[0:1], off offset:144197; GCN-GISEL-NEXT: global_load_b128 v[52:55], v[0:1], off offset:160198; GCN-GISEL-NEXT: global_load_b128 v[64:67], v[0:1], off offset:176199; GCN-GISEL-NEXT: global_load_b128 v[68:71], v[0:1], off offset:192200; GCN-GISEL-NEXT: global_load_b128 v[80:83], v[0:1], off offset:208201; GCN-GISEL-NEXT: global_load_b128 v[84:87], v[0:1], off offset:224202; GCN-GISEL-NEXT: global_load_b128 v[96:99], v[0:1], off offset:240203; GCN-GISEL-NEXT: s_wait_loadcnt 0xf204; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[2:5], off offset:32205; GCN-GISEL-NEXT: s_wait_loadcnt 0xe206; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[6:9], off offset:48207; GCN-GISEL-NEXT: s_wait_loadcnt 0xd208; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[10:13], off209; GCN-GISEL-NEXT: s_wait_loadcnt 0xc210; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[14:17], off offset:16211; GCN-GISEL-NEXT: s_wait_loadcnt 0xb212; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[18:21], off offset:64213; GCN-GISEL-NEXT: s_wait_loadcnt 0xa214; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[22:25], off offset:80215; GCN-GISEL-NEXT: s_wait_loadcnt 0x9216; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[26:29], off offset:96217; GCN-GISEL-NEXT: s_wait_loadcnt 0x8218; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[30:33], off offset:112219; GCN-GISEL-NEXT: s_wait_loadcnt 0x7220; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[34:37], off offset:128221; GCN-GISEL-NEXT: s_wait_loadcnt 0x6222; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[48:51], off offset:144223; GCN-GISEL-NEXT: s_wait_loadcnt 0x5224; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[52:55], off offset:160225; GCN-GISEL-NEXT: s_wait_loadcnt 0x4226; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[64:67], off offset:176227; GCN-GISEL-NEXT: s_wait_loadcnt 0x3228; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[68:71], off offset:192229; GCN-GISEL-NEXT: s_wait_loadcnt 0x2230; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[80:83], off offset:208231; GCN-GISEL-NEXT: s_wait_loadcnt 0x1232; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[84:87], off offset:224233; GCN-GISEL-NEXT: s_wait_loadcnt 0x0234; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[96:99], off offset:240235; GCN-GISEL-NEXT: s_wait_xcnt 0x10236; GCN-GISEL-NEXT: v_mov_b32_e32 v0, v16237; GCN-GISEL-NEXT: s_set_pc_i64 s[30:31]238 %vec = load <64 x i32>, ptr addrspace(1) %ptr239 store <64 x i32> %vec, ptr addrspace(1) %out, align 4240 %elt = extractelement <64 x i32> %vec, i32 6241 ret i32 %elt242}243 244define i64 @test_v16i64_load_store(ptr addrspace(1) %ptr_a, ptr addrspace(1) %ptr_b, ptr addrspace(1) %out) {245; GCN-SDAG-LABEL: test_v16i64_load_store:246; GCN-SDAG: ; %bb.0:247; GCN-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0248; GCN-SDAG-NEXT: s_wait_kmcnt 0x0249; GCN-SDAG-NEXT: s_clause 0x7250; GCN-SDAG-NEXT: global_load_b128 v[6:9], v[0:1], off offset:112251; GCN-SDAG-NEXT: global_load_b128 v[10:13], v[0:1], off offset:96252; GCN-SDAG-NEXT: global_load_b128 v[14:17], v[0:1], off offset:80253; GCN-SDAG-NEXT: global_load_b128 v[18:21], v[0:1], off offset:48254; GCN-SDAG-NEXT: global_load_b128 v[22:25], v[0:1], off offset:32255; GCN-SDAG-NEXT: global_load_b128 v[26:29], v[0:1], off offset:16256; GCN-SDAG-NEXT: global_load_b128 v[30:33], v[0:1], off257; GCN-SDAG-NEXT: global_load_b128 v[34:37], v[0:1], off offset:64258; GCN-SDAG-NEXT: v_mov_b64_e32 v[48:49], 48259; GCN-SDAG-NEXT: v_mov_b64_e32 v[50:51], 32260; GCN-SDAG-NEXT: v_mov_b64_e32 v[2:3], 0x70261; GCN-SDAG-NEXT: v_mov_b64_e32 v[64:65], 16262; GCN-SDAG-NEXT: v_mov_b64_e32 v[38:39], 0x60263; GCN-SDAG-NEXT: v_mov_b64_e32 v[66:67], 0264; GCN-SDAG-NEXT: v_mov_b64_e32 v[52:53], 0x50265; GCN-SDAG-NEXT: v_mov_b64_e32 v[54:55], 64266; GCN-SDAG-NEXT: s_wait_xcnt 0x0267; GCN-SDAG-NEXT: v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v0, 0xc8268; GCN-SDAG-NEXT: s_wait_loadcnt 0x7269; GCN-SDAG-NEXT: global_store_b128 v[2:3], v[6:9], off270; GCN-SDAG-NEXT: s_wait_loadcnt 0x6271; GCN-SDAG-NEXT: global_store_b128 v[38:39], v[10:13], off272; GCN-SDAG-NEXT: s_wait_loadcnt 0x5273; GCN-SDAG-NEXT: s_wait_xcnt 0x1274; GCN-SDAG-NEXT: v_dual_mov_b32 v2, v16 :: v_dual_mov_b32 v3, v17275; GCN-SDAG-NEXT: s_wait_xcnt 0x0276; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[12:13], v[12:13], v[12:13]277; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[10:11], v[10:11], v[10:11]278; GCN-SDAG-NEXT: s_wait_loadcnt 0x4279; GCN-SDAG-NEXT: global_store_b128 v[48:49], v[18:21], off280; GCN-SDAG-NEXT: s_wait_loadcnt 0x3281; GCN-SDAG-NEXT: global_store_b128 v[50:51], v[22:25], off282; GCN-SDAG-NEXT: s_wait_loadcnt 0x2283; GCN-SDAG-NEXT: global_store_b128 v[64:65], v[26:29], off284; GCN-SDAG-NEXT: s_wait_loadcnt 0x1285; GCN-SDAG-NEXT: global_store_b128 v[66:67], v[30:33], off286; GCN-SDAG-NEXT: s_wait_xcnt 0x0287; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[32:33], v[32:33], v[32:33]288; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[8:9], v[8:9], v[8:9]289; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[6:7], v[6:7], v[6:7]290; GCN-SDAG-NEXT: s_wait_loadcnt 0x0291; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[50:51], v[36:37], v[36:37]292; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[48:49], v[34:35], v[34:35]293; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[16:17], v[16:17], v[16:17]294; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[14:15], 0xc8, v[14:15]295; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[24:25], 0x64, v[24:25]296; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[22:23], v[22:23], v[22:23]297; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[28:29], v[28:29], v[28:29]298; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[26:27], v[26:27], v[26:27]299; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[30:31], v[30:31], v[30:31]300; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[20:21], v[20:21], v[20:21]301; GCN-SDAG-NEXT: v_add_nc_u64_e32 v[18:19], v[18:19], v[18:19]302; GCN-SDAG-NEXT: s_clause 0x1303; GCN-SDAG-NEXT: global_store_b128 v[52:53], v[0:3], off304; GCN-SDAG-NEXT: global_store_b128 v[54:55], v[34:37], off305; GCN-SDAG-NEXT: s_clause 0x7306; GCN-SDAG-NEXT: global_store_b128 v[4:5], v[10:13], off offset:96307; GCN-SDAG-NEXT: global_store_b128 v[4:5], v[6:9], off offset:112308; GCN-SDAG-NEXT: global_store_b128 v[4:5], v[48:51], off offset:64309; GCN-SDAG-NEXT: global_store_b128 v[4:5], v[14:17], off offset:80310; GCN-SDAG-NEXT: global_store_b128 v[4:5], v[22:25], off offset:32311; GCN-SDAG-NEXT: global_store_b128 v[4:5], v[18:21], off offset:48312; GCN-SDAG-NEXT: global_store_b128 v[4:5], v[30:33], off313; GCN-SDAG-NEXT: global_store_b128 v[4:5], v[26:29], off offset:16314; GCN-SDAG-NEXT: s_wait_xcnt 0x9315; GCN-SDAG-NEXT: v_dual_mov_b32 v0, v32 :: v_dual_mov_b32 v1, v33316; GCN-SDAG-NEXT: s_set_pc_i64 s[30:31]317;318; GCN-GISEL-LABEL: test_v16i64_load_store:319; GCN-GISEL: ; %bb.0:320; GCN-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0321; GCN-GISEL-NEXT: s_wait_kmcnt 0x0322; GCN-GISEL-NEXT: s_clause 0x7323; GCN-GISEL-NEXT: global_load_b128 v[6:9], v[0:1], off offset:80324; GCN-GISEL-NEXT: global_load_b128 v[10:13], v[0:1], off325; GCN-GISEL-NEXT: global_load_b128 v[14:17], v[0:1], off offset:16326; GCN-GISEL-NEXT: global_load_b128 v[18:21], v[0:1], off offset:32327; GCN-GISEL-NEXT: global_load_b128 v[22:25], v[0:1], off offset:48328; GCN-GISEL-NEXT: global_load_b128 v[26:29], v[0:1], off offset:96329; GCN-GISEL-NEXT: global_load_b128 v[30:33], v[0:1], off offset:112330; GCN-GISEL-NEXT: global_load_b128 v[34:37], v[0:1], off offset:64331; GCN-GISEL-NEXT: v_mov_b64_e32 v[38:39], 0332; GCN-GISEL-NEXT: v_mov_b64_e32 v[48:49], 16333; GCN-GISEL-NEXT: v_mov_b64_e32 v[50:51], 32334; GCN-GISEL-NEXT: v_mov_b64_e32 v[52:53], 48335; GCN-GISEL-NEXT: v_mov_b64_e32 v[66:67], 0x60336; GCN-GISEL-NEXT: v_mov_b64_e32 v[68:69], 0x70337; GCN-GISEL-NEXT: v_mov_b64_e32 v[54:55], 64338; GCN-GISEL-NEXT: s_wait_xcnt 0x0339; GCN-GISEL-NEXT: v_mov_b64_e32 v[0:1], 0xc8340; GCN-GISEL-NEXT: v_mov_b64_e32 v[64:65], 0x50341; GCN-GISEL-NEXT: s_wait_loadcnt 0x6342; GCN-GISEL-NEXT: global_store_b128 v[38:39], v[10:13], off343; GCN-GISEL-NEXT: s_wait_loadcnt 0x5344; GCN-GISEL-NEXT: global_store_b128 v[48:49], v[14:17], off345; GCN-GISEL-NEXT: s_wait_loadcnt 0x4346; GCN-GISEL-NEXT: global_store_b128 v[50:51], v[18:21], off347; GCN-GISEL-NEXT: s_wait_loadcnt 0x3348; GCN-GISEL-NEXT: global_store_b128 v[52:53], v[22:25], off349; GCN-GISEL-NEXT: s_wait_loadcnt 0x2350; GCN-GISEL-NEXT: global_store_b128 v[66:67], v[26:29], off351; GCN-GISEL-NEXT: s_wait_loadcnt 0x1352; GCN-GISEL-NEXT: global_store_b128 v[68:69], v[30:33], off353; GCN-GISEL-NEXT: s_wait_xcnt 0x5354; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[12:13], v[12:13], v[12:13]355; GCN-GISEL-NEXT: v_mov_b64_e32 v[2:3], v[8:9]356; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[10:11], v[10:11], v[10:11]357; GCN-GISEL-NEXT: s_wait_xcnt 0x4358; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[14:15], v[14:15], v[14:15]359; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[16:17], v[16:17], v[16:17]360; GCN-GISEL-NEXT: s_wait_xcnt 0x3361; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[18:19], v[18:19], v[18:19]362; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[20:21], 0x64, v[20:21]363; GCN-GISEL-NEXT: s_wait_xcnt 0x2364; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[22:23], v[22:23], v[22:23]365; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[24:25], v[24:25], v[24:25]366; GCN-GISEL-NEXT: s_wait_loadcnt 0x0367; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[48:49], v[34:35], v[34:35]368; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[50:51], v[36:37], v[36:37]369; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[6:7], 0xc8, v[6:7]370; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[8:9], v[8:9], v[8:9]371; GCN-GISEL-NEXT: s_wait_xcnt 0x1372; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[26:27], v[26:27], v[26:27]373; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[28:29], v[28:29], v[28:29]374; GCN-GISEL-NEXT: s_wait_xcnt 0x0375; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[30:31], v[30:31], v[30:31]376; GCN-GISEL-NEXT: v_add_nc_u64_e32 v[32:33], v[32:33], v[32:33]377; GCN-GISEL-NEXT: s_clause 0x1378; GCN-GISEL-NEXT: global_store_b128 v[54:55], v[34:37], off379; GCN-GISEL-NEXT: global_store_b128 v[64:65], v[0:3], off380; GCN-GISEL-NEXT: s_clause 0x7381; GCN-GISEL-NEXT: global_store_b128 v[4:5], v[10:13], off382; GCN-GISEL-NEXT: global_store_b128 v[4:5], v[14:17], off offset:16383; GCN-GISEL-NEXT: global_store_b128 v[4:5], v[18:21], off offset:32384; GCN-GISEL-NEXT: global_store_b128 v[4:5], v[22:25], off offset:48385; GCN-GISEL-NEXT: global_store_b128 v[4:5], v[48:51], off offset:64386; GCN-GISEL-NEXT: global_store_b128 v[4:5], v[6:9], off offset:80387; GCN-GISEL-NEXT: global_store_b128 v[4:5], v[26:29], off offset:96388; GCN-GISEL-NEXT: global_store_b128 v[4:5], v[30:33], off offset:112389; GCN-GISEL-NEXT: s_wait_xcnt 0x8390; GCN-GISEL-NEXT: v_dual_mov_b32 v0, v12 :: v_dual_mov_b32 v1, v13391; GCN-GISEL-NEXT: s_set_pc_i64 s[30:31]392 %a = load <16 x i64>, ptr addrspace(1) %ptr_a, align 4393 %in_a = insertelement <16 x i64> %a, i64 100, i32 5394 store <16 x i64> %in_a, ptr addrspace(1) null395 %b = load <16 x i64>, ptr addrspace(1) %ptr_b, align 4396 %in_b = insertelement <16 x i64> %a, i64 200, i32 10397 store <16 x i64> %in_b, ptr addrspace(1) null398 %add = add <16 x i64> %in_a, %in_b399 store <16 x i64> %add, ptr addrspace(1) %out, align 4400 %elt = extractelement <16 x i64> %add, i32 1401 ret i64 %elt402}403 404define amdgpu_kernel void @test_v7i16_load_store_kernel(ptr addrspace(1) %ptr1, ptr addrspace(1) %ptr2, ptr addrspace(1) %out) {405; GCN-SDAG-LABEL: test_v7i16_load_store_kernel:406; GCN-SDAG: ; %bb.0:407; GCN-SDAG-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_WAVE_MODE, 25, 1), 1408; GCN-SDAG-NEXT: s_load_b128 s[0:3], s[4:5], 0x0409; GCN-SDAG-NEXT: v_and_b32_e32 v8, 0x3ff, v0410; GCN-SDAG-NEXT: s_wait_xcnt 0x0411; GCN-SDAG-NEXT: s_load_b64 s[4:5], s[4:5], 0x10412; GCN-SDAG-NEXT: v_mov_b64_e32 v[10:11], 8413; GCN-SDAG-NEXT: v_mov_b64_e32 v[12:13], 0414; GCN-SDAG-NEXT: s_wait_kmcnt 0x0415; GCN-SDAG-NEXT: s_clause 0x1416; GCN-SDAG-NEXT: global_load_b128 v[0:3], v8, s[0:1] scale_offset417; GCN-SDAG-NEXT: global_load_b128 v[4:7], v8, s[2:3] scale_offset418; GCN-SDAG-NEXT: s_wait_xcnt 0x0419; GCN-SDAG-NEXT: v_mov_b64_e32 v[8:9], 12420; GCN-SDAG-NEXT: s_wait_loadcnt 0x0421; GCN-SDAG-NEXT: v_pk_add_u16 v3, v3, v7422; GCN-SDAG-NEXT: v_pk_add_u16 v2, v2, v6423; GCN-SDAG-NEXT: v_pk_add_u16 v1, v1, v5424; GCN-SDAG-NEXT: v_pk_add_u16 v0, v0, v4425; GCN-SDAG-NEXT: v_mov_b32_e32 v4, 0426; GCN-SDAG-NEXT: s_clause 0x2427; GCN-SDAG-NEXT: global_store_b16 v[8:9], v3, off428; GCN-SDAG-NEXT: global_store_b32 v[10:11], v2, off429; GCN-SDAG-NEXT: global_store_b64 v[12:13], v[0:1], off430; GCN-SDAG-NEXT: global_store_d16_hi_b16 v4, v2, s[4:5]431; GCN-SDAG-NEXT: s_endpgm432;433; GCN-GISEL-LABEL: test_v7i16_load_store_kernel:434; GCN-GISEL: ; %bb.0:435; GCN-GISEL-NEXT: s_setreg_imm32_b32 hwreg(HW_REG_WAVE_MODE, 25, 1), 1436; GCN-GISEL-NEXT: s_load_b128 s[0:3], s[4:5], 0x0437; GCN-GISEL-NEXT: v_and_b32_e32 v8, 0x3ff, v0438; GCN-GISEL-NEXT: s_wait_xcnt 0x0439; GCN-GISEL-NEXT: s_load_b64 s[4:5], s[4:5], 0x10440; GCN-GISEL-NEXT: v_mov_b64_e32 v[10:11], 2441; GCN-GISEL-NEXT: v_mov_b64_e32 v[12:13], 4442; GCN-GISEL-NEXT: v_mov_b64_e32 v[14:15], 6443; GCN-GISEL-NEXT: v_mov_b64_e32 v[16:17], 8444; GCN-GISEL-NEXT: v_mov_b64_e32 v[18:19], 10445; GCN-GISEL-NEXT: v_mov_b64_e32 v[20:21], 12446; GCN-GISEL-NEXT: s_wait_kmcnt 0x0447; GCN-GISEL-NEXT: s_clause 0x1448; GCN-GISEL-NEXT: global_load_b128 v[0:3], v8, s[0:1] scale_offset449; GCN-GISEL-NEXT: global_load_b128 v[4:7], v8, s[2:3] scale_offset450; GCN-GISEL-NEXT: s_wait_xcnt 0x0451; GCN-GISEL-NEXT: v_mov_b64_e32 v[8:9], 0452; GCN-GISEL-NEXT: s_wait_loadcnt 0x0453; GCN-GISEL-NEXT: v_pk_add_u16 v0, v0, v4454; GCN-GISEL-NEXT: v_pk_add_u16 v1, v1, v5455; GCN-GISEL-NEXT: v_pk_add_u16 v2, v2, v6456; GCN-GISEL-NEXT: v_mov_b32_e32 v4, 0457; GCN-GISEL-NEXT: v_pk_add_u16 v3, v3, v7458; GCN-GISEL-NEXT: s_clause 0x6459; GCN-GISEL-NEXT: global_store_b16 v[8:9], v0, off460; GCN-GISEL-NEXT: global_store_d16_hi_b16 v[10:11], v0, off461; GCN-GISEL-NEXT: global_store_b16 v[12:13], v1, off462; GCN-GISEL-NEXT: global_store_d16_hi_b16 v[14:15], v1, off463; GCN-GISEL-NEXT: global_store_b16 v[16:17], v2, off464; GCN-GISEL-NEXT: global_store_d16_hi_b16 v[18:19], v2, off465; GCN-GISEL-NEXT: global_store_b16 v[20:21], v3, off466; GCN-GISEL-NEXT: global_store_d16_hi_b16 v4, v2, s[4:5]467; GCN-GISEL-NEXT: s_endpgm468 %tid = call i32 @llvm.amdgcn.workitem.id.x()469 %gep1 = getelementptr inbounds <7 x i16>, ptr addrspace(1) %ptr1, i32 %tid470 %gep2 = getelementptr inbounds <7 x i16>, ptr addrspace(1) %ptr2, i32 %tid471 %vec1 = load <7 x i16>, ptr addrspace(1) %gep1472 %insert = insertelement <7 x i16> %vec1, i16 20, i32 4473 %vec2 = load <7 x i16>, ptr addrspace(1) %gep2474 %add = add <7 x i16> %vec1, %vec2475 store <7 x i16> %add, ptr addrspace(1) null476 %elt = extractelement <7 x i16> %add, i32 5477 store i16 %elt, ptr addrspace(1) %out478 ret void479}480 481;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:482; GCN: {{.*}}483