brintos

brintos / llvm-project-archived public Read only

0
0
Text · 195.1 KiB · 13d6597 Raw
4144 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -global-isel -new-reg-bank-select -mattr=-promote-alloca -mattr=+enable-flat-scratch < %s | FileCheck -check-prefix=GFX9 %s3; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 -global-isel -new-reg-bank-select -mattr=-promote-alloca -mattr=+enable-flat-scratch < %s | FileCheck -check-prefix=GFX10 %s4; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -global-isel -new-reg-bank-select -mattr=-promote-alloca < %s | FileCheck -check-prefix=GFX942 %s5; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -global-isel -new-reg-bank-select -mattr=-promote-alloca < %s | FileCheck -check-prefix=GFX11 %s6; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 -global-isel -new-reg-bank-select -mattr=-promote-alloca < %s | FileCheck -check-prefix=GFX12 %s7 8; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -global-isel -new-reg-bank-select -mattr=-unaligned-access-mode -mattr=-promote-alloca -mattr=+enable-flat-scratch < %s | FileCheck -check-prefixes=UNALIGNED_GFX9 %s9; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 -global-isel -new-reg-bank-select -mattr=-unaligned-access-mode -mattr=-promote-alloca -mattr=+enable-flat-scratch < %s | FileCheck -check-prefixes=UNALIGNED_GFX10 %s10; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -global-isel -new-reg-bank-select -mattr=-unaligned-access-mode -mattr=-promote-alloca < %s | FileCheck -check-prefixes=UNALIGNED_GFX942 %s11; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -global-isel -new-reg-bank-select -mattr=-unaligned-access-mode -mattr=-promote-alloca < %s | FileCheck -check-prefixes=UNALIGNED_GFX11 %s12; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 -global-isel -new-reg-bank-select -mattr=-unaligned-access-mode -mattr=-promote-alloca < %s | FileCheck -check-prefixes=UNALIGNED_GFX12 %s13 14define amdgpu_kernel void @store_load_sindex_kernel(i32 %idx) {15; GFX9-LABEL: store_load_sindex_kernel:16; GFX9:       ; %bb.0: ; %bb17; GFX9-NEXT:    s_load_dword s0, s[4:5], 0x018; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s1319; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 020; GFX9-NEXT:    v_mov_b32_e32 v0, 1521; GFX9-NEXT:    s_waitcnt lgkmcnt(0)22; GFX9-NEXT:    s_lshl_b32 s1, s0, 223; GFX9-NEXT:    s_and_b32 s0, s0, 1524; GFX9-NEXT:    s_lshl_b32 s0, s0, 225; GFX9-NEXT:    scratch_store_dword off, v0, s126; GFX9-NEXT:    s_waitcnt vmcnt(0)27; GFX9-NEXT:    scratch_load_dword v0, off, s0 glc28; GFX9-NEXT:    s_waitcnt vmcnt(0)29; GFX9-NEXT:    s_endpgm30;31; GFX10-LABEL: store_load_sindex_kernel:32; GFX10:       ; %bb.0: ; %bb33; GFX10-NEXT:    s_add_u32 s8, s8, s1334; GFX10-NEXT:    s_addc_u32 s9, s9, 035; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s836; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s937; GFX10-NEXT:    s_load_dword s0, s[4:5], 0x038; GFX10-NEXT:    v_mov_b32_e32 v0, 1539; GFX10-NEXT:    s_waitcnt lgkmcnt(0)40; GFX10-NEXT:    s_and_b32 s1, s0, 1541; GFX10-NEXT:    s_lshl_b32 s0, s0, 242; GFX10-NEXT:    s_lshl_b32 s1, s1, 243; GFX10-NEXT:    scratch_store_dword off, v0, s044; GFX10-NEXT:    s_waitcnt_vscnt null, 0x045; GFX10-NEXT:    scratch_load_dword v0, off, s1 glc dlc46; GFX10-NEXT:    s_waitcnt vmcnt(0)47; GFX10-NEXT:    s_endpgm48;49; GFX942-LABEL: store_load_sindex_kernel:50; GFX942:       ; %bb.0: ; %bb51; GFX942-NEXT:    s_load_dword s0, s[4:5], 0x052; GFX942-NEXT:    v_mov_b32_e32 v0, 1553; GFX942-NEXT:    s_waitcnt lgkmcnt(0)54; GFX942-NEXT:    s_lshl_b32 s1, s0, 255; GFX942-NEXT:    s_and_b32 s0, s0, 1556; GFX942-NEXT:    s_lshl_b32 s0, s0, 257; GFX942-NEXT:    scratch_store_dword off, v0, s1 sc0 sc158; GFX942-NEXT:    s_waitcnt vmcnt(0)59; GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc160; GFX942-NEXT:    s_waitcnt vmcnt(0)61; GFX942-NEXT:    s_endpgm62;63; GFX11-LABEL: store_load_sindex_kernel:64; GFX11:       ; %bb.0: ; %bb65; GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x066; GFX11-NEXT:    v_mov_b32_e32 v0, 1567; GFX11-NEXT:    s_waitcnt lgkmcnt(0)68; GFX11-NEXT:    s_and_b32 s1, s0, 1569; GFX11-NEXT:    s_lshl_b32 s0, s0, 270; GFX11-NEXT:    s_lshl_b32 s1, s1, 271; GFX11-NEXT:    scratch_store_b32 off, v0, s0 dlc72; GFX11-NEXT:    s_waitcnt_vscnt null, 0x073; GFX11-NEXT:    scratch_load_b32 v0, off, s1 glc dlc74; GFX11-NEXT:    s_waitcnt vmcnt(0)75; GFX11-NEXT:    s_endpgm76;77; GFX12-LABEL: store_load_sindex_kernel:78; GFX12:       ; %bb.0: ; %bb79; GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x080; GFX12-NEXT:    v_mov_b32_e32 v0, 1581; GFX12-NEXT:    s_wait_kmcnt 0x082; GFX12-NEXT:    s_and_b32 s1, s0, 1583; GFX12-NEXT:    s_lshl_b32 s0, s0, 284; GFX12-NEXT:    s_lshl_b32 s1, s1, 285; GFX12-NEXT:    scratch_store_b32 off, v0, s0 scope:SCOPE_SYS86; GFX12-NEXT:    s_wait_storecnt 0x087; GFX12-NEXT:    scratch_load_b32 v0, off, s1 scope:SCOPE_SYS88; GFX12-NEXT:    s_wait_loadcnt 0x089; GFX12-NEXT:    s_endpgm90;91; UNALIGNED_GFX9-LABEL: store_load_sindex_kernel:92; UNALIGNED_GFX9:       ; %bb.0: ; %bb93; UNALIGNED_GFX9-NEXT:    s_load_dword s0, s[4:5], 0x094; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s1395; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 096; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v0, 1597; UNALIGNED_GFX9-NEXT:    s_waitcnt lgkmcnt(0)98; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s1, s0, 299; UNALIGNED_GFX9-NEXT:    s_and_b32 s0, s0, 15100; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s0, s0, 2101; UNALIGNED_GFX9-NEXT:    scratch_store_dword off, v0, s1102; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)103; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, off, s0 glc104; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)105; UNALIGNED_GFX9-NEXT:    s_endpgm106;107; UNALIGNED_GFX10-LABEL: store_load_sindex_kernel:108; UNALIGNED_GFX10:       ; %bb.0: ; %bb109; UNALIGNED_GFX10-NEXT:    s_add_u32 s8, s8, s13110; UNALIGNED_GFX10-NEXT:    s_addc_u32 s9, s9, 0111; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s8112; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9113; UNALIGNED_GFX10-NEXT:    s_load_dword s0, s[4:5], 0x0114; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v0, 15115; UNALIGNED_GFX10-NEXT:    s_waitcnt lgkmcnt(0)116; UNALIGNED_GFX10-NEXT:    s_and_b32 s1, s0, 15117; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s0, s0, 2118; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s1, s1, 2119; UNALIGNED_GFX10-NEXT:    scratch_store_dword off, v0, s0120; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x0121; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, off, s1 glc dlc122; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)123; UNALIGNED_GFX10-NEXT:    s_endpgm124;125; UNALIGNED_GFX942-LABEL: store_load_sindex_kernel:126; UNALIGNED_GFX942:       ; %bb.0: ; %bb127; UNALIGNED_GFX942-NEXT:    s_load_dword s0, s[4:5], 0x0128; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v0, 15129; UNALIGNED_GFX942-NEXT:    s_waitcnt lgkmcnt(0)130; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s1, s0, 2131; UNALIGNED_GFX942-NEXT:    s_and_b32 s0, s0, 15132; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s0, s0, 2133; UNALIGNED_GFX942-NEXT:    scratch_store_dword off, v0, s1 sc0 sc1134; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)135; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc1136; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)137; UNALIGNED_GFX942-NEXT:    s_endpgm138;139; UNALIGNED_GFX11-LABEL: store_load_sindex_kernel:140; UNALIGNED_GFX11:       ; %bb.0: ; %bb141; UNALIGNED_GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x0142; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v0, 15143; UNALIGNED_GFX11-NEXT:    s_waitcnt lgkmcnt(0)144; UNALIGNED_GFX11-NEXT:    s_and_b32 s1, s0, 15145; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s0, s0, 2146; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s1, s1, 2147; UNALIGNED_GFX11-NEXT:    scratch_store_b32 off, v0, s0 dlc148; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x0149; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, off, s1 glc dlc150; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)151; UNALIGNED_GFX11-NEXT:    s_endpgm152;153; UNALIGNED_GFX12-LABEL: store_load_sindex_kernel:154; UNALIGNED_GFX12:       ; %bb.0: ; %bb155; UNALIGNED_GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x0156; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v0, 15157; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x0158; UNALIGNED_GFX12-NEXT:    s_and_b32 s1, s0, 15159; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s0, s0, 2160; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s1, s1, 2161; UNALIGNED_GFX12-NEXT:    scratch_store_b32 off, v0, s0 scope:SCOPE_SYS162; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x0163; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, off, s1 scope:SCOPE_SYS164; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x0165; UNALIGNED_GFX12-NEXT:    s_endpgm166bb:167  %i = alloca [32 x float], align 4, addrspace(5)168  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %idx169  store volatile i32 15, ptr addrspace(5) %i7, align 4170  %i9 = and i32 %idx, 15171  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %i9172  %i12 = load volatile i32, ptr addrspace(5) %i10, align 4173  ret void174}175 176define amdgpu_kernel void @store_load_vindex_kernel(i32 %n) {177; GFX9-LABEL: store_load_vindex_kernel:178; GFX9:       ; %bb.0: ; %bb179; GFX9-NEXT:    s_load_dword s0, s[4:5], 0x0180; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s13181; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 0182; GFX9-NEXT:    v_lshlrev_b32_e32 v2, 2, v0183; GFX9-NEXT:    v_sub_u32_e32 v0, 0, v0184; GFX9-NEXT:    s_waitcnt lgkmcnt(0)185; GFX9-NEXT:    s_lshl_b32 s0, s0, 7186; GFX9-NEXT:    v_mov_b32_e32 v1, 15187; GFX9-NEXT:    v_add_u32_e32 v2, s0, v2188; GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v0189; GFX9-NEXT:    scratch_store_dword v2, v1, off190; GFX9-NEXT:    s_waitcnt vmcnt(0)191; GFX9-NEXT:    v_add_u32_e32 v0, s0, v0192; GFX9-NEXT:    scratch_load_dword v0, v0, off offset:124 glc193; GFX9-NEXT:    s_waitcnt vmcnt(0)194; GFX9-NEXT:    s_endpgm195;196; GFX10-LABEL: store_load_vindex_kernel:197; GFX10:       ; %bb.0: ; %bb198; GFX10-NEXT:    s_add_u32 s8, s8, s13199; GFX10-NEXT:    s_addc_u32 s9, s9, 0200; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s8201; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9202; GFX10-NEXT:    s_load_dword s0, s[4:5], 0x0203; GFX10-NEXT:    v_sub_nc_u32_e32 v1, 0, v0204; GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v0205; GFX10-NEXT:    v_mov_b32_e32 v2, 15206; GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v1207; GFX10-NEXT:    s_waitcnt lgkmcnt(0)208; GFX10-NEXT:    s_lshl_b32 s0, s0, 7209; GFX10-NEXT:    v_add_nc_u32_e32 v0, s0, v0210; GFX10-NEXT:    v_add_nc_u32_e32 v1, s0, v1211; GFX10-NEXT:    scratch_store_dword v0, v2, off212; GFX10-NEXT:    s_waitcnt_vscnt null, 0x0213; GFX10-NEXT:    scratch_load_dword v0, v1, off offset:124 glc dlc214; GFX10-NEXT:    s_waitcnt vmcnt(0)215; GFX10-NEXT:    s_endpgm216;217; GFX942-LABEL: store_load_vindex_kernel:218; GFX942:       ; %bb.0: ; %bb219; GFX942-NEXT:    s_load_dword s0, s[4:5], 0x0220; GFX942-NEXT:    v_and_b32_e32 v0, 0x3ff, v0221; GFX942-NEXT:    v_lshlrev_b32_e32 v2, 2, v0222; GFX942-NEXT:    v_sub_u32_e32 v0, 0, v0223; GFX942-NEXT:    v_mov_b32_e32 v1, 15224; GFX942-NEXT:    s_waitcnt lgkmcnt(0)225; GFX942-NEXT:    s_lshl_b32 s0, s0, 7226; GFX942-NEXT:    v_add_u32_e32 v2, s0, v2227; GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v0228; GFX942-NEXT:    scratch_store_dword v2, v1, off sc0 sc1229; GFX942-NEXT:    s_waitcnt vmcnt(0)230; GFX942-NEXT:    v_add_u32_e32 v0, s0, v0231; GFX942-NEXT:    scratch_load_dword v0, v0, off offset:124 sc0 sc1232; GFX942-NEXT:    s_waitcnt vmcnt(0)233; GFX942-NEXT:    s_endpgm234;235; GFX11-LABEL: store_load_vindex_kernel:236; GFX11:       ; %bb.0: ; %bb237; GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x0238; GFX11-NEXT:    v_and_b32_e32 v0, 0x3ff, v0239; GFX11-NEXT:    v_mov_b32_e32 v2, 15240; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)241; GFX11-NEXT:    v_sub_nc_u32_e32 v1, 0, v0242; GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v0243; GFX11-NEXT:    v_lshlrev_b32_e32 v1, 2, v1244; GFX11-NEXT:    s_waitcnt lgkmcnt(0)245; GFX11-NEXT:    s_lshl_b32 s0, s0, 7246; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)247; GFX11-NEXT:    v_add_nc_u32_e32 v0, s0, v0248; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2)249; GFX11-NEXT:    v_add_nc_u32_e32 v1, s0, v1250; GFX11-NEXT:    scratch_store_b32 v0, v2, off dlc251; GFX11-NEXT:    s_waitcnt_vscnt null, 0x0252; GFX11-NEXT:    scratch_load_b32 v0, v1, off offset:124 glc dlc253; GFX11-NEXT:    s_waitcnt vmcnt(0)254; GFX11-NEXT:    s_endpgm255;256; GFX12-LABEL: store_load_vindex_kernel:257; GFX12:       ; %bb.0: ; %bb258; GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x0259; GFX12-NEXT:    v_and_b32_e32 v0, 0x3ff, v0260; GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)261; GFX12-NEXT:    v_sub_nc_u32_e32 v1, 0, v0262; GFX12-NEXT:    v_mov_b32_e32 v2, 15263; GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v0264; GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v1265; GFX12-NEXT:    s_wait_kmcnt 0x0266; GFX12-NEXT:    s_lshl_b32 s0, s0, 7267; GFX12-NEXT:    scratch_store_b32 v0, v2, s0 scope:SCOPE_SYS268; GFX12-NEXT:    s_wait_storecnt 0x0269; GFX12-NEXT:    scratch_load_b32 v0, v1, s0 offset:124 scope:SCOPE_SYS270; GFX12-NEXT:    s_wait_loadcnt 0x0271; GFX12-NEXT:    s_endpgm272;273; UNALIGNED_GFX9-LABEL: store_load_vindex_kernel:274; UNALIGNED_GFX9:       ; %bb.0: ; %bb275; UNALIGNED_GFX9-NEXT:    s_load_dword s0, s[4:5], 0x0276; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s13277; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 0278; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v2, 2, v0279; UNALIGNED_GFX9-NEXT:    v_sub_u32_e32 v0, 0, v0280; UNALIGNED_GFX9-NEXT:    s_waitcnt lgkmcnt(0)281; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s0, s0, 7282; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 15283; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v2, s0, v2284; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v0285; UNALIGNED_GFX9-NEXT:    scratch_store_dword v2, v1, off286; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)287; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, s0, v0288; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, v0, off offset:124 glc289; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)290; UNALIGNED_GFX9-NEXT:    s_endpgm291;292; UNALIGNED_GFX10-LABEL: store_load_vindex_kernel:293; UNALIGNED_GFX10:       ; %bb.0: ; %bb294; UNALIGNED_GFX10-NEXT:    s_add_u32 s8, s8, s13295; UNALIGNED_GFX10-NEXT:    s_addc_u32 s9, s9, 0296; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s8297; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9298; UNALIGNED_GFX10-NEXT:    s_load_dword s0, s[4:5], 0x0299; UNALIGNED_GFX10-NEXT:    v_sub_nc_u32_e32 v1, 0, v0300; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v0301; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 15302; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v1303; UNALIGNED_GFX10-NEXT:    s_waitcnt lgkmcnt(0)304; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s0, s0, 7305; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, s0, v0306; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v1, s0, v1307; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v2, off308; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x0309; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, v1, off offset:124 glc dlc310; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)311; UNALIGNED_GFX10-NEXT:    s_endpgm312;313; UNALIGNED_GFX942-LABEL: store_load_vindex_kernel:314; UNALIGNED_GFX942:       ; %bb.0: ; %bb315; UNALIGNED_GFX942-NEXT:    s_load_dword s0, s[4:5], 0x0316; UNALIGNED_GFX942-NEXT:    v_and_b32_e32 v0, 0x3ff, v0317; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v2, 2, v0318; UNALIGNED_GFX942-NEXT:    v_sub_u32_e32 v0, 0, v0319; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 15320; UNALIGNED_GFX942-NEXT:    s_waitcnt lgkmcnt(0)321; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s0, s0, 7322; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v2, s0, v2323; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v0324; UNALIGNED_GFX942-NEXT:    scratch_store_dword v2, v1, off sc0 sc1325; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)326; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v0, s0, v0327; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, v0, off offset:124 sc0 sc1328; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)329; UNALIGNED_GFX942-NEXT:    s_endpgm330;331; UNALIGNED_GFX11-LABEL: store_load_vindex_kernel:332; UNALIGNED_GFX11:       ; %bb.0: ; %bb333; UNALIGNED_GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x0334; UNALIGNED_GFX11-NEXT:    v_and_b32_e32 v0, 0x3ff, v0335; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v2, 15336; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)337; UNALIGNED_GFX11-NEXT:    v_sub_nc_u32_e32 v1, 0, v0338; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v0339; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v1, 2, v1340; UNALIGNED_GFX11-NEXT:    s_waitcnt lgkmcnt(0)341; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s0, s0, 7342; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instid1(SALU_CYCLE_1)343; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v0, s0, v0344; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2)345; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v1, s0, v1346; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v0, v2, off dlc347; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x0348; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, v1, off offset:124 glc dlc349; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)350; UNALIGNED_GFX11-NEXT:    s_endpgm351;352; UNALIGNED_GFX12-LABEL: store_load_vindex_kernel:353; UNALIGNED_GFX12:       ; %bb.0: ; %bb354; UNALIGNED_GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x0355; UNALIGNED_GFX12-NEXT:    v_and_b32_e32 v0, 0x3ff, v0356; UNALIGNED_GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_3)357; UNALIGNED_GFX12-NEXT:    v_sub_nc_u32_e32 v1, 0, v0358; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v2, 15359; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v0360; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v1361; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x0362; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s0, s0, 7363; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v2, s0 scope:SCOPE_SYS364; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x0365; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, v1, s0 offset:124 scope:SCOPE_SYS366; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x0367; UNALIGNED_GFX12-NEXT:    s_endpgm368bb:369  %i.alloca = alloca [2 x [32 x float]], align 4, addrspace(5)370  %i = getelementptr inbounds [2 x [32 x float]], ptr addrspace (5) %i.alloca, i32 0, i32 %n371  %i2 = tail call i32 @llvm.amdgcn.workitem.id.x()372  %i3 = zext i32 %i2 to i64373  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %i2374  store volatile i32 15, ptr addrspace(5) %i7, align 4375  %i9 = sub nsw i32 0, %i2376  %i9.1 = getelementptr [32 x float], ptr addrspace(5) %i, i32 0, i32 %i9377  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i9.1, i32 0, i32 31378  %i12 = load volatile i32, ptr addrspace(5) %i10, align 4379  ret void380}381 382define void @store_load_vindex_foo(i32 %idx) {383; GFX9-LABEL: store_load_vindex_foo:384; GFX9:       ; %bb.0: ; %bb385; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)386; GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v0387; GFX9-NEXT:    v_and_b32_e32 v0, 15, v0388; GFX9-NEXT:    v_add_u32_e32 v1, s32, v1389; GFX9-NEXT:    v_mov_b32_e32 v2, 15390; GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v0391; GFX9-NEXT:    scratch_store_dword v1, v2, off392; GFX9-NEXT:    s_waitcnt vmcnt(0)393; GFX9-NEXT:    v_add_u32_e32 v0, s32, v0394; GFX9-NEXT:    scratch_load_dword v0, v0, off glc395; GFX9-NEXT:    s_waitcnt vmcnt(0)396; GFX9-NEXT:    s_setpc_b64 s[30:31]397;398; GFX10-LABEL: store_load_vindex_foo:399; GFX10:       ; %bb.0: ; %bb400; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)401; GFX10-NEXT:    v_and_b32_e32 v1, 15, v0402; GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v0403; GFX10-NEXT:    v_mov_b32_e32 v2, 15404; GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v1405; GFX10-NEXT:    v_add_nc_u32_e32 v0, s32, v0406; GFX10-NEXT:    v_add_nc_u32_e32 v1, s32, v1407; GFX10-NEXT:    scratch_store_dword v0, v2, off408; GFX10-NEXT:    s_waitcnt_vscnt null, 0x0409; GFX10-NEXT:    scratch_load_dword v0, v1, off glc dlc410; GFX10-NEXT:    s_waitcnt vmcnt(0)411; GFX10-NEXT:    s_setpc_b64 s[30:31]412;413; GFX942-LABEL: store_load_vindex_foo:414; GFX942:       ; %bb.0: ; %bb415; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)416; GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v0417; GFX942-NEXT:    v_add_u32_e32 v1, s32, v1418; GFX942-NEXT:    v_mov_b32_e32 v2, 15419; GFX942-NEXT:    v_and_b32_e32 v0, 15, v0420; GFX942-NEXT:    scratch_store_dword v1, v2, off sc0 sc1421; GFX942-NEXT:    s_waitcnt vmcnt(0)422; GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v0423; GFX942-NEXT:    scratch_load_dword v0, v0, s32 sc0 sc1424; GFX942-NEXT:    s_waitcnt vmcnt(0)425; GFX942-NEXT:    s_setpc_b64 s[30:31]426;427; GFX11-LABEL: store_load_vindex_foo:428; GFX11:       ; %bb.0: ; %bb429; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)430; GFX11-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_lshlrev_b32 v1, 2, v0431; GFX11-NEXT:    v_and_b32_e32 v0, 15, v0432; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)433; GFX11-NEXT:    v_add_nc_u32_e32 v1, s32, v1434; GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v0435; GFX11-NEXT:    scratch_store_b32 v1, v2, off dlc436; GFX11-NEXT:    s_waitcnt_vscnt null, 0x0437; GFX11-NEXT:    scratch_load_b32 v0, v0, s32 glc dlc438; GFX11-NEXT:    s_waitcnt vmcnt(0)439; GFX11-NEXT:    s_setpc_b64 s[30:31]440;441; GFX12-LABEL: store_load_vindex_foo:442; GFX12:       ; %bb.0: ; %bb443; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x0444; GFX12-NEXT:    s_wait_expcnt 0x0445; GFX12-NEXT:    s_wait_samplecnt 0x0446; GFX12-NEXT:    s_wait_bvhcnt 0x0447; GFX12-NEXT:    s_wait_kmcnt 0x0448; GFX12-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_and_b32 v1, 15, v0449; GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v0450; GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_2)451; GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v1452; GFX12-NEXT:    s_wait_storecnt 0x0453; GFX12-NEXT:    scratch_store_b32 v0, v2, s32 scope:SCOPE_SYS454; GFX12-NEXT:    s_wait_storecnt 0x0455; GFX12-NEXT:    scratch_load_b32 v0, v1, s32 scope:SCOPE_SYS456; GFX12-NEXT:    s_wait_loadcnt 0x0457; GFX12-NEXT:    s_setpc_b64 s[30:31]458;459; UNALIGNED_GFX9-LABEL: store_load_vindex_foo:460; UNALIGNED_GFX9:       ; %bb.0: ; %bb461; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)462; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v0463; UNALIGNED_GFX9-NEXT:    v_and_b32_e32 v0, 15, v0464; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v1, s32, v1465; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 15466; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v0467; UNALIGNED_GFX9-NEXT:    scratch_store_dword v1, v2, off468; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)469; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, s32, v0470; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, v0, off glc471; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)472; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]473;474; UNALIGNED_GFX10-LABEL: store_load_vindex_foo:475; UNALIGNED_GFX10:       ; %bb.0: ; %bb476; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)477; UNALIGNED_GFX10-NEXT:    v_and_b32_e32 v1, 15, v0478; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v0479; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 15480; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v1481; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, s32, v0482; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v1, s32, v1483; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v2, off484; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x0485; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, v1, off glc dlc486; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)487; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]488;489; UNALIGNED_GFX942-LABEL: store_load_vindex_foo:490; UNALIGNED_GFX942:       ; %bb.0: ; %bb491; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)492; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v0493; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v1, s32, v1494; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 15495; UNALIGNED_GFX942-NEXT:    v_and_b32_e32 v0, 15, v0496; UNALIGNED_GFX942-NEXT:    scratch_store_dword v1, v2, off sc0 sc1497; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)498; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v0499; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, v0, s32 sc0 sc1500; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)501; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]502;503; UNALIGNED_GFX11-LABEL: store_load_vindex_foo:504; UNALIGNED_GFX11:       ; %bb.0: ; %bb505; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)506; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_lshlrev_b32 v1, 2, v0507; UNALIGNED_GFX11-NEXT:    v_and_b32_e32 v0, 15, v0508; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(NEXT) | instid1(VALU_DEP_2)509; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v1, s32, v1510; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v0511; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v1, v2, off dlc512; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x0513; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, v0, s32 glc dlc514; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)515; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]516;517; UNALIGNED_GFX12-LABEL: store_load_vindex_foo:518; UNALIGNED_GFX12:       ; %bb.0: ; %bb519; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x0520; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x0521; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x0522; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x0523; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x0524; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_and_b32 v1, 15, v0525; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v0526; UNALIGNED_GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_2)527; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v1528; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x0529; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v2, s32 scope:SCOPE_SYS530; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x0531; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, v1, s32 scope:SCOPE_SYS532; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x0533; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]534bb:535  %i = alloca [32 x float], align 4, addrspace(5)536  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %idx537  store volatile i32 15, ptr addrspace(5) %i7, align 4538  %i9 = and i32 %idx, 15539  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %i9540  %i12 = load volatile i32, ptr addrspace(5) %i10, align 4541  ret void542}543 544define void @private_ptr_foo(ptr addrspace(5) nocapture %arg) {545; GFX9-LABEL: private_ptr_foo:546; GFX9:       ; %bb.0:547; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)548; GFX9-NEXT:    v_mov_b32_e32 v1, 0x41200000549; GFX9-NEXT:    scratch_store_dword v0, v1, off offset:4550; GFX9-NEXT:    s_waitcnt vmcnt(0)551; GFX9-NEXT:    s_setpc_b64 s[30:31]552;553; GFX10-LABEL: private_ptr_foo:554; GFX10:       ; %bb.0:555; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)556; GFX10-NEXT:    v_mov_b32_e32 v1, 0x41200000557; GFX10-NEXT:    scratch_store_dword v0, v1, off offset:4558; GFX10-NEXT:    s_setpc_b64 s[30:31]559;560; GFX942-LABEL: private_ptr_foo:561; GFX942:       ; %bb.0:562; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)563; GFX942-NEXT:    v_mov_b32_e32 v1, 0x41200000564; GFX942-NEXT:    scratch_store_dword v0, v1, off offset:4565; GFX942-NEXT:    s_waitcnt vmcnt(0)566; GFX942-NEXT:    s_setpc_b64 s[30:31]567;568; GFX11-LABEL: private_ptr_foo:569; GFX11:       ; %bb.0:570; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)571; GFX11-NEXT:    v_mov_b32_e32 v1, 0x41200000572; GFX11-NEXT:    scratch_store_b32 v0, v1, off offset:4573; GFX11-NEXT:    s_setpc_b64 s[30:31]574;575; GFX12-LABEL: private_ptr_foo:576; GFX12:       ; %bb.0:577; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x0578; GFX12-NEXT:    s_wait_expcnt 0x0579; GFX12-NEXT:    s_wait_samplecnt 0x0580; GFX12-NEXT:    s_wait_bvhcnt 0x0581; GFX12-NEXT:    s_wait_kmcnt 0x0582; GFX12-NEXT:    v_mov_b32_e32 v1, 0x41200000583; GFX12-NEXT:    scratch_store_b32 v0, v1, off offset:4584; GFX12-NEXT:    s_setpc_b64 s[30:31]585;586; UNALIGNED_GFX9-LABEL: private_ptr_foo:587; UNALIGNED_GFX9:       ; %bb.0:588; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)589; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 0x41200000590; UNALIGNED_GFX9-NEXT:    scratch_store_dword v0, v1, off offset:4591; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)592; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]593;594; UNALIGNED_GFX10-LABEL: private_ptr_foo:595; UNALIGNED_GFX10:       ; %bb.0:596; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)597; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 0x41200000598; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v1, off offset:4599; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]600;601; UNALIGNED_GFX942-LABEL: private_ptr_foo:602; UNALIGNED_GFX942:       ; %bb.0:603; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)604; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 0x41200000605; UNALIGNED_GFX942-NEXT:    scratch_store_dword v0, v1, off offset:4606; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)607; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]608;609; UNALIGNED_GFX11-LABEL: private_ptr_foo:610; UNALIGNED_GFX11:       ; %bb.0:611; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)612; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v1, 0x41200000613; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v0, v1, off offset:4614; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]615;616; UNALIGNED_GFX12-LABEL: private_ptr_foo:617; UNALIGNED_GFX12:       ; %bb.0:618; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x0619; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x0620; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x0621; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x0622; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x0623; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v1, 0x41200000624; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v1, off offset:4625; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]626  %gep = getelementptr inbounds float, ptr addrspace(5) %arg, i32 1627  store float 1.000000e+01, ptr addrspace(5) %gep, align 4628  ret void629}630 631define amdgpu_kernel void @store_load_sindex_small_offset_kernel(i32 %idx) {632; GFX9-LABEL: store_load_sindex_small_offset_kernel:633; GFX9:       ; %bb.0: ; %bb634; GFX9-NEXT:    s_load_dword s0, s[4:5], 0x0635; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s13636; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 0637; GFX9-NEXT:    s_mov_b32 s1, 0638; GFX9-NEXT:    scratch_load_dword v0, off, s1 glc639; GFX9-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)640; GFX9-NEXT:    s_lshl_b32 s1, s0, 2641; GFX9-NEXT:    s_and_b32 s0, s0, 15642; GFX9-NEXT:    v_mov_b32_e32 v0, 15643; GFX9-NEXT:    s_addk_i32 s1, 0x100644; GFX9-NEXT:    s_lshl_b32 s0, s0, 2645; GFX9-NEXT:    scratch_store_dword off, v0, s1646; GFX9-NEXT:    s_waitcnt vmcnt(0)647; GFX9-NEXT:    s_addk_i32 s0, 0x100648; GFX9-NEXT:    scratch_load_dword v0, off, s0 glc649; GFX9-NEXT:    s_waitcnt vmcnt(0)650; GFX9-NEXT:    s_endpgm651;652; GFX10-LABEL: store_load_sindex_small_offset_kernel:653; GFX10:       ; %bb.0: ; %bb654; GFX10-NEXT:    s_add_u32 s8, s8, s13655; GFX10-NEXT:    s_addc_u32 s9, s9, 0656; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s8657; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9658; GFX10-NEXT:    s_load_dword s0, s[4:5], 0x0659; GFX10-NEXT:    scratch_load_dword v0, off, off glc dlc660; GFX10-NEXT:    s_waitcnt vmcnt(0)661; GFX10-NEXT:    v_mov_b32_e32 v0, 15662; GFX10-NEXT:    s_waitcnt lgkmcnt(0)663; GFX10-NEXT:    s_and_b32 s1, s0, 15664; GFX10-NEXT:    s_lshl_b32 s0, s0, 2665; GFX10-NEXT:    s_lshl_b32 s1, s1, 2666; GFX10-NEXT:    s_addk_i32 s0, 0x100667; GFX10-NEXT:    s_addk_i32 s1, 0x100668; GFX10-NEXT:    scratch_store_dword off, v0, s0669; GFX10-NEXT:    s_waitcnt_vscnt null, 0x0670; GFX10-NEXT:    scratch_load_dword v0, off, s1 glc dlc671; GFX10-NEXT:    s_waitcnt vmcnt(0)672; GFX10-NEXT:    s_endpgm673;674; GFX942-LABEL: store_load_sindex_small_offset_kernel:675; GFX942:       ; %bb.0: ; %bb676; GFX942-NEXT:    s_load_dword s0, s[4:5], 0x0677; GFX942-NEXT:    scratch_load_dword v0, off, off sc0 sc1678; GFX942-NEXT:    s_waitcnt vmcnt(0)679; GFX942-NEXT:    v_mov_b32_e32 v0, 15680; GFX942-NEXT:    s_waitcnt lgkmcnt(0)681; GFX942-NEXT:    s_lshl_b32 s1, s0, 2682; GFX942-NEXT:    s_and_b32 s0, s0, 15683; GFX942-NEXT:    s_addk_i32 s1, 0x100684; GFX942-NEXT:    s_lshl_b32 s0, s0, 2685; GFX942-NEXT:    scratch_store_dword off, v0, s1 sc0 sc1686; GFX942-NEXT:    s_waitcnt vmcnt(0)687; GFX942-NEXT:    s_addk_i32 s0, 0x100688; GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc1689; GFX942-NEXT:    s_waitcnt vmcnt(0)690; GFX942-NEXT:    s_endpgm691;692; GFX11-LABEL: store_load_sindex_small_offset_kernel:693; GFX11:       ; %bb.0: ; %bb694; GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x0695; GFX11-NEXT:    scratch_load_b32 v0, off, off glc dlc696; GFX11-NEXT:    s_waitcnt vmcnt(0)697; GFX11-NEXT:    v_mov_b32_e32 v0, 15698; GFX11-NEXT:    s_waitcnt lgkmcnt(0)699; GFX11-NEXT:    s_and_b32 s1, s0, 15700; GFX11-NEXT:    s_lshl_b32 s0, s0, 2701; GFX11-NEXT:    s_lshl_b32 s1, s1, 2702; GFX11-NEXT:    s_addk_i32 s0, 0x100703; GFX11-NEXT:    s_addk_i32 s1, 0x100704; GFX11-NEXT:    scratch_store_b32 off, v0, s0 dlc705; GFX11-NEXT:    s_waitcnt_vscnt null, 0x0706; GFX11-NEXT:    scratch_load_b32 v0, off, s1 glc dlc707; GFX11-NEXT:    s_waitcnt vmcnt(0)708; GFX11-NEXT:    s_endpgm709;710; GFX12-LABEL: store_load_sindex_small_offset_kernel:711; GFX12:       ; %bb.0: ; %bb712; GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x0713; GFX12-NEXT:    scratch_load_b32 v0, off, off scope:SCOPE_SYS714; GFX12-NEXT:    s_wait_loadcnt 0x0715; GFX12-NEXT:    v_mov_b32_e32 v0, 15716; GFX12-NEXT:    s_wait_kmcnt 0x0717; GFX12-NEXT:    s_and_b32 s1, s0, 15718; GFX12-NEXT:    s_lshl_b32 s0, s0, 2719; GFX12-NEXT:    s_lshl_b32 s1, s1, 2720; GFX12-NEXT:    s_addk_co_i32 s0, 0x100721; GFX12-NEXT:    s_addk_co_i32 s1, 0x100722; GFX12-NEXT:    scratch_store_b32 off, v0, s0 scope:SCOPE_SYS723; GFX12-NEXT:    s_wait_storecnt 0x0724; GFX12-NEXT:    scratch_load_b32 v0, off, s1 scope:SCOPE_SYS725; GFX12-NEXT:    s_wait_loadcnt 0x0726; GFX12-NEXT:    s_endpgm727;728; UNALIGNED_GFX9-LABEL: store_load_sindex_small_offset_kernel:729; UNALIGNED_GFX9:       ; %bb.0: ; %bb730; UNALIGNED_GFX9-NEXT:    s_load_dword s0, s[4:5], 0x0731; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s13732; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 0733; UNALIGNED_GFX9-NEXT:    s_mov_b32 s1, 0734; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, off, s1 glc735; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)736; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s1, s0, 2737; UNALIGNED_GFX9-NEXT:    s_and_b32 s0, s0, 15738; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v0, 15739; UNALIGNED_GFX9-NEXT:    s_addk_i32 s1, 0x100740; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s0, s0, 2741; UNALIGNED_GFX9-NEXT:    scratch_store_dword off, v0, s1742; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)743; UNALIGNED_GFX9-NEXT:    s_addk_i32 s0, 0x100744; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, off, s0 glc745; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)746; UNALIGNED_GFX9-NEXT:    s_endpgm747;748; UNALIGNED_GFX10-LABEL: store_load_sindex_small_offset_kernel:749; UNALIGNED_GFX10:       ; %bb.0: ; %bb750; UNALIGNED_GFX10-NEXT:    s_add_u32 s8, s8, s13751; UNALIGNED_GFX10-NEXT:    s_addc_u32 s9, s9, 0752; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s8753; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9754; UNALIGNED_GFX10-NEXT:    s_load_dword s0, s[4:5], 0x0755; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, off, off glc dlc756; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)757; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v0, 15758; UNALIGNED_GFX10-NEXT:    s_waitcnt lgkmcnt(0)759; UNALIGNED_GFX10-NEXT:    s_and_b32 s1, s0, 15760; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s0, s0, 2761; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s1, s1, 2762; UNALIGNED_GFX10-NEXT:    s_addk_i32 s0, 0x100763; UNALIGNED_GFX10-NEXT:    s_addk_i32 s1, 0x100764; UNALIGNED_GFX10-NEXT:    scratch_store_dword off, v0, s0765; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x0766; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, off, s1 glc dlc767; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)768; UNALIGNED_GFX10-NEXT:    s_endpgm769;770; UNALIGNED_GFX942-LABEL: store_load_sindex_small_offset_kernel:771; UNALIGNED_GFX942:       ; %bb.0: ; %bb772; UNALIGNED_GFX942-NEXT:    s_load_dword s0, s[4:5], 0x0773; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, off, off sc0 sc1774; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)775; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v0, 15776; UNALIGNED_GFX942-NEXT:    s_waitcnt lgkmcnt(0)777; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s1, s0, 2778; UNALIGNED_GFX942-NEXT:    s_and_b32 s0, s0, 15779; UNALIGNED_GFX942-NEXT:    s_addk_i32 s1, 0x100780; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s0, s0, 2781; UNALIGNED_GFX942-NEXT:    scratch_store_dword off, v0, s1 sc0 sc1782; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)783; UNALIGNED_GFX942-NEXT:    s_addk_i32 s0, 0x100784; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc1785; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)786; UNALIGNED_GFX942-NEXT:    s_endpgm787;788; UNALIGNED_GFX11-LABEL: store_load_sindex_small_offset_kernel:789; UNALIGNED_GFX11:       ; %bb.0: ; %bb790; UNALIGNED_GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x0791; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, off, off glc dlc792; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)793; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v0, 15794; UNALIGNED_GFX11-NEXT:    s_waitcnt lgkmcnt(0)795; UNALIGNED_GFX11-NEXT:    s_and_b32 s1, s0, 15796; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s0, s0, 2797; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s1, s1, 2798; UNALIGNED_GFX11-NEXT:    s_addk_i32 s0, 0x100799; UNALIGNED_GFX11-NEXT:    s_addk_i32 s1, 0x100800; UNALIGNED_GFX11-NEXT:    scratch_store_b32 off, v0, s0 dlc801; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x0802; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, off, s1 glc dlc803; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)804; UNALIGNED_GFX11-NEXT:    s_endpgm805;806; UNALIGNED_GFX12-LABEL: store_load_sindex_small_offset_kernel:807; UNALIGNED_GFX12:       ; %bb.0: ; %bb808; UNALIGNED_GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x0809; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, off, off scope:SCOPE_SYS810; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x0811; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v0, 15812; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x0813; UNALIGNED_GFX12-NEXT:    s_and_b32 s1, s0, 15814; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s0, s0, 2815; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s1, s1, 2816; UNALIGNED_GFX12-NEXT:    s_addk_co_i32 s0, 0x100817; UNALIGNED_GFX12-NEXT:    s_addk_co_i32 s1, 0x100818; UNALIGNED_GFX12-NEXT:    scratch_store_b32 off, v0, s0 scope:SCOPE_SYS819; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x0820; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, off, s1 scope:SCOPE_SYS821; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x0822; UNALIGNED_GFX12-NEXT:    s_endpgm823bb:824  %padding = alloca [64 x i32], align 4, addrspace(5)825  %i = alloca [32 x float], align 4, addrspace(5)826  %pad_gep = getelementptr inbounds [64 x i32], ptr addrspace(5) %padding, i32 0, i32 0827  %pad_load = load volatile i32, ptr addrspace(5) %pad_gep, align 4828  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %idx829  store volatile i32 15, ptr addrspace(5) %i7, align 4830  %i9 = and i32 %idx, 15831  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %i9832  %i12 = load volatile i32, ptr addrspace(5) %i10, align 4833  ret void834}835 836define amdgpu_kernel void @store_load_vindex_small_offset_kernel(i32 %n) {837; GFX9-LABEL: store_load_vindex_small_offset_kernel:838; GFX9:       ; %bb.0: ; %bb839; GFX9-NEXT:    s_load_dword s0, s[4:5], 0x0840; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s13841; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 0842; GFX9-NEXT:    s_mov_b32 s1, 0843; GFX9-NEXT:    scratch_load_dword v1, off, s1 glc844; GFX9-NEXT:    s_waitcnt vmcnt(0)845; GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v0846; GFX9-NEXT:    s_waitcnt lgkmcnt(0)847; GFX9-NEXT:    s_lshl_b32 s0, s0, 7848; GFX9-NEXT:    v_sub_u32_e32 v0, 0, v0849; GFX9-NEXT:    v_add_u32_e32 v1, 0x100, v1850; GFX9-NEXT:    s_add_u32 s0, 0x100, s0851; GFX9-NEXT:    v_mov_b32_e32 v2, 15852; GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v0853; GFX9-NEXT:    scratch_store_dword v1, v2, off offset:128854; GFX9-NEXT:    s_waitcnt vmcnt(0)855; GFX9-NEXT:    v_add_u32_e32 v0, s0, v0856; GFX9-NEXT:    scratch_load_dword v0, v0, off offset:124 glc857; GFX9-NEXT:    s_waitcnt vmcnt(0)858; GFX9-NEXT:    s_endpgm859;860; GFX10-LABEL: store_load_vindex_small_offset_kernel:861; GFX10:       ; %bb.0: ; %bb862; GFX10-NEXT:    s_add_u32 s8, s8, s13863; GFX10-NEXT:    s_addc_u32 s9, s9, 0864; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s8865; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9866; GFX10-NEXT:    s_load_dword s0, s[4:5], 0x0867; GFX10-NEXT:    v_sub_nc_u32_e32 v1, 0, v0868; GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v0869; GFX10-NEXT:    v_mov_b32_e32 v2, 15870; GFX10-NEXT:    scratch_load_dword v3, off, off glc dlc871; GFX10-NEXT:    s_waitcnt vmcnt(0)872; GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v1873; GFX10-NEXT:    v_add_nc_u32_e32 v0, 0x100, v0874; GFX10-NEXT:    scratch_store_dword v0, v2, off offset:128875; GFX10-NEXT:    s_waitcnt_vscnt null, 0x0876; GFX10-NEXT:    s_waitcnt lgkmcnt(0)877; GFX10-NEXT:    s_lshl_b32 s0, s0, 7878; GFX10-NEXT:    s_add_u32 s0, 0x100, s0879; GFX10-NEXT:    v_add_nc_u32_e32 v1, s0, v1880; GFX10-NEXT:    scratch_load_dword v0, v1, off offset:124 glc dlc881; GFX10-NEXT:    s_waitcnt vmcnt(0)882; GFX10-NEXT:    s_endpgm883;884; GFX942-LABEL: store_load_vindex_small_offset_kernel:885; GFX942:       ; %bb.0: ; %bb886; GFX942-NEXT:    s_load_dword s0, s[4:5], 0x0887; GFX942-NEXT:    scratch_load_dword v1, off, off sc0 sc1888; GFX942-NEXT:    s_waitcnt vmcnt(0)889; GFX942-NEXT:    v_and_b32_e32 v0, 0x3ff, v0890; GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v0891; GFX942-NEXT:    v_sub_u32_e32 v0, 0, v0892; GFX942-NEXT:    s_waitcnt lgkmcnt(0)893; GFX942-NEXT:    s_lshl_b32 s0, s0, 7894; GFX942-NEXT:    s_add_u32 s0, 0x100, s0895; GFX942-NEXT:    v_mov_b32_e32 v2, 15896; GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v0897; GFX942-NEXT:    scratch_store_dword v1, v2, off offset:384 sc0 sc1898; GFX942-NEXT:    s_waitcnt vmcnt(0)899; GFX942-NEXT:    v_add_u32_e32 v0, s0, v0900; GFX942-NEXT:    scratch_load_dword v0, v0, off offset:124 sc0 sc1901; GFX942-NEXT:    s_waitcnt vmcnt(0)902; GFX942-NEXT:    s_endpgm903;904; GFX11-LABEL: store_load_vindex_small_offset_kernel:905; GFX11:       ; %bb.0: ; %bb906; GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x0907; GFX11-NEXT:    v_and_b32_e32 v0, 0x3ff, v0908; GFX11-NEXT:    scratch_load_b32 v3, off, off glc dlc909; GFX11-NEXT:    s_waitcnt vmcnt(0)910; GFX11-NEXT:    v_mov_b32_e32 v2, 15911; GFX11-NEXT:    v_sub_nc_u32_e32 v1, 0, v0912; GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v0913; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)914; GFX11-NEXT:    v_lshlrev_b32_e32 v1, 2, v1915; GFX11-NEXT:    scratch_store_b32 v0, v2, off offset:384 dlc916; GFX11-NEXT:    s_waitcnt_vscnt null, 0x0917; GFX11-NEXT:    s_waitcnt lgkmcnt(0)918; GFX11-NEXT:    s_lshl_b32 s0, s0, 7919; GFX11-NEXT:    s_add_u32 s0, 0x100, s0920; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)921; GFX11-NEXT:    v_add_nc_u32_e32 v1, s0, v1922; GFX11-NEXT:    scratch_load_b32 v0, v1, off offset:124 glc dlc923; GFX11-NEXT:    s_waitcnt vmcnt(0)924; GFX11-NEXT:    s_endpgm925;926; GFX12-LABEL: store_load_vindex_small_offset_kernel:927; GFX12:       ; %bb.0: ; %bb928; GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x0929; GFX12-NEXT:    v_and_b32_e32 v0, 0x3ff, v0930; GFX12-NEXT:    scratch_load_b32 v3, off, off scope:SCOPE_SYS931; GFX12-NEXT:    s_wait_loadcnt 0x0932; GFX12-NEXT:    v_sub_nc_u32_e32 v1, 0, v0933; GFX12-NEXT:    v_mov_b32_e32 v2, 15934; GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v0935; GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)936; GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v1937; GFX12-NEXT:    s_wait_kmcnt 0x0938; GFX12-NEXT:    scratch_store_b32 v0, v2, off offset:384 scope:SCOPE_SYS939; GFX12-NEXT:    s_wait_storecnt 0x0940; GFX12-NEXT:    s_lshl_b32 s0, s0, 7941; GFX12-NEXT:    s_add_co_u32 s0, 0x100, s0942; GFX12-NEXT:    scratch_load_b32 v0, v1, s0 offset:124 scope:SCOPE_SYS943; GFX12-NEXT:    s_wait_loadcnt 0x0944; GFX12-NEXT:    s_endpgm945;946; UNALIGNED_GFX9-LABEL: store_load_vindex_small_offset_kernel:947; UNALIGNED_GFX9:       ; %bb.0: ; %bb948; UNALIGNED_GFX9-NEXT:    s_load_dword s0, s[4:5], 0x0949; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s13950; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 0951; UNALIGNED_GFX9-NEXT:    s_mov_b32 s1, 0952; UNALIGNED_GFX9-NEXT:    scratch_load_dword v1, off, s1 glc953; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)954; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v0955; UNALIGNED_GFX9-NEXT:    s_waitcnt lgkmcnt(0)956; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s0, s0, 7957; UNALIGNED_GFX9-NEXT:    v_sub_u32_e32 v0, 0, v0958; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v1, 0x100, v1959; UNALIGNED_GFX9-NEXT:    s_add_u32 s0, 0x100, s0960; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 15961; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v0962; UNALIGNED_GFX9-NEXT:    scratch_store_dword v1, v2, off offset:128963; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)964; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, s0, v0965; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, v0, off offset:124 glc966; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)967; UNALIGNED_GFX9-NEXT:    s_endpgm968;969; UNALIGNED_GFX10-LABEL: store_load_vindex_small_offset_kernel:970; UNALIGNED_GFX10:       ; %bb.0: ; %bb971; UNALIGNED_GFX10-NEXT:    s_add_u32 s8, s8, s13972; UNALIGNED_GFX10-NEXT:    s_addc_u32 s9, s9, 0973; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s8974; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s9975; UNALIGNED_GFX10-NEXT:    s_load_dword s0, s[4:5], 0x0976; UNALIGNED_GFX10-NEXT:    v_sub_nc_u32_e32 v1, 0, v0977; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v0978; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 15979; UNALIGNED_GFX10-NEXT:    scratch_load_dword v3, off, off glc dlc980; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)981; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v1982; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, 0x100, v0983; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v2, off offset:128984; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x0985; UNALIGNED_GFX10-NEXT:    s_waitcnt lgkmcnt(0)986; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s0, s0, 7987; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, 0x100, s0988; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v1, s0, v1989; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, v1, off offset:124 glc dlc990; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)991; UNALIGNED_GFX10-NEXT:    s_endpgm992;993; UNALIGNED_GFX942-LABEL: store_load_vindex_small_offset_kernel:994; UNALIGNED_GFX942:       ; %bb.0: ; %bb995; UNALIGNED_GFX942-NEXT:    s_load_dword s0, s[4:5], 0x0996; UNALIGNED_GFX942-NEXT:    scratch_load_dword v1, off, off sc0 sc1997; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)998; UNALIGNED_GFX942-NEXT:    v_and_b32_e32 v0, 0x3ff, v0999; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v01000; UNALIGNED_GFX942-NEXT:    v_sub_u32_e32 v0, 0, v01001; UNALIGNED_GFX942-NEXT:    s_waitcnt lgkmcnt(0)1002; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s0, s0, 71003; UNALIGNED_GFX942-NEXT:    s_add_u32 s0, 0x100, s01004; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 151005; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v01006; UNALIGNED_GFX942-NEXT:    scratch_store_dword v1, v2, off offset:384 sc0 sc11007; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1008; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v0, s0, v01009; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, v0, off offset:124 sc0 sc11010; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1011; UNALIGNED_GFX942-NEXT:    s_endpgm1012;1013; UNALIGNED_GFX11-LABEL: store_load_vindex_small_offset_kernel:1014; UNALIGNED_GFX11:       ; %bb.0: ; %bb1015; UNALIGNED_GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x01016; UNALIGNED_GFX11-NEXT:    v_and_b32_e32 v0, 0x3ff, v01017; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v3, off, off glc dlc1018; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1019; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v2, 151020; UNALIGNED_GFX11-NEXT:    v_sub_nc_u32_e32 v1, 0, v01021; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v01022; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)1023; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v1, 2, v11024; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v0, v2, off offset:384 dlc1025; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x01026; UNALIGNED_GFX11-NEXT:    s_waitcnt lgkmcnt(0)1027; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s0, s0, 71028; UNALIGNED_GFX11-NEXT:    s_add_u32 s0, 0x100, s01029; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)1030; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v1, s0, v11031; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, v1, off offset:124 glc dlc1032; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1033; UNALIGNED_GFX11-NEXT:    s_endpgm1034;1035; UNALIGNED_GFX12-LABEL: store_load_vindex_small_offset_kernel:1036; UNALIGNED_GFX12:       ; %bb.0: ; %bb1037; UNALIGNED_GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x01038; UNALIGNED_GFX12-NEXT:    v_and_b32_e32 v0, 0x3ff, v01039; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v3, off, off scope:SCOPE_SYS1040; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01041; UNALIGNED_GFX12-NEXT:    v_sub_nc_u32_e32 v1, 0, v01042; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v2, 151043; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v01044; UNALIGNED_GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)1045; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v11046; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x01047; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v2, off offset:384 scope:SCOPE_SYS1048; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x01049; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s0, s0, 71050; UNALIGNED_GFX12-NEXT:    s_add_co_u32 s0, 0x100, s01051; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, v1, s0 offset:124 scope:SCOPE_SYS1052; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01053; UNALIGNED_GFX12-NEXT:    s_endpgm1054bb:1055  %padding = alloca [64 x i32], align 4, addrspace(5)1056  %i.alloca = alloca [2 x [32 x float]], align 4, addrspace(5)1057  %i = getelementptr inbounds [2 x [32 x float]], ptr addrspace (5) %i.alloca, i32 0, i32 %n1058  %i.1 = getelementptr inbounds [2 x [32 x float]], ptr addrspace (5) %i.alloca, i32 0, i32 11059  %pad_gep = getelementptr inbounds [64 x i32], ptr addrspace(5) %padding, i32 0, i32 01060  %pad_load = load volatile i32, ptr addrspace(5) %pad_gep, align 41061  %i2 = tail call i32 @llvm.amdgcn.workitem.id.x()1062  %i3 = zext i32 %i2 to i641063  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i.1, i32 0, i32 %i21064  store volatile i32 15, ptr addrspace(5) %i7, align 41065  %i9 = sub nsw i32 0, %i21066  %i9.1 = getelementptr [32 x float], ptr addrspace(5) %i, i32 0, i32 %i91067  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i9.1, i32 0, i32 311068  %i12 = load volatile i32, ptr addrspace(5) %i10, align 41069  ret void1070}1071 1072define void @store_load_vindex_small_offset_foo(i32 %idx) {1073; GFX9-LABEL: store_load_vindex_small_offset_foo:1074; GFX9:       ; %bb.0: ; %bb1075; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1076; GFX9-NEXT:    scratch_load_dword v1, off, s32 glc1077; GFX9-NEXT:    s_waitcnt vmcnt(0)1078; GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v01079; GFX9-NEXT:    v_and_b32_e32 v0, 15, v01080; GFX9-NEXT:    v_add_u32_e32 v1, s32, v11081; GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v01082; GFX9-NEXT:    v_add_u32_e32 v1, 0x100, v11083; GFX9-NEXT:    v_mov_b32_e32 v2, 151084; GFX9-NEXT:    v_add_u32_e32 v0, s32, v01085; GFX9-NEXT:    scratch_store_dword v1, v2, off1086; GFX9-NEXT:    s_waitcnt vmcnt(0)1087; GFX9-NEXT:    v_add_u32_e32 v0, 0x100, v01088; GFX9-NEXT:    scratch_load_dword v0, v0, off glc1089; GFX9-NEXT:    s_waitcnt vmcnt(0)1090; GFX9-NEXT:    s_setpc_b64 s[30:31]1091;1092; GFX10-LABEL: store_load_vindex_small_offset_foo:1093; GFX10:       ; %bb.0: ; %bb1094; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1095; GFX10-NEXT:    v_and_b32_e32 v1, 15, v01096; GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v01097; GFX10-NEXT:    v_mov_b32_e32 v2, 151098; GFX10-NEXT:    scratch_load_dword v3, off, s32 glc dlc1099; GFX10-NEXT:    s_waitcnt vmcnt(0)1100; GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v11101; GFX10-NEXT:    v_add_nc_u32_e32 v0, s32, v01102; GFX10-NEXT:    v_add_nc_u32_e32 v1, s32, v11103; GFX10-NEXT:    v_add_nc_u32_e32 v0, 0x100, v01104; GFX10-NEXT:    v_add_nc_u32_e32 v1, 0x100, v11105; GFX10-NEXT:    scratch_store_dword v0, v2, off1106; GFX10-NEXT:    s_waitcnt_vscnt null, 0x01107; GFX10-NEXT:    scratch_load_dword v0, v1, off glc dlc1108; GFX10-NEXT:    s_waitcnt vmcnt(0)1109; GFX10-NEXT:    s_setpc_b64 s[30:31]1110;1111; GFX942-LABEL: store_load_vindex_small_offset_foo:1112; GFX942:       ; %bb.0: ; %bb1113; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1114; GFX942-NEXT:    scratch_load_dword v1, off, s32 sc0 sc11115; GFX942-NEXT:    s_waitcnt vmcnt(0)1116; GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v01117; GFX942-NEXT:    v_add_u32_e32 v1, s32, v11118; GFX942-NEXT:    v_add_u32_e32 v1, 0x100, v11119; GFX942-NEXT:    v_mov_b32_e32 v2, 151120; GFX942-NEXT:    v_and_b32_e32 v0, 15, v01121; GFX942-NEXT:    scratch_store_dword v1, v2, off sc0 sc11122; GFX942-NEXT:    s_waitcnt vmcnt(0)1123; GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v01124; GFX942-NEXT:    scratch_load_dword v0, v0, s32 offset:256 sc0 sc11125; GFX942-NEXT:    s_waitcnt vmcnt(0)1126; GFX942-NEXT:    s_setpc_b64 s[30:31]1127;1128; GFX11-LABEL: store_load_vindex_small_offset_foo:1129; GFX11:       ; %bb.0: ; %bb1130; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1131; GFX11-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_lshlrev_b32 v1, 2, v01132; GFX11-NEXT:    v_and_b32_e32 v0, 15, v01133; GFX11-NEXT:    scratch_load_b32 v3, off, s32 glc dlc1134; GFX11-NEXT:    s_waitcnt vmcnt(0)1135; GFX11-NEXT:    v_add_nc_u32_e32 v1, s32, v11136; GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v01137; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2)1138; GFX11-NEXT:    v_add_nc_u32_e32 v1, 0x100, v11139; GFX11-NEXT:    scratch_store_b32 v1, v2, off dlc1140; GFX11-NEXT:    s_waitcnt_vscnt null, 0x01141; GFX11-NEXT:    scratch_load_b32 v0, v0, s32 offset:256 glc dlc1142; GFX11-NEXT:    s_waitcnt vmcnt(0)1143; GFX11-NEXT:    s_setpc_b64 s[30:31]1144;1145; GFX12-LABEL: store_load_vindex_small_offset_foo:1146; GFX12:       ; %bb.0: ; %bb1147; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x01148; GFX12-NEXT:    s_wait_expcnt 0x01149; GFX12-NEXT:    s_wait_samplecnt 0x01150; GFX12-NEXT:    s_wait_bvhcnt 0x01151; GFX12-NEXT:    s_wait_kmcnt 0x01152; GFX12-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_and_b32 v1, 15, v01153; GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v01154; GFX12-NEXT:    scratch_load_b32 v3, off, s32 scope:SCOPE_SYS1155; GFX12-NEXT:    s_wait_loadcnt 0x01156; GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v11157; GFX12-NEXT:    s_wait_storecnt 0x01158; GFX12-NEXT:    scratch_store_b32 v0, v2, s32 offset:256 scope:SCOPE_SYS1159; GFX12-NEXT:    s_wait_storecnt 0x01160; GFX12-NEXT:    scratch_load_b32 v0, v1, s32 offset:256 scope:SCOPE_SYS1161; GFX12-NEXT:    s_wait_loadcnt 0x01162; GFX12-NEXT:    s_setpc_b64 s[30:31]1163;1164; UNALIGNED_GFX9-LABEL: store_load_vindex_small_offset_foo:1165; UNALIGNED_GFX9:       ; %bb.0: ; %bb1166; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1167; UNALIGNED_GFX9-NEXT:    scratch_load_dword v1, off, s32 glc1168; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1169; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v01170; UNALIGNED_GFX9-NEXT:    v_and_b32_e32 v0, 15, v01171; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v1, s32, v11172; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v01173; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v1, 0x100, v11174; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 151175; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, s32, v01176; UNALIGNED_GFX9-NEXT:    scratch_store_dword v1, v2, off1177; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1178; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, 0x100, v01179; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, v0, off glc1180; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1181; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]1182;1183; UNALIGNED_GFX10-LABEL: store_load_vindex_small_offset_foo:1184; UNALIGNED_GFX10:       ; %bb.0: ; %bb1185; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1186; UNALIGNED_GFX10-NEXT:    v_and_b32_e32 v1, 15, v01187; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v01188; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 151189; UNALIGNED_GFX10-NEXT:    scratch_load_dword v3, off, s32 glc dlc1190; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)1191; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v11192; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, s32, v01193; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v1, s32, v11194; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, 0x100, v01195; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v1, 0x100, v11196; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v2, off1197; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x01198; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, v1, off glc dlc1199; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)1200; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]1201;1202; UNALIGNED_GFX942-LABEL: store_load_vindex_small_offset_foo:1203; UNALIGNED_GFX942:       ; %bb.0: ; %bb1204; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1205; UNALIGNED_GFX942-NEXT:    scratch_load_dword v1, off, s32 sc0 sc11206; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1207; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v01208; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v1, s32, v11209; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v1, 0x100, v11210; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 151211; UNALIGNED_GFX942-NEXT:    v_and_b32_e32 v0, 15, v01212; UNALIGNED_GFX942-NEXT:    scratch_store_dword v1, v2, off sc0 sc11213; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1214; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v01215; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, v0, s32 offset:256 sc0 sc11216; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1217; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]1218;1219; UNALIGNED_GFX11-LABEL: store_load_vindex_small_offset_foo:1220; UNALIGNED_GFX11:       ; %bb.0: ; %bb1221; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1222; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_lshlrev_b32 v1, 2, v01223; UNALIGNED_GFX11-NEXT:    v_and_b32_e32 v0, 15, v01224; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v3, off, s32 glc dlc1225; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1226; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v1, s32, v11227; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v01228; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2)1229; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v1, 0x100, v11230; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v1, v2, off dlc1231; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x01232; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, v0, s32 offset:256 glc dlc1233; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1234; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]1235;1236; UNALIGNED_GFX12-LABEL: store_load_vindex_small_offset_foo:1237; UNALIGNED_GFX12:       ; %bb.0: ; %bb1238; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x01239; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x01240; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x01241; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x01242; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x01243; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_and_b32 v1, 15, v01244; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v01245; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v3, off, s32 scope:SCOPE_SYS1246; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01247; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v11248; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x01249; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v2, s32 offset:256 scope:SCOPE_SYS1250; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x01251; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, v1, s32 offset:256 scope:SCOPE_SYS1252; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01253; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]1254bb:1255  %padding = alloca [64 x i32], align 4, addrspace(5)1256  %i = alloca [32 x float], align 4, addrspace(5)1257  %pad_gep = getelementptr inbounds [64 x i32], ptr addrspace(5) %padding, i32 0, i32 01258  %pad_load = load volatile i32, ptr addrspace(5) %pad_gep, align 41259  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %idx1260  store volatile i32 15, ptr addrspace(5) %i7, align 41261  %i9 = and i32 %idx, 151262  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %i91263  %i12 = load volatile i32, ptr addrspace(5) %i10, align 41264  ret void1265}1266 1267define amdgpu_kernel void @store_load_sindex_large_offset_kernel(i32 %idx) {1268; GFX9-LABEL: store_load_sindex_large_offset_kernel:1269; GFX9:       ; %bb.0: ; %bb1270; GFX9-NEXT:    s_load_dword s0, s[4:5], 0x01271; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s131272; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 01273; GFX9-NEXT:    s_mov_b32 s1, 01274; GFX9-NEXT:    scratch_load_dword v0, off, s1 offset:4 glc1275; GFX9-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)1276; GFX9-NEXT:    s_lshl_b32 s1, s0, 21277; GFX9-NEXT:    s_and_b32 s0, s0, 151278; GFX9-NEXT:    v_mov_b32_e32 v0, 151279; GFX9-NEXT:    s_addk_i32 s1, 0x40041280; GFX9-NEXT:    s_lshl_b32 s0, s0, 21281; GFX9-NEXT:    scratch_store_dword off, v0, s11282; GFX9-NEXT:    s_waitcnt vmcnt(0)1283; GFX9-NEXT:    s_addk_i32 s0, 0x40041284; GFX9-NEXT:    scratch_load_dword v0, off, s0 glc1285; GFX9-NEXT:    s_waitcnt vmcnt(0)1286; GFX9-NEXT:    s_endpgm1287;1288; GFX10-LABEL: store_load_sindex_large_offset_kernel:1289; GFX10:       ; %bb.0: ; %bb1290; GFX10-NEXT:    s_add_u32 s8, s8, s131291; GFX10-NEXT:    s_addc_u32 s9, s9, 01292; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s81293; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s91294; GFX10-NEXT:    s_load_dword s0, s[4:5], 0x01295; GFX10-NEXT:    scratch_load_dword v0, off, off offset:4 glc dlc1296; GFX10-NEXT:    s_waitcnt vmcnt(0)1297; GFX10-NEXT:    v_mov_b32_e32 v0, 151298; GFX10-NEXT:    s_waitcnt lgkmcnt(0)1299; GFX10-NEXT:    s_and_b32 s1, s0, 151300; GFX10-NEXT:    s_lshl_b32 s0, s0, 21301; GFX10-NEXT:    s_lshl_b32 s1, s1, 21302; GFX10-NEXT:    s_addk_i32 s0, 0x40041303; GFX10-NEXT:    s_addk_i32 s1, 0x40041304; GFX10-NEXT:    scratch_store_dword off, v0, s01305; GFX10-NEXT:    s_waitcnt_vscnt null, 0x01306; GFX10-NEXT:    scratch_load_dword v0, off, s1 glc dlc1307; GFX10-NEXT:    s_waitcnt vmcnt(0)1308; GFX10-NEXT:    s_endpgm1309;1310; GFX942-LABEL: store_load_sindex_large_offset_kernel:1311; GFX942:       ; %bb.0: ; %bb1312; GFX942-NEXT:    s_load_dword s0, s[4:5], 0x01313; GFX942-NEXT:    scratch_load_dword v0, off, off offset:4 sc0 sc11314; GFX942-NEXT:    s_waitcnt vmcnt(0)1315; GFX942-NEXT:    v_mov_b32_e32 v0, 151316; GFX942-NEXT:    s_waitcnt lgkmcnt(0)1317; GFX942-NEXT:    s_lshl_b32 s1, s0, 21318; GFX942-NEXT:    s_and_b32 s0, s0, 151319; GFX942-NEXT:    s_addk_i32 s1, 0x40041320; GFX942-NEXT:    s_lshl_b32 s0, s0, 21321; GFX942-NEXT:    scratch_store_dword off, v0, s1 sc0 sc11322; GFX942-NEXT:    s_waitcnt vmcnt(0)1323; GFX942-NEXT:    s_addk_i32 s0, 0x40041324; GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc11325; GFX942-NEXT:    s_waitcnt vmcnt(0)1326; GFX942-NEXT:    s_endpgm1327;1328; GFX11-LABEL: store_load_sindex_large_offset_kernel:1329; GFX11:       ; %bb.0: ; %bb1330; GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x01331; GFX11-NEXT:    scratch_load_b32 v0, off, off offset:4 glc dlc1332; GFX11-NEXT:    s_waitcnt vmcnt(0)1333; GFX11-NEXT:    v_mov_b32_e32 v0, 151334; GFX11-NEXT:    s_waitcnt lgkmcnt(0)1335; GFX11-NEXT:    s_and_b32 s1, s0, 151336; GFX11-NEXT:    s_lshl_b32 s0, s0, 21337; GFX11-NEXT:    s_lshl_b32 s1, s1, 21338; GFX11-NEXT:    s_addk_i32 s0, 0x40041339; GFX11-NEXT:    s_addk_i32 s1, 0x40041340; GFX11-NEXT:    scratch_store_b32 off, v0, s0 dlc1341; GFX11-NEXT:    s_waitcnt_vscnt null, 0x01342; GFX11-NEXT:    scratch_load_b32 v0, off, s1 glc dlc1343; GFX11-NEXT:    s_waitcnt vmcnt(0)1344; GFX11-NEXT:    s_endpgm1345;1346; GFX12-LABEL: store_load_sindex_large_offset_kernel:1347; GFX12:       ; %bb.0: ; %bb1348; GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x01349; GFX12-NEXT:    scratch_load_b32 v0, off, off scope:SCOPE_SYS1350; GFX12-NEXT:    s_wait_loadcnt 0x01351; GFX12-NEXT:    v_mov_b32_e32 v0, 151352; GFX12-NEXT:    s_wait_kmcnt 0x01353; GFX12-NEXT:    s_and_b32 s1, s0, 151354; GFX12-NEXT:    s_lshl_b32 s0, s0, 21355; GFX12-NEXT:    s_lshl_b32 s1, s1, 21356; GFX12-NEXT:    s_addk_co_i32 s0, 0x40001357; GFX12-NEXT:    s_addk_co_i32 s1, 0x40001358; GFX12-NEXT:    scratch_store_b32 off, v0, s0 scope:SCOPE_SYS1359; GFX12-NEXT:    s_wait_storecnt 0x01360; GFX12-NEXT:    scratch_load_b32 v0, off, s1 scope:SCOPE_SYS1361; GFX12-NEXT:    s_wait_loadcnt 0x01362; GFX12-NEXT:    s_endpgm1363;1364; UNALIGNED_GFX9-LABEL: store_load_sindex_large_offset_kernel:1365; UNALIGNED_GFX9:       ; %bb.0: ; %bb1366; UNALIGNED_GFX9-NEXT:    s_load_dword s0, s[4:5], 0x01367; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s131368; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 01369; UNALIGNED_GFX9-NEXT:    s_mov_b32 s1, 01370; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, off, s1 offset:4 glc1371; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) lgkmcnt(0)1372; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s1, s0, 21373; UNALIGNED_GFX9-NEXT:    s_and_b32 s0, s0, 151374; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v0, 151375; UNALIGNED_GFX9-NEXT:    s_addk_i32 s1, 0x40041376; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s0, s0, 21377; UNALIGNED_GFX9-NEXT:    scratch_store_dword off, v0, s11378; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1379; UNALIGNED_GFX9-NEXT:    s_addk_i32 s0, 0x40041380; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, off, s0 glc1381; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1382; UNALIGNED_GFX9-NEXT:    s_endpgm1383;1384; UNALIGNED_GFX10-LABEL: store_load_sindex_large_offset_kernel:1385; UNALIGNED_GFX10:       ; %bb.0: ; %bb1386; UNALIGNED_GFX10-NEXT:    s_add_u32 s8, s8, s131387; UNALIGNED_GFX10-NEXT:    s_addc_u32 s9, s9, 01388; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s81389; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s91390; UNALIGNED_GFX10-NEXT:    s_load_dword s0, s[4:5], 0x01391; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, off, off offset:4 glc dlc1392; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)1393; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v0, 151394; UNALIGNED_GFX10-NEXT:    s_waitcnt lgkmcnt(0)1395; UNALIGNED_GFX10-NEXT:    s_and_b32 s1, s0, 151396; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s0, s0, 21397; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s1, s1, 21398; UNALIGNED_GFX10-NEXT:    s_addk_i32 s0, 0x40041399; UNALIGNED_GFX10-NEXT:    s_addk_i32 s1, 0x40041400; UNALIGNED_GFX10-NEXT:    scratch_store_dword off, v0, s01401; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x01402; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, off, s1 glc dlc1403; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)1404; UNALIGNED_GFX10-NEXT:    s_endpgm1405;1406; UNALIGNED_GFX942-LABEL: store_load_sindex_large_offset_kernel:1407; UNALIGNED_GFX942:       ; %bb.0: ; %bb1408; UNALIGNED_GFX942-NEXT:    s_load_dword s0, s[4:5], 0x01409; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, off, off offset:4 sc0 sc11410; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1411; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v0, 151412; UNALIGNED_GFX942-NEXT:    s_waitcnt lgkmcnt(0)1413; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s1, s0, 21414; UNALIGNED_GFX942-NEXT:    s_and_b32 s0, s0, 151415; UNALIGNED_GFX942-NEXT:    s_addk_i32 s1, 0x40041416; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s0, s0, 21417; UNALIGNED_GFX942-NEXT:    scratch_store_dword off, v0, s1 sc0 sc11418; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1419; UNALIGNED_GFX942-NEXT:    s_addk_i32 s0, 0x40041420; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc11421; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1422; UNALIGNED_GFX942-NEXT:    s_endpgm1423;1424; UNALIGNED_GFX11-LABEL: store_load_sindex_large_offset_kernel:1425; UNALIGNED_GFX11:       ; %bb.0: ; %bb1426; UNALIGNED_GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x01427; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, off, off offset:4 glc dlc1428; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1429; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v0, 151430; UNALIGNED_GFX11-NEXT:    s_waitcnt lgkmcnt(0)1431; UNALIGNED_GFX11-NEXT:    s_and_b32 s1, s0, 151432; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s0, s0, 21433; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s1, s1, 21434; UNALIGNED_GFX11-NEXT:    s_addk_i32 s0, 0x40041435; UNALIGNED_GFX11-NEXT:    s_addk_i32 s1, 0x40041436; UNALIGNED_GFX11-NEXT:    scratch_store_b32 off, v0, s0 dlc1437; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x01438; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, off, s1 glc dlc1439; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1440; UNALIGNED_GFX11-NEXT:    s_endpgm1441;1442; UNALIGNED_GFX12-LABEL: store_load_sindex_large_offset_kernel:1443; UNALIGNED_GFX12:       ; %bb.0: ; %bb1444; UNALIGNED_GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x01445; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, off, off scope:SCOPE_SYS1446; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01447; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v0, 151448; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x01449; UNALIGNED_GFX12-NEXT:    s_and_b32 s1, s0, 151450; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s0, s0, 21451; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s1, s1, 21452; UNALIGNED_GFX12-NEXT:    s_addk_co_i32 s0, 0x40001453; UNALIGNED_GFX12-NEXT:    s_addk_co_i32 s1, 0x40001454; UNALIGNED_GFX12-NEXT:    scratch_store_b32 off, v0, s0 scope:SCOPE_SYS1455; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x01456; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, off, s1 scope:SCOPE_SYS1457; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01458; UNALIGNED_GFX12-NEXT:    s_endpgm1459bb:1460  %padding = alloca [4096 x i32], align 4, addrspace(5)1461  %i = alloca [32 x float], align 4, addrspace(5)1462  %pad_gep = getelementptr inbounds [4096 x i32], ptr addrspace(5) %padding, i32 0, i32 01463  %pad_load = load volatile i32, ptr addrspace(5) %pad_gep, align 41464  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %idx1465  store volatile i32 15, ptr addrspace(5) %i7, align 41466  %i9 = and i32 %idx, 151467  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %i91468  %i12 = load volatile i32, ptr addrspace(5) %i10, align 41469  ret void1470}1471 1472define amdgpu_kernel void @store_load_vindex_large_offset_kernel(i32 %n) {1473; GFX9-LABEL: store_load_vindex_large_offset_kernel:1474; GFX9:       ; %bb.0: ; %bb1475; GFX9-NEXT:    s_load_dword s0, s[4:5], 0x01476; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s131477; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 01478; GFX9-NEXT:    s_mov_b32 s1, 01479; GFX9-NEXT:    scratch_load_dword v1, off, s1 offset:4 glc1480; GFX9-NEXT:    s_waitcnt vmcnt(0)1481; GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v01482; GFX9-NEXT:    s_waitcnt lgkmcnt(0)1483; GFX9-NEXT:    s_lshl_b32 s0, s0, 71484; GFX9-NEXT:    v_sub_u32_e32 v0, 0, v01485; GFX9-NEXT:    v_add_u32_e32 v1, 0x4004, v11486; GFX9-NEXT:    s_add_u32 s0, 0x4004, s01487; GFX9-NEXT:    v_mov_b32_e32 v2, 151488; GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v01489; GFX9-NEXT:    scratch_store_dword v1, v2, off offset:1281490; GFX9-NEXT:    s_waitcnt vmcnt(0)1491; GFX9-NEXT:    v_add_u32_e32 v0, s0, v01492; GFX9-NEXT:    scratch_load_dword v0, v0, off offset:124 glc1493; GFX9-NEXT:    s_waitcnt vmcnt(0)1494; GFX9-NEXT:    s_endpgm1495;1496; GFX10-LABEL: store_load_vindex_large_offset_kernel:1497; GFX10:       ; %bb.0: ; %bb1498; GFX10-NEXT:    s_add_u32 s8, s8, s131499; GFX10-NEXT:    s_addc_u32 s9, s9, 01500; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s81501; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s91502; GFX10-NEXT:    s_load_dword s0, s[4:5], 0x01503; GFX10-NEXT:    v_sub_nc_u32_e32 v1, 0, v01504; GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v01505; GFX10-NEXT:    v_mov_b32_e32 v2, 151506; GFX10-NEXT:    scratch_load_dword v3, off, off offset:4 glc dlc1507; GFX10-NEXT:    s_waitcnt vmcnt(0)1508; GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v11509; GFX10-NEXT:    v_add_nc_u32_e32 v0, 0x4004, v01510; GFX10-NEXT:    scratch_store_dword v0, v2, off offset:1281511; GFX10-NEXT:    s_waitcnt_vscnt null, 0x01512; GFX10-NEXT:    s_waitcnt lgkmcnt(0)1513; GFX10-NEXT:    s_lshl_b32 s0, s0, 71514; GFX10-NEXT:    s_add_u32 s0, 0x4004, s01515; GFX10-NEXT:    v_add_nc_u32_e32 v1, s0, v11516; GFX10-NEXT:    scratch_load_dword v0, v1, off offset:124 glc dlc1517; GFX10-NEXT:    s_waitcnt vmcnt(0)1518; GFX10-NEXT:    s_endpgm1519;1520; GFX942-LABEL: store_load_vindex_large_offset_kernel:1521; GFX942:       ; %bb.0: ; %bb1522; GFX942-NEXT:    s_load_dword s0, s[4:5], 0x01523; GFX942-NEXT:    scratch_load_dword v1, off, off offset:4 sc0 sc11524; GFX942-NEXT:    s_waitcnt vmcnt(0)1525; GFX942-NEXT:    v_and_b32_e32 v0, 0x3ff, v01526; GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v01527; GFX942-NEXT:    v_sub_u32_e32 v0, 0, v01528; GFX942-NEXT:    s_waitcnt lgkmcnt(0)1529; GFX942-NEXT:    s_lshl_b32 s0, s0, 71530; GFX942-NEXT:    s_add_u32 s0, 0x4004, s01531; GFX942-NEXT:    v_mov_b32_e32 v2, 151532; GFX942-NEXT:    s_movk_i32 s1, 0x40041533; GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v01534; GFX942-NEXT:    scratch_store_dword v1, v2, s1 offset:128 sc0 sc11535; GFX942-NEXT:    s_waitcnt vmcnt(0)1536; GFX942-NEXT:    v_add_u32_e32 v0, s0, v01537; GFX942-NEXT:    scratch_load_dword v0, v0, off offset:124 sc0 sc11538; GFX942-NEXT:    s_waitcnt vmcnt(0)1539; GFX942-NEXT:    s_endpgm1540;1541; GFX11-LABEL: store_load_vindex_large_offset_kernel:1542; GFX11:       ; %bb.0: ; %bb1543; GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x01544; GFX11-NEXT:    v_and_b32_e32 v0, 0x3ff, v01545; GFX11-NEXT:    scratch_load_b32 v3, off, off offset:4 glc dlc1546; GFX11-NEXT:    s_waitcnt vmcnt(0)1547; GFX11-NEXT:    v_mov_b32_e32 v2, 151548; GFX11-NEXT:    v_sub_nc_u32_e32 v1, 0, v01549; GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v01550; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)1551; GFX11-NEXT:    v_lshlrev_b32_e32 v1, 2, v11552; GFX11-NEXT:    s_waitcnt lgkmcnt(0)1553; GFX11-NEXT:    s_lshl_b32 s0, s0, 71554; GFX11-NEXT:    s_add_u32 s0, 0x4004, s01555; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)1556; GFX11-NEXT:    v_add_nc_u32_e32 v1, s0, v11557; GFX11-NEXT:    s_movk_i32 s0, 0x40041558; GFX11-NEXT:    scratch_store_b32 v0, v2, s0 offset:128 dlc1559; GFX11-NEXT:    s_waitcnt_vscnt null, 0x01560; GFX11-NEXT:    scratch_load_b32 v0, v1, off offset:124 glc dlc1561; GFX11-NEXT:    s_waitcnt vmcnt(0)1562; GFX11-NEXT:    s_endpgm1563;1564; GFX12-LABEL: store_load_vindex_large_offset_kernel:1565; GFX12:       ; %bb.0: ; %bb1566; GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x01567; GFX12-NEXT:    v_and_b32_e32 v0, 0x3ff, v01568; GFX12-NEXT:    scratch_load_b32 v3, off, off scope:SCOPE_SYS1569; GFX12-NEXT:    s_wait_loadcnt 0x01570; GFX12-NEXT:    v_sub_nc_u32_e32 v1, 0, v01571; GFX12-NEXT:    v_mov_b32_e32 v2, 151572; GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v01573; GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)1574; GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v11575; GFX12-NEXT:    s_wait_kmcnt 0x01576; GFX12-NEXT:    scratch_store_b32 v0, v2, off offset:16512 scope:SCOPE_SYS1577; GFX12-NEXT:    s_wait_storecnt 0x01578; GFX12-NEXT:    s_lshl_b32 s0, s0, 71579; GFX12-NEXT:    s_add_co_u32 s0, 0x4000, s01580; GFX12-NEXT:    scratch_load_b32 v0, v1, s0 offset:124 scope:SCOPE_SYS1581; GFX12-NEXT:    s_wait_loadcnt 0x01582; GFX12-NEXT:    s_endpgm1583;1584; UNALIGNED_GFX9-LABEL: store_load_vindex_large_offset_kernel:1585; UNALIGNED_GFX9:       ; %bb.0: ; %bb1586; UNALIGNED_GFX9-NEXT:    s_load_dword s0, s[4:5], 0x01587; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s131588; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 01589; UNALIGNED_GFX9-NEXT:    s_mov_b32 s1, 01590; UNALIGNED_GFX9-NEXT:    scratch_load_dword v1, off, s1 offset:4 glc1591; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1592; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v01593; UNALIGNED_GFX9-NEXT:    s_waitcnt lgkmcnt(0)1594; UNALIGNED_GFX9-NEXT:    s_lshl_b32 s0, s0, 71595; UNALIGNED_GFX9-NEXT:    v_sub_u32_e32 v0, 0, v01596; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v1, 0x4004, v11597; UNALIGNED_GFX9-NEXT:    s_add_u32 s0, 0x4004, s01598; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 151599; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v01600; UNALIGNED_GFX9-NEXT:    scratch_store_dword v1, v2, off offset:1281601; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1602; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, s0, v01603; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, v0, off offset:124 glc1604; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1605; UNALIGNED_GFX9-NEXT:    s_endpgm1606;1607; UNALIGNED_GFX10-LABEL: store_load_vindex_large_offset_kernel:1608; UNALIGNED_GFX10:       ; %bb.0: ; %bb1609; UNALIGNED_GFX10-NEXT:    s_add_u32 s8, s8, s131610; UNALIGNED_GFX10-NEXT:    s_addc_u32 s9, s9, 01611; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s81612; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s91613; UNALIGNED_GFX10-NEXT:    s_load_dword s0, s[4:5], 0x01614; UNALIGNED_GFX10-NEXT:    v_sub_nc_u32_e32 v1, 0, v01615; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v01616; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 151617; UNALIGNED_GFX10-NEXT:    scratch_load_dword v3, off, off offset:4 glc dlc1618; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)1619; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v11620; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, 0x4004, v01621; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v2, off offset:1281622; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x01623; UNALIGNED_GFX10-NEXT:    s_waitcnt lgkmcnt(0)1624; UNALIGNED_GFX10-NEXT:    s_lshl_b32 s0, s0, 71625; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, 0x4004, s01626; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v1, s0, v11627; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, v1, off offset:124 glc dlc1628; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)1629; UNALIGNED_GFX10-NEXT:    s_endpgm1630;1631; UNALIGNED_GFX942-LABEL: store_load_vindex_large_offset_kernel:1632; UNALIGNED_GFX942:       ; %bb.0: ; %bb1633; UNALIGNED_GFX942-NEXT:    s_load_dword s0, s[4:5], 0x01634; UNALIGNED_GFX942-NEXT:    scratch_load_dword v1, off, off offset:4 sc0 sc11635; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1636; UNALIGNED_GFX942-NEXT:    v_and_b32_e32 v0, 0x3ff, v01637; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v01638; UNALIGNED_GFX942-NEXT:    v_sub_u32_e32 v0, 0, v01639; UNALIGNED_GFX942-NEXT:    s_waitcnt lgkmcnt(0)1640; UNALIGNED_GFX942-NEXT:    s_lshl_b32 s0, s0, 71641; UNALIGNED_GFX942-NEXT:    s_add_u32 s0, 0x4004, s01642; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 151643; UNALIGNED_GFX942-NEXT:    s_movk_i32 s1, 0x40041644; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v01645; UNALIGNED_GFX942-NEXT:    scratch_store_dword v1, v2, s1 offset:128 sc0 sc11646; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1647; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v0, s0, v01648; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, v0, off offset:124 sc0 sc11649; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1650; UNALIGNED_GFX942-NEXT:    s_endpgm1651;1652; UNALIGNED_GFX11-LABEL: store_load_vindex_large_offset_kernel:1653; UNALIGNED_GFX11:       ; %bb.0: ; %bb1654; UNALIGNED_GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x01655; UNALIGNED_GFX11-NEXT:    v_and_b32_e32 v0, 0x3ff, v01656; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v3, off, off offset:4 glc dlc1657; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1658; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v2, 151659; UNALIGNED_GFX11-NEXT:    v_sub_nc_u32_e32 v1, 0, v01660; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v01661; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_2) | instid1(SALU_CYCLE_1)1662; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v1, 2, v11663; UNALIGNED_GFX11-NEXT:    s_waitcnt lgkmcnt(0)1664; UNALIGNED_GFX11-NEXT:    s_lshl_b32 s0, s0, 71665; UNALIGNED_GFX11-NEXT:    s_add_u32 s0, 0x4004, s01666; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)1667; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v1, s0, v11668; UNALIGNED_GFX11-NEXT:    s_movk_i32 s0, 0x40041669; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v0, v2, s0 offset:128 dlc1670; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x01671; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, v1, off offset:124 glc dlc1672; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1673; UNALIGNED_GFX11-NEXT:    s_endpgm1674;1675; UNALIGNED_GFX12-LABEL: store_load_vindex_large_offset_kernel:1676; UNALIGNED_GFX12:       ; %bb.0: ; %bb1677; UNALIGNED_GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x01678; UNALIGNED_GFX12-NEXT:    v_and_b32_e32 v0, 0x3ff, v01679; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v3, off, off scope:SCOPE_SYS1680; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01681; UNALIGNED_GFX12-NEXT:    v_sub_nc_u32_e32 v1, 0, v01682; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v2, 151683; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v01684; UNALIGNED_GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_3) | instskip(SKIP_4) | instid1(SALU_CYCLE_1)1685; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v11686; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x01687; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v2, off offset:16512 scope:SCOPE_SYS1688; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x01689; UNALIGNED_GFX12-NEXT:    s_lshl_b32 s0, s0, 71690; UNALIGNED_GFX12-NEXT:    s_add_co_u32 s0, 0x4000, s01691; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, v1, s0 offset:124 scope:SCOPE_SYS1692; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01693; UNALIGNED_GFX12-NEXT:    s_endpgm1694bb:1695  %padding = alloca [4096 x i32], align 4, addrspace(5)1696  %i.alloca = alloca [2 x [32 x float]], align 4, addrspace(5)1697  %i = getelementptr inbounds [2 x [32 x float]], ptr addrspace (5) %i.alloca, i32 0, i32 %n1698  %i.1 = getelementptr inbounds [2 x [32 x float]], ptr addrspace (5) %i.alloca, i32 0, i32 11699  %pad_gep = getelementptr inbounds [4096 x i32], ptr addrspace(5) %padding, i32 0, i32 01700  %pad_load = load volatile i32, ptr addrspace(5) %pad_gep, align 41701  %i2 = tail call i32 @llvm.amdgcn.workitem.id.x()1702  %i3 = zext i32 %i2 to i641703  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i.1, i32 0, i32 %i21704  store volatile i32 15, ptr addrspace(5) %i7, align 41705  %i9 = sub nsw i32 0, %i21706  %i9.1 = getelementptr [32 x float], ptr addrspace(5) %i, i32 0, i32 %i91707  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i9.1, i32 0, i32 311708  %i12 = load volatile i32, ptr addrspace(5) %i10, align 41709  ret void1710}1711 1712define void @store_load_vindex_large_offset_foo(i32 %idx) {1713; GFX9-LABEL: store_load_vindex_large_offset_foo:1714; GFX9:       ; %bb.0: ; %bb1715; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1716; GFX9-NEXT:    scratch_load_dword v1, off, s32 offset:4 glc1717; GFX9-NEXT:    s_waitcnt vmcnt(0)1718; GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v01719; GFX9-NEXT:    v_and_b32_e32 v0, 15, v01720; GFX9-NEXT:    v_add_u32_e32 v1, s32, v11721; GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v01722; GFX9-NEXT:    v_add_u32_e32 v1, 0x4004, v11723; GFX9-NEXT:    v_mov_b32_e32 v2, 151724; GFX9-NEXT:    v_add_u32_e32 v0, s32, v01725; GFX9-NEXT:    scratch_store_dword v1, v2, off1726; GFX9-NEXT:    s_waitcnt vmcnt(0)1727; GFX9-NEXT:    v_add_u32_e32 v0, 0x4004, v01728; GFX9-NEXT:    scratch_load_dword v0, v0, off glc1729; GFX9-NEXT:    s_waitcnt vmcnt(0)1730; GFX9-NEXT:    s_setpc_b64 s[30:31]1731;1732; GFX10-LABEL: store_load_vindex_large_offset_foo:1733; GFX10:       ; %bb.0: ; %bb1734; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1735; GFX10-NEXT:    v_and_b32_e32 v1, 15, v01736; GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v01737; GFX10-NEXT:    v_mov_b32_e32 v2, 151738; GFX10-NEXT:    scratch_load_dword v3, off, s32 offset:4 glc dlc1739; GFX10-NEXT:    s_waitcnt vmcnt(0)1740; GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v11741; GFX10-NEXT:    v_add_nc_u32_e32 v0, s32, v01742; GFX10-NEXT:    v_add_nc_u32_e32 v1, s32, v11743; GFX10-NEXT:    v_add_nc_u32_e32 v0, 0x4004, v01744; GFX10-NEXT:    v_add_nc_u32_e32 v1, 0x4004, v11745; GFX10-NEXT:    scratch_store_dword v0, v2, off1746; GFX10-NEXT:    s_waitcnt_vscnt null, 0x01747; GFX10-NEXT:    scratch_load_dword v0, v1, off glc dlc1748; GFX10-NEXT:    s_waitcnt vmcnt(0)1749; GFX10-NEXT:    s_setpc_b64 s[30:31]1750;1751; GFX942-LABEL: store_load_vindex_large_offset_foo:1752; GFX942:       ; %bb.0: ; %bb1753; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1754; GFX942-NEXT:    scratch_load_dword v1, off, s32 offset:4 sc0 sc11755; GFX942-NEXT:    s_waitcnt vmcnt(0)1756; GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v01757; GFX942-NEXT:    v_add_u32_e32 v1, s32, v11758; GFX942-NEXT:    v_add_u32_e32 v1, 0x4004, v11759; GFX942-NEXT:    v_mov_b32_e32 v2, 151760; GFX942-NEXT:    v_and_b32_e32 v0, 15, v01761; GFX942-NEXT:    scratch_store_dword v1, v2, off sc0 sc11762; GFX942-NEXT:    s_waitcnt vmcnt(0)1763; GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v01764; GFX942-NEXT:    s_add_i32 s0, s32, 0x40041765; GFX942-NEXT:    scratch_load_dword v0, v0, s0 sc0 sc11766; GFX942-NEXT:    s_waitcnt vmcnt(0)1767; GFX942-NEXT:    s_setpc_b64 s[30:31]1768;1769; GFX11-LABEL: store_load_vindex_large_offset_foo:1770; GFX11:       ; %bb.0: ; %bb1771; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1772; GFX11-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_lshlrev_b32 v1, 2, v01773; GFX11-NEXT:    v_and_b32_e32 v0, 15, v01774; GFX11-NEXT:    s_add_i32 s0, s32, 0x40041775; GFX11-NEXT:    scratch_load_b32 v3, off, s32 offset:4 glc dlc1776; GFX11-NEXT:    s_waitcnt vmcnt(0)1777; GFX11-NEXT:    v_add_nc_u32_e32 v1, s32, v11778; GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v01779; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2)1780; GFX11-NEXT:    v_add_nc_u32_e32 v1, 0x4004, v11781; GFX11-NEXT:    scratch_store_b32 v1, v2, off dlc1782; GFX11-NEXT:    s_waitcnt_vscnt null, 0x01783; GFX11-NEXT:    scratch_load_b32 v0, v0, s0 glc dlc1784; GFX11-NEXT:    s_waitcnt vmcnt(0)1785; GFX11-NEXT:    s_setpc_b64 s[30:31]1786;1787; GFX12-LABEL: store_load_vindex_large_offset_foo:1788; GFX12:       ; %bb.0: ; %bb1789; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x01790; GFX12-NEXT:    s_wait_expcnt 0x01791; GFX12-NEXT:    s_wait_samplecnt 0x01792; GFX12-NEXT:    s_wait_bvhcnt 0x01793; GFX12-NEXT:    s_wait_kmcnt 0x01794; GFX12-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_and_b32 v1, 15, v01795; GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v01796; GFX12-NEXT:    scratch_load_b32 v3, off, s32 scope:SCOPE_SYS1797; GFX12-NEXT:    s_wait_loadcnt 0x01798; GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v11799; GFX12-NEXT:    s_wait_storecnt 0x01800; GFX12-NEXT:    scratch_store_b32 v0, v2, s32 offset:16384 scope:SCOPE_SYS1801; GFX12-NEXT:    s_wait_storecnt 0x01802; GFX12-NEXT:    scratch_load_b32 v0, v1, s32 offset:16384 scope:SCOPE_SYS1803; GFX12-NEXT:    s_wait_loadcnt 0x01804; GFX12-NEXT:    s_setpc_b64 s[30:31]1805;1806; UNALIGNED_GFX9-LABEL: store_load_vindex_large_offset_foo:1807; UNALIGNED_GFX9:       ; %bb.0: ; %bb1808; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1809; UNALIGNED_GFX9-NEXT:    scratch_load_dword v1, off, s32 offset:4 glc1810; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1811; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v1, 2, v01812; UNALIGNED_GFX9-NEXT:    v_and_b32_e32 v0, 15, v01813; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v1, s32, v11814; UNALIGNED_GFX9-NEXT:    v_lshlrev_b32_e32 v0, 2, v01815; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v1, 0x4004, v11816; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 151817; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, s32, v01818; UNALIGNED_GFX9-NEXT:    scratch_store_dword v1, v2, off1819; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1820; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, 0x4004, v01821; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, v0, off glc1822; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1823; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]1824;1825; UNALIGNED_GFX10-LABEL: store_load_vindex_large_offset_foo:1826; UNALIGNED_GFX10:       ; %bb.0: ; %bb1827; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1828; UNALIGNED_GFX10-NEXT:    v_and_b32_e32 v1, 15, v01829; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v0, 2, v01830; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 151831; UNALIGNED_GFX10-NEXT:    scratch_load_dword v3, off, s32 offset:4 glc dlc1832; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)1833; UNALIGNED_GFX10-NEXT:    v_lshlrev_b32_e32 v1, 2, v11834; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, s32, v01835; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v1, s32, v11836; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, 0x4004, v01837; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v1, 0x4004, v11838; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v2, off1839; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x01840; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, v1, off glc dlc1841; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)1842; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]1843;1844; UNALIGNED_GFX942-LABEL: store_load_vindex_large_offset_foo:1845; UNALIGNED_GFX942:       ; %bb.0: ; %bb1846; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1847; UNALIGNED_GFX942-NEXT:    scratch_load_dword v1, off, s32 offset:4 sc0 sc11848; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1849; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v1, 2, v01850; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v1, s32, v11851; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v1, 0x4004, v11852; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 151853; UNALIGNED_GFX942-NEXT:    v_and_b32_e32 v0, 15, v01854; UNALIGNED_GFX942-NEXT:    scratch_store_dword v1, v2, off sc0 sc11855; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1856; UNALIGNED_GFX942-NEXT:    v_lshlrev_b32_e32 v0, 2, v01857; UNALIGNED_GFX942-NEXT:    s_add_i32 s0, s32, 0x40041858; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, v0, s0 sc0 sc11859; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)1860; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]1861;1862; UNALIGNED_GFX11-LABEL: store_load_vindex_large_offset_foo:1863; UNALIGNED_GFX11:       ; %bb.0: ; %bb1864; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1865; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_lshlrev_b32 v1, 2, v01866; UNALIGNED_GFX11-NEXT:    v_and_b32_e32 v0, 15, v01867; UNALIGNED_GFX11-NEXT:    s_add_i32 s0, s32, 0x40041868; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v3, off, s32 offset:4 glc dlc1869; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1870; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v1, s32, v11871; UNALIGNED_GFX11-NEXT:    v_lshlrev_b32_e32 v0, 2, v01872; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_2)1873; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v1, 0x4004, v11874; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v1, v2, off dlc1875; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x01876; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, v0, s0 glc dlc1877; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)1878; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]1879;1880; UNALIGNED_GFX12-LABEL: store_load_vindex_large_offset_foo:1881; UNALIGNED_GFX12:       ; %bb.0: ; %bb1882; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x01883; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x01884; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x01885; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x01886; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x01887; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v2, 15 :: v_dual_and_b32 v1, 15, v01888; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v0, 2, v01889; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v3, off, s32 scope:SCOPE_SYS1890; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01891; UNALIGNED_GFX12-NEXT:    v_lshlrev_b32_e32 v1, 2, v11892; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x01893; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v2, s32 offset:16384 scope:SCOPE_SYS1894; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x01895; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, v1, s32 offset:16384 scope:SCOPE_SYS1896; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x01897; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]1898bb:1899  %padding = alloca [4096 x i32], align 4, addrspace(5)1900  %i = alloca [32 x float], align 4, addrspace(5)1901  %pad_gep = getelementptr inbounds [4096 x i32], ptr addrspace(5) %padding, i32 0, i32 01902  %pad_load = load volatile i32, ptr addrspace(5) %pad_gep, align 41903  %i7 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %idx1904  store volatile i32 15, ptr addrspace(5) %i7, align 41905  %i9 = and i32 %idx, 151906  %i10 = getelementptr inbounds [32 x float], ptr addrspace(5) %i, i32 0, i32 %i91907  %i12 = load volatile i32, ptr addrspace(5) %i10, align 41908  ret void1909}1910 1911define amdgpu_kernel void @store_load_large_imm_offset_kernel() {1912; GFX9-LABEL: store_load_large_imm_offset_kernel:1913; GFX9:       ; %bb.0: ; %bb1914; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s131915; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 01916; GFX9-NEXT:    v_mov_b32_e32 v0, 131917; GFX9-NEXT:    s_mov_b32 s0, 01918; GFX9-NEXT:    scratch_store_dword off, v0, s0 offset:41919; GFX9-NEXT:    s_waitcnt vmcnt(0)1920; GFX9-NEXT:    s_movk_i32 s0, 0x3e801921; GFX9-NEXT:    v_mov_b32_e32 v0, 151922; GFX9-NEXT:    s_add_i32 s0, s0, 41923; GFX9-NEXT:    scratch_store_dword off, v0, s01924; GFX9-NEXT:    s_waitcnt vmcnt(0)1925; GFX9-NEXT:    scratch_load_dword v0, off, s0 glc1926; GFX9-NEXT:    s_waitcnt vmcnt(0)1927; GFX9-NEXT:    s_endpgm1928;1929; GFX10-LABEL: store_load_large_imm_offset_kernel:1930; GFX10:       ; %bb.0: ; %bb1931; GFX10-NEXT:    s_add_u32 s8, s8, s131932; GFX10-NEXT:    s_addc_u32 s9, s9, 01933; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s81934; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s91935; GFX10-NEXT:    v_mov_b32_e32 v0, 131936; GFX10-NEXT:    v_mov_b32_e32 v1, 151937; GFX10-NEXT:    s_movk_i32 s0, 0x3e801938; GFX10-NEXT:    s_add_i32 s0, s0, 41939; GFX10-NEXT:    scratch_store_dword off, v0, off offset:41940; GFX10-NEXT:    s_waitcnt_vscnt null, 0x01941; GFX10-NEXT:    scratch_store_dword off, v1, s01942; GFX10-NEXT:    s_waitcnt_vscnt null, 0x01943; GFX10-NEXT:    scratch_load_dword v0, off, s0 glc dlc1944; GFX10-NEXT:    s_waitcnt vmcnt(0)1945; GFX10-NEXT:    s_endpgm1946;1947; GFX942-LABEL: store_load_large_imm_offset_kernel:1948; GFX942:       ; %bb.0: ; %bb1949; GFX942-NEXT:    v_mov_b32_e32 v0, 131950; GFX942-NEXT:    s_movk_i32 s0, 0x3e801951; GFX942-NEXT:    scratch_store_dword off, v0, off offset:4 sc0 sc11952; GFX942-NEXT:    s_waitcnt vmcnt(0)1953; GFX942-NEXT:    v_mov_b32_e32 v0, 151954; GFX942-NEXT:    s_add_i32 s0, s0, 41955; GFX942-NEXT:    scratch_store_dword off, v0, s0 sc0 sc11956; GFX942-NEXT:    s_waitcnt vmcnt(0)1957; GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc11958; GFX942-NEXT:    s_waitcnt vmcnt(0)1959; GFX942-NEXT:    s_endpgm1960;1961; GFX11-LABEL: store_load_large_imm_offset_kernel:1962; GFX11:       ; %bb.0: ; %bb1963; GFX11-NEXT:    v_dual_mov_b32 v0, 13 :: v_dual_mov_b32 v1, 151964; GFX11-NEXT:    s_movk_i32 s0, 0x3e801965; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)1966; GFX11-NEXT:    s_add_i32 s0, s0, 41967; GFX11-NEXT:    scratch_store_b32 off, v0, off offset:4 dlc1968; GFX11-NEXT:    s_waitcnt_vscnt null, 0x01969; GFX11-NEXT:    scratch_store_b32 off, v1, s0 dlc1970; GFX11-NEXT:    s_waitcnt_vscnt null, 0x01971; GFX11-NEXT:    scratch_load_b32 v0, off, s0 glc dlc1972; GFX11-NEXT:    s_waitcnt vmcnt(0)1973; GFX11-NEXT:    s_endpgm1974;1975; GFX12-LABEL: store_load_large_imm_offset_kernel:1976; GFX12:       ; %bb.0: ; %bb1977; GFX12-NEXT:    v_dual_mov_b32 v0, 13 :: v_dual_mov_b32 v1, 151978; GFX12-NEXT:    scratch_store_b32 off, v0, off scope:SCOPE_SYS1979; GFX12-NEXT:    s_wait_storecnt 0x01980; GFX12-NEXT:    scratch_store_b32 off, v1, off offset:16000 scope:SCOPE_SYS1981; GFX12-NEXT:    s_wait_storecnt 0x01982; GFX12-NEXT:    scratch_load_b32 v0, off, off offset:16000 scope:SCOPE_SYS1983; GFX12-NEXT:    s_wait_loadcnt 0x01984; GFX12-NEXT:    s_endpgm1985;1986; UNALIGNED_GFX9-LABEL: store_load_large_imm_offset_kernel:1987; UNALIGNED_GFX9:       ; %bb.0: ; %bb1988; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s131989; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 01990; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v0, 131991; UNALIGNED_GFX9-NEXT:    s_mov_b32 s0, 01992; UNALIGNED_GFX9-NEXT:    scratch_store_dword off, v0, s0 offset:41993; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1994; UNALIGNED_GFX9-NEXT:    s_movk_i32 s0, 0x3e801995; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v0, 151996; UNALIGNED_GFX9-NEXT:    s_add_i32 s0, s0, 41997; UNALIGNED_GFX9-NEXT:    scratch_store_dword off, v0, s01998; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)1999; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, off, s0 glc2000; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2001; UNALIGNED_GFX9-NEXT:    s_endpgm2002;2003; UNALIGNED_GFX10-LABEL: store_load_large_imm_offset_kernel:2004; UNALIGNED_GFX10:       ; %bb.0: ; %bb2005; UNALIGNED_GFX10-NEXT:    s_add_u32 s8, s8, s132006; UNALIGNED_GFX10-NEXT:    s_addc_u32 s9, s9, 02007; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s82008; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s92009; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v0, 132010; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 152011; UNALIGNED_GFX10-NEXT:    s_movk_i32 s0, 0x3e802012; UNALIGNED_GFX10-NEXT:    s_add_i32 s0, s0, 42013; UNALIGNED_GFX10-NEXT:    scratch_store_dword off, v0, off offset:42014; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02015; UNALIGNED_GFX10-NEXT:    scratch_store_dword off, v1, s02016; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02017; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, off, s0 glc dlc2018; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2019; UNALIGNED_GFX10-NEXT:    s_endpgm2020;2021; UNALIGNED_GFX942-LABEL: store_load_large_imm_offset_kernel:2022; UNALIGNED_GFX942:       ; %bb.0: ; %bb2023; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v0, 132024; UNALIGNED_GFX942-NEXT:    s_movk_i32 s0, 0x3e802025; UNALIGNED_GFX942-NEXT:    scratch_store_dword off, v0, off offset:4 sc0 sc12026; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2027; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v0, 152028; UNALIGNED_GFX942-NEXT:    s_add_i32 s0, s0, 42029; UNALIGNED_GFX942-NEXT:    scratch_store_dword off, v0, s0 sc0 sc12030; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2031; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc12032; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2033; UNALIGNED_GFX942-NEXT:    s_endpgm2034;2035; UNALIGNED_GFX11-LABEL: store_load_large_imm_offset_kernel:2036; UNALIGNED_GFX11:       ; %bb.0: ; %bb2037; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v0, 13 :: v_dual_mov_b32 v1, 152038; UNALIGNED_GFX11-NEXT:    s_movk_i32 s0, 0x3e802039; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)2040; UNALIGNED_GFX11-NEXT:    s_add_i32 s0, s0, 42041; UNALIGNED_GFX11-NEXT:    scratch_store_b32 off, v0, off offset:4 dlc2042; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02043; UNALIGNED_GFX11-NEXT:    scratch_store_b32 off, v1, s0 dlc2044; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02045; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, off, s0 glc dlc2046; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2047; UNALIGNED_GFX11-NEXT:    s_endpgm2048;2049; UNALIGNED_GFX12-LABEL: store_load_large_imm_offset_kernel:2050; UNALIGNED_GFX12:       ; %bb.0: ; %bb2051; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v0, 13 :: v_dual_mov_b32 v1, 152052; UNALIGNED_GFX12-NEXT:    scratch_store_b32 off, v0, off scope:SCOPE_SYS2053; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02054; UNALIGNED_GFX12-NEXT:    scratch_store_b32 off, v1, off offset:16000 scope:SCOPE_SYS2055; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02056; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, off, off offset:16000 scope:SCOPE_SYS2057; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02058; UNALIGNED_GFX12-NEXT:    s_endpgm2059bb:2060  %i = alloca [4096 x i32], align 4, addrspace(5)2061  %i1 = getelementptr inbounds [4096 x i32], ptr addrspace(5) %i, i32 0, i32 02062  store volatile i32 13, ptr addrspace(5) %i1, align 42063  %i7 = getelementptr inbounds [4096 x i32], ptr addrspace(5) %i, i32 0, i32 40002064  store volatile i32 15, ptr addrspace(5) %i7, align 42065  %i10 = getelementptr inbounds [4096 x i32], ptr addrspace(5) %i, i32 0, i32 40002066  %i12 = load volatile i32, ptr addrspace(5) %i10, align 42067  ret void2068}2069 2070define void @store_load_large_imm_offset_foo() {2071; GFX9-LABEL: store_load_large_imm_offset_foo:2072; GFX9:       ; %bb.0: ; %bb2073; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2074; GFX9-NEXT:    s_movk_i32 s0, 0x3e802075; GFX9-NEXT:    v_mov_b32_e32 v0, 132076; GFX9-NEXT:    s_add_i32 s1, s32, s02077; GFX9-NEXT:    scratch_store_dword off, v0, s32 offset:42078; GFX9-NEXT:    s_waitcnt vmcnt(0)2079; GFX9-NEXT:    v_mov_b32_e32 v0, 152080; GFX9-NEXT:    s_add_i32 s0, s1, 42081; GFX9-NEXT:    scratch_store_dword off, v0, s02082; GFX9-NEXT:    s_waitcnt vmcnt(0)2083; GFX9-NEXT:    scratch_load_dword v0, off, s0 glc2084; GFX9-NEXT:    s_waitcnt vmcnt(0)2085; GFX9-NEXT:    s_setpc_b64 s[30:31]2086;2087; GFX10-LABEL: store_load_large_imm_offset_foo:2088; GFX10:       ; %bb.0: ; %bb2089; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2090; GFX10-NEXT:    v_mov_b32_e32 v0, 132091; GFX10-NEXT:    s_movk_i32 s0, 0x3e802092; GFX10-NEXT:    v_mov_b32_e32 v1, 152093; GFX10-NEXT:    s_add_i32 s1, s32, s02094; GFX10-NEXT:    s_add_i32 s0, s1, 42095; GFX10-NEXT:    scratch_store_dword off, v0, s32 offset:42096; GFX10-NEXT:    s_waitcnt_vscnt null, 0x02097; GFX10-NEXT:    scratch_store_dword off, v1, s02098; GFX10-NEXT:    s_waitcnt_vscnt null, 0x02099; GFX10-NEXT:    scratch_load_dword v0, off, s0 glc dlc2100; GFX10-NEXT:    s_waitcnt vmcnt(0)2101; GFX10-NEXT:    s_setpc_b64 s[30:31]2102;2103; GFX942-LABEL: store_load_large_imm_offset_foo:2104; GFX942:       ; %bb.0: ; %bb2105; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2106; GFX942-NEXT:    s_movk_i32 s0, 0x3e802107; GFX942-NEXT:    v_mov_b32_e32 v0, 132108; GFX942-NEXT:    s_add_i32 s1, s32, s02109; GFX942-NEXT:    scratch_store_dword off, v0, s32 offset:4 sc0 sc12110; GFX942-NEXT:    s_waitcnt vmcnt(0)2111; GFX942-NEXT:    v_mov_b32_e32 v0, 152112; GFX942-NEXT:    s_add_i32 s0, s1, 42113; GFX942-NEXT:    scratch_store_dword off, v0, s0 sc0 sc12114; GFX942-NEXT:    s_waitcnt vmcnt(0)2115; GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc12116; GFX942-NEXT:    s_waitcnt vmcnt(0)2117; GFX942-NEXT:    s_setpc_b64 s[30:31]2118;2119; GFX11-LABEL: store_load_large_imm_offset_foo:2120; GFX11:       ; %bb.0: ; %bb2121; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2122; GFX11-NEXT:    v_dual_mov_b32 v0, 13 :: v_dual_mov_b32 v1, 152123; GFX11-NEXT:    s_movk_i32 s0, 0x3e802124; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)2125; GFX11-NEXT:    s_add_i32 s1, s32, s02126; GFX11-NEXT:    s_add_i32 s0, s1, 42127; GFX11-NEXT:    scratch_store_b32 off, v0, s32 offset:4 dlc2128; GFX11-NEXT:    s_waitcnt_vscnt null, 0x02129; GFX11-NEXT:    scratch_store_b32 off, v1, s0 dlc2130; GFX11-NEXT:    s_waitcnt_vscnt null, 0x02131; GFX11-NEXT:    scratch_load_b32 v0, off, s0 glc dlc2132; GFX11-NEXT:    s_waitcnt vmcnt(0)2133; GFX11-NEXT:    s_setpc_b64 s[30:31]2134;2135; GFX12-LABEL: store_load_large_imm_offset_foo:2136; GFX12:       ; %bb.0: ; %bb2137; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02138; GFX12-NEXT:    s_wait_expcnt 0x02139; GFX12-NEXT:    s_wait_samplecnt 0x02140; GFX12-NEXT:    s_wait_bvhcnt 0x02141; GFX12-NEXT:    s_wait_kmcnt 0x02142; GFX12-NEXT:    v_dual_mov_b32 v0, 13 :: v_dual_mov_b32 v1, 152143; GFX12-NEXT:    s_wait_storecnt 0x02144; GFX12-NEXT:    scratch_store_b32 off, v0, s32 scope:SCOPE_SYS2145; GFX12-NEXT:    s_wait_storecnt 0x02146; GFX12-NEXT:    scratch_store_b32 off, v1, s32 offset:16000 scope:SCOPE_SYS2147; GFX12-NEXT:    s_wait_storecnt 0x02148; GFX12-NEXT:    scratch_load_b32 v0, off, s32 offset:16000 scope:SCOPE_SYS2149; GFX12-NEXT:    s_wait_loadcnt 0x02150; GFX12-NEXT:    s_setpc_b64 s[30:31]2151;2152; UNALIGNED_GFX9-LABEL: store_load_large_imm_offset_foo:2153; UNALIGNED_GFX9:       ; %bb.0: ; %bb2154; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2155; UNALIGNED_GFX9-NEXT:    s_movk_i32 s0, 0x3e802156; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v0, 132157; UNALIGNED_GFX9-NEXT:    s_add_i32 s1, s32, s02158; UNALIGNED_GFX9-NEXT:    scratch_store_dword off, v0, s32 offset:42159; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2160; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v0, 152161; UNALIGNED_GFX9-NEXT:    s_add_i32 s0, s1, 42162; UNALIGNED_GFX9-NEXT:    scratch_store_dword off, v0, s02163; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2164; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, off, s0 glc2165; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2166; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]2167;2168; UNALIGNED_GFX10-LABEL: store_load_large_imm_offset_foo:2169; UNALIGNED_GFX10:       ; %bb.0: ; %bb2170; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2171; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v0, 132172; UNALIGNED_GFX10-NEXT:    s_movk_i32 s0, 0x3e802173; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 152174; UNALIGNED_GFX10-NEXT:    s_add_i32 s1, s32, s02175; UNALIGNED_GFX10-NEXT:    s_add_i32 s0, s1, 42176; UNALIGNED_GFX10-NEXT:    scratch_store_dword off, v0, s32 offset:42177; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02178; UNALIGNED_GFX10-NEXT:    scratch_store_dword off, v1, s02179; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02180; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, off, s0 glc dlc2181; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2182; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]2183;2184; UNALIGNED_GFX942-LABEL: store_load_large_imm_offset_foo:2185; UNALIGNED_GFX942:       ; %bb.0: ; %bb2186; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2187; UNALIGNED_GFX942-NEXT:    s_movk_i32 s0, 0x3e802188; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v0, 132189; UNALIGNED_GFX942-NEXT:    s_add_i32 s1, s32, s02190; UNALIGNED_GFX942-NEXT:    scratch_store_dword off, v0, s32 offset:4 sc0 sc12191; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2192; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v0, 152193; UNALIGNED_GFX942-NEXT:    s_add_i32 s0, s1, 42194; UNALIGNED_GFX942-NEXT:    scratch_store_dword off, v0, s0 sc0 sc12195; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2196; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, off, s0 sc0 sc12197; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2198; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]2199;2200; UNALIGNED_GFX11-LABEL: store_load_large_imm_offset_foo:2201; UNALIGNED_GFX11:       ; %bb.0: ; %bb2202; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2203; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v0, 13 :: v_dual_mov_b32 v1, 152204; UNALIGNED_GFX11-NEXT:    s_movk_i32 s0, 0x3e802205; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(SALU_CYCLE_1)2206; UNALIGNED_GFX11-NEXT:    s_add_i32 s1, s32, s02207; UNALIGNED_GFX11-NEXT:    s_add_i32 s0, s1, 42208; UNALIGNED_GFX11-NEXT:    scratch_store_b32 off, v0, s32 offset:4 dlc2209; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02210; UNALIGNED_GFX11-NEXT:    scratch_store_b32 off, v1, s0 dlc2211; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02212; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, off, s0 glc dlc2213; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2214; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]2215;2216; UNALIGNED_GFX12-LABEL: store_load_large_imm_offset_foo:2217; UNALIGNED_GFX12:       ; %bb.0: ; %bb2218; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02219; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x02220; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x02221; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x02222; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x02223; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v0, 13 :: v_dual_mov_b32 v1, 152224; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02225; UNALIGNED_GFX12-NEXT:    scratch_store_b32 off, v0, s32 scope:SCOPE_SYS2226; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02227; UNALIGNED_GFX12-NEXT:    scratch_store_b32 off, v1, s32 offset:16000 scope:SCOPE_SYS2228; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02229; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, off, s32 offset:16000 scope:SCOPE_SYS2230; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02231; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]2232bb:2233  %i = alloca [4096 x i32], align 4, addrspace(5)2234  %i1 = getelementptr inbounds [4096 x i32], ptr addrspace(5) %i, i32 0, i32 02235  store volatile i32 13, ptr addrspace(5) %i1, align 42236  %i7 = getelementptr inbounds [4096 x i32], ptr addrspace(5) %i, i32 0, i32 40002237  store volatile i32 15, ptr addrspace(5) %i7, align 42238  %i10 = getelementptr inbounds [4096 x i32], ptr addrspace(5) %i, i32 0, i32 40002239  %i12 = load volatile i32, ptr addrspace(5) %i10, align 42240  ret void2241}2242 2243define amdgpu_kernel void @store_load_vidx_sidx_offset(i32 %sidx) {2244; GFX9-LABEL: store_load_vidx_sidx_offset:2245; GFX9:       ; %bb.0: ; %bb2246; GFX9-NEXT:    s_load_dword s0, s[4:5], 0x02247; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s132248; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 02249; GFX9-NEXT:    v_mov_b32_e32 v1, 152250; GFX9-NEXT:    s_waitcnt lgkmcnt(0)2251; GFX9-NEXT:    v_add_lshl_u32 v0, s0, v0, 22252; GFX9-NEXT:    scratch_store_dword v0, v1, off offset:10242253; GFX9-NEXT:    s_waitcnt vmcnt(0)2254; GFX9-NEXT:    scratch_load_dword v0, v0, off offset:1024 glc2255; GFX9-NEXT:    s_waitcnt vmcnt(0)2256; GFX9-NEXT:    s_endpgm2257;2258; GFX10-LABEL: store_load_vidx_sidx_offset:2259; GFX10:       ; %bb.0: ; %bb2260; GFX10-NEXT:    s_add_u32 s8, s8, s132261; GFX10-NEXT:    s_addc_u32 s9, s9, 02262; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s82263; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s92264; GFX10-NEXT:    s_load_dword s0, s[4:5], 0x02265; GFX10-NEXT:    v_mov_b32_e32 v1, 152266; GFX10-NEXT:    s_waitcnt lgkmcnt(0)2267; GFX10-NEXT:    v_add_lshl_u32 v0, s0, v0, 22268; GFX10-NEXT:    scratch_store_dword v0, v1, off offset:10242269; GFX10-NEXT:    s_waitcnt_vscnt null, 0x02270; GFX10-NEXT:    scratch_load_dword v0, v0, off offset:1024 glc dlc2271; GFX10-NEXT:    s_waitcnt vmcnt(0)2272; GFX10-NEXT:    s_endpgm2273;2274; GFX942-LABEL: store_load_vidx_sidx_offset:2275; GFX942:       ; %bb.0: ; %bb2276; GFX942-NEXT:    s_load_dword s0, s[4:5], 0x02277; GFX942-NEXT:    v_and_b32_e32 v0, 0x3ff, v02278; GFX942-NEXT:    v_mov_b32_e32 v1, 152279; GFX942-NEXT:    s_waitcnt lgkmcnt(0)2280; GFX942-NEXT:    v_add_lshl_u32 v0, s0, v0, 22281; GFX942-NEXT:    scratch_store_dword v0, v1, off offset:1024 sc0 sc12282; GFX942-NEXT:    s_waitcnt vmcnt(0)2283; GFX942-NEXT:    scratch_load_dword v0, v0, off offset:1024 sc0 sc12284; GFX942-NEXT:    s_waitcnt vmcnt(0)2285; GFX942-NEXT:    s_endpgm2286;2287; GFX11-LABEL: store_load_vidx_sidx_offset:2288; GFX11:       ; %bb.0: ; %bb2289; GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x02290; GFX11-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_and_b32 v0, 0x3ff, v02291; GFX11-NEXT:    s_waitcnt lgkmcnt(0)2292; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)2293; GFX11-NEXT:    v_add_lshl_u32 v0, s0, v0, 22294; GFX11-NEXT:    scratch_store_b32 v0, v1, off offset:1024 dlc2295; GFX11-NEXT:    s_waitcnt_vscnt null, 0x02296; GFX11-NEXT:    scratch_load_b32 v0, v0, off offset:1024 glc dlc2297; GFX11-NEXT:    s_waitcnt vmcnt(0)2298; GFX11-NEXT:    s_endpgm2299;2300; GFX12-LABEL: store_load_vidx_sidx_offset:2301; GFX12:       ; %bb.0: ; %bb2302; GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x02303; GFX12-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_and_b32 v0, 0x3ff, v02304; GFX12-NEXT:    s_wait_kmcnt 0x02305; GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_1)2306; GFX12-NEXT:    v_add_lshl_u32 v0, s0, v0, 22307; GFX12-NEXT:    scratch_store_b32 v0, v1, off offset:1024 scope:SCOPE_SYS2308; GFX12-NEXT:    s_wait_storecnt 0x02309; GFX12-NEXT:    scratch_load_b32 v0, v0, off offset:1024 scope:SCOPE_SYS2310; GFX12-NEXT:    s_wait_loadcnt 0x02311; GFX12-NEXT:    s_endpgm2312;2313; UNALIGNED_GFX9-LABEL: store_load_vidx_sidx_offset:2314; UNALIGNED_GFX9:       ; %bb.0: ; %bb2315; UNALIGNED_GFX9-NEXT:    s_load_dword s0, s[4:5], 0x02316; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s8, s132317; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s9, 02318; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 152319; UNALIGNED_GFX9-NEXT:    s_waitcnt lgkmcnt(0)2320; UNALIGNED_GFX9-NEXT:    v_add_lshl_u32 v0, s0, v0, 22321; UNALIGNED_GFX9-NEXT:    scratch_store_dword v0, v1, off offset:10242322; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2323; UNALIGNED_GFX9-NEXT:    scratch_load_dword v0, v0, off offset:1024 glc2324; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2325; UNALIGNED_GFX9-NEXT:    s_endpgm2326;2327; UNALIGNED_GFX10-LABEL: store_load_vidx_sidx_offset:2328; UNALIGNED_GFX10:       ; %bb.0: ; %bb2329; UNALIGNED_GFX10-NEXT:    s_add_u32 s8, s8, s132330; UNALIGNED_GFX10-NEXT:    s_addc_u32 s9, s9, 02331; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s82332; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s92333; UNALIGNED_GFX10-NEXT:    s_load_dword s0, s[4:5], 0x02334; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 152335; UNALIGNED_GFX10-NEXT:    s_waitcnt lgkmcnt(0)2336; UNALIGNED_GFX10-NEXT:    v_add_lshl_u32 v0, s0, v0, 22337; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v1, off offset:10242338; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02339; UNALIGNED_GFX10-NEXT:    scratch_load_dword v0, v0, off offset:1024 glc dlc2340; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2341; UNALIGNED_GFX10-NEXT:    s_endpgm2342;2343; UNALIGNED_GFX942-LABEL: store_load_vidx_sidx_offset:2344; UNALIGNED_GFX942:       ; %bb.0: ; %bb2345; UNALIGNED_GFX942-NEXT:    s_load_dword s0, s[4:5], 0x02346; UNALIGNED_GFX942-NEXT:    v_and_b32_e32 v0, 0x3ff, v02347; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 152348; UNALIGNED_GFX942-NEXT:    s_waitcnt lgkmcnt(0)2349; UNALIGNED_GFX942-NEXT:    v_add_lshl_u32 v0, s0, v0, 22350; UNALIGNED_GFX942-NEXT:    scratch_store_dword v0, v1, off offset:1024 sc0 sc12351; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2352; UNALIGNED_GFX942-NEXT:    scratch_load_dword v0, v0, off offset:1024 sc0 sc12353; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2354; UNALIGNED_GFX942-NEXT:    s_endpgm2355;2356; UNALIGNED_GFX11-LABEL: store_load_vidx_sidx_offset:2357; UNALIGNED_GFX11:       ; %bb.0: ; %bb2358; UNALIGNED_GFX11-NEXT:    s_load_b32 s0, s[4:5], 0x02359; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_and_b32 v0, 0x3ff, v02360; UNALIGNED_GFX11-NEXT:    s_waitcnt lgkmcnt(0)2361; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)2362; UNALIGNED_GFX11-NEXT:    v_add_lshl_u32 v0, s0, v0, 22363; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v0, v1, off offset:1024 dlc2364; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02365; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v0, v0, off offset:1024 glc dlc2366; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2367; UNALIGNED_GFX11-NEXT:    s_endpgm2368;2369; UNALIGNED_GFX12-LABEL: store_load_vidx_sidx_offset:2370; UNALIGNED_GFX12:       ; %bb.0: ; %bb2371; UNALIGNED_GFX12-NEXT:    s_load_b32 s0, s[4:5], 0x02372; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_and_b32 v0, 0x3ff, v02373; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x02374; UNALIGNED_GFX12-NEXT:    s_delay_alu instid0(VALU_DEP_1)2375; UNALIGNED_GFX12-NEXT:    v_add_lshl_u32 v0, s0, v0, 22376; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v1, off offset:1024 scope:SCOPE_SYS2377; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02378; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v0, v0, off offset:1024 scope:SCOPE_SYS2379; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02380; UNALIGNED_GFX12-NEXT:    s_endpgm2381bb:2382  %alloca = alloca [32 x i32], align 4, addrspace(5)2383  %vidx = tail call i32 @llvm.amdgcn.workitem.id.x()2384  %add1 = add nsw i32 %sidx, %vidx2385  %gep1 = getelementptr [32 x float], ptr addrspace(5) %alloca, i32 0, i32 %add12386  %gep = getelementptr inbounds [32 x float], ptr addrspace(5) %gep1, i32 0, i32 2562387  store volatile i32 15, ptr addrspace(5) %gep, align 42388  %load = load volatile i32, ptr addrspace(5) %gep, align 42389  ret void2390}2391 2392define void @store_load_i64_aligned(ptr addrspace(5) nocapture %arg) {2393; GFX9-LABEL: store_load_i64_aligned:2394; GFX9:       ; %bb.0: ; %bb2395; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2396; GFX9-NEXT:    v_mov_b32_e32 v1, 152397; GFX9-NEXT:    v_mov_b32_e32 v2, 02398; GFX9-NEXT:    scratch_store_dwordx2 v0, v[1:2], off2399; GFX9-NEXT:    s_waitcnt vmcnt(0)2400; GFX9-NEXT:    scratch_load_dwordx2 v[0:1], v0, off glc2401; GFX9-NEXT:    s_waitcnt vmcnt(0)2402; GFX9-NEXT:    s_setpc_b64 s[30:31]2403;2404; GFX10-LABEL: store_load_i64_aligned:2405; GFX10:       ; %bb.0: ; %bb2406; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2407; GFX10-NEXT:    v_mov_b32_e32 v1, 152408; GFX10-NEXT:    v_mov_b32_e32 v2, 02409; GFX10-NEXT:    scratch_store_dwordx2 v0, v[1:2], off2410; GFX10-NEXT:    s_waitcnt_vscnt null, 0x02411; GFX10-NEXT:    scratch_load_dwordx2 v[0:1], v0, off glc dlc2412; GFX10-NEXT:    s_waitcnt vmcnt(0)2413; GFX10-NEXT:    s_setpc_b64 s[30:31]2414;2415; GFX942-LABEL: store_load_i64_aligned:2416; GFX942:       ; %bb.0: ; %bb2417; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2418; GFX942-NEXT:    v_mov_b64_e32 v[2:3], 152419; GFX942-NEXT:    scratch_store_dwordx2 v0, v[2:3], off sc0 sc12420; GFX942-NEXT:    s_waitcnt vmcnt(0)2421; GFX942-NEXT:    scratch_load_dwordx2 v[0:1], v0, off sc0 sc12422; GFX942-NEXT:    s_waitcnt vmcnt(0)2423; GFX942-NEXT:    s_setpc_b64 s[30:31]2424;2425; GFX11-LABEL: store_load_i64_aligned:2426; GFX11:       ; %bb.0: ; %bb2427; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2428; GFX11-NEXT:    v_mov_b32_e32 v1, 152429; GFX11-NEXT:    v_mov_b32_e32 v2, 02430; GFX11-NEXT:    scratch_store_b64 v0, v[1:2], off dlc2431; GFX11-NEXT:    s_waitcnt_vscnt null, 0x02432; GFX11-NEXT:    scratch_load_b64 v[0:1], v0, off glc dlc2433; GFX11-NEXT:    s_waitcnt vmcnt(0)2434; GFX11-NEXT:    s_setpc_b64 s[30:31]2435;2436; GFX12-LABEL: store_load_i64_aligned:2437; GFX12:       ; %bb.0: ; %bb2438; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02439; GFX12-NEXT:    s_wait_expcnt 0x02440; GFX12-NEXT:    s_wait_samplecnt 0x02441; GFX12-NEXT:    s_wait_bvhcnt 0x02442; GFX12-NEXT:    s_wait_kmcnt 0x02443; GFX12-NEXT:    v_mov_b32_e32 v1, 152444; GFX12-NEXT:    v_mov_b32_e32 v2, 02445; GFX12-NEXT:    s_wait_storecnt 0x02446; GFX12-NEXT:    scratch_store_b64 v0, v[1:2], off scope:SCOPE_SYS2447; GFX12-NEXT:    s_wait_storecnt 0x02448; GFX12-NEXT:    scratch_load_b64 v[0:1], v0, off scope:SCOPE_SYS2449; GFX12-NEXT:    s_wait_loadcnt 0x02450; GFX12-NEXT:    s_setpc_b64 s[30:31]2451;2452; UNALIGNED_GFX9-LABEL: store_load_i64_aligned:2453; UNALIGNED_GFX9:       ; %bb.0: ; %bb2454; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2455; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 152456; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 02457; UNALIGNED_GFX9-NEXT:    scratch_store_dwordx2 v0, v[1:2], off2458; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2459; UNALIGNED_GFX9-NEXT:    scratch_load_dwordx2 v[0:1], v0, off glc2460; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2461; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]2462;2463; UNALIGNED_GFX10-LABEL: store_load_i64_aligned:2464; UNALIGNED_GFX10:       ; %bb.0: ; %bb2465; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2466; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 152467; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 02468; UNALIGNED_GFX10-NEXT:    scratch_store_dwordx2 v0, v[1:2], off2469; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02470; UNALIGNED_GFX10-NEXT:    scratch_load_dwordx2 v[0:1], v0, off glc dlc2471; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2472; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]2473;2474; UNALIGNED_GFX942-LABEL: store_load_i64_aligned:2475; UNALIGNED_GFX942:       ; %bb.0: ; %bb2476; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2477; UNALIGNED_GFX942-NEXT:    v_mov_b64_e32 v[2:3], 152478; UNALIGNED_GFX942-NEXT:    scratch_store_dwordx2 v0, v[2:3], off sc0 sc12479; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2480; UNALIGNED_GFX942-NEXT:    scratch_load_dwordx2 v[0:1], v0, off sc0 sc12481; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2482; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]2483;2484; UNALIGNED_GFX11-LABEL: store_load_i64_aligned:2485; UNALIGNED_GFX11:       ; %bb.0: ; %bb2486; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2487; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v1, 152488; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v2, 02489; UNALIGNED_GFX11-NEXT:    scratch_store_b64 v0, v[1:2], off dlc2490; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02491; UNALIGNED_GFX11-NEXT:    scratch_load_b64 v[0:1], v0, off glc dlc2492; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2493; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]2494;2495; UNALIGNED_GFX12-LABEL: store_load_i64_aligned:2496; UNALIGNED_GFX12:       ; %bb.0: ; %bb2497; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02498; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x02499; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x02500; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x02501; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x02502; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v1, 152503; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v2, 02504; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02505; UNALIGNED_GFX12-NEXT:    scratch_store_b64 v0, v[1:2], off scope:SCOPE_SYS2506; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02507; UNALIGNED_GFX12-NEXT:    scratch_load_b64 v[0:1], v0, off scope:SCOPE_SYS2508; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02509; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]2510bb:2511  store volatile i64 15, ptr addrspace(5) %arg, align 82512  %load = load volatile i64, ptr addrspace(5) %arg, align 82513  ret void2514}2515 2516define void @store_load_i64_unaligned(ptr addrspace(5) nocapture %arg) {2517; GFX9-LABEL: store_load_i64_unaligned:2518; GFX9:       ; %bb.0: ; %bb2519; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2520; GFX9-NEXT:    v_mov_b32_e32 v1, 152521; GFX9-NEXT:    v_mov_b32_e32 v2, 02522; GFX9-NEXT:    scratch_store_dwordx2 v0, v[1:2], off2523; GFX9-NEXT:    s_waitcnt vmcnt(0)2524; GFX9-NEXT:    scratch_load_dwordx2 v[0:1], v0, off glc2525; GFX9-NEXT:    s_waitcnt vmcnt(0)2526; GFX9-NEXT:    s_setpc_b64 s[30:31]2527;2528; GFX10-LABEL: store_load_i64_unaligned:2529; GFX10:       ; %bb.0: ; %bb2530; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2531; GFX10-NEXT:    v_mov_b32_e32 v1, 152532; GFX10-NEXT:    v_mov_b32_e32 v2, 02533; GFX10-NEXT:    scratch_store_dwordx2 v0, v[1:2], off2534; GFX10-NEXT:    s_waitcnt_vscnt null, 0x02535; GFX10-NEXT:    scratch_load_dwordx2 v[0:1], v0, off glc dlc2536; GFX10-NEXT:    s_waitcnt vmcnt(0)2537; GFX10-NEXT:    s_setpc_b64 s[30:31]2538;2539; GFX942-LABEL: store_load_i64_unaligned:2540; GFX942:       ; %bb.0: ; %bb2541; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2542; GFX942-NEXT:    v_mov_b64_e32 v[2:3], 152543; GFX942-NEXT:    scratch_store_dwordx2 v0, v[2:3], off sc0 sc12544; GFX942-NEXT:    s_waitcnt vmcnt(0)2545; GFX942-NEXT:    scratch_load_dwordx2 v[0:1], v0, off sc0 sc12546; GFX942-NEXT:    s_waitcnt vmcnt(0)2547; GFX942-NEXT:    s_setpc_b64 s[30:31]2548;2549; GFX11-LABEL: store_load_i64_unaligned:2550; GFX11:       ; %bb.0: ; %bb2551; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2552; GFX11-NEXT:    v_mov_b32_e32 v1, 152553; GFX11-NEXT:    v_mov_b32_e32 v2, 02554; GFX11-NEXT:    scratch_store_b64 v0, v[1:2], off dlc2555; GFX11-NEXT:    s_waitcnt_vscnt null, 0x02556; GFX11-NEXT:    scratch_load_b64 v[0:1], v0, off glc dlc2557; GFX11-NEXT:    s_waitcnt vmcnt(0)2558; GFX11-NEXT:    s_setpc_b64 s[30:31]2559;2560; GFX12-LABEL: store_load_i64_unaligned:2561; GFX12:       ; %bb.0: ; %bb2562; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02563; GFX12-NEXT:    s_wait_expcnt 0x02564; GFX12-NEXT:    s_wait_samplecnt 0x02565; GFX12-NEXT:    s_wait_bvhcnt 0x02566; GFX12-NEXT:    s_wait_kmcnt 0x02567; GFX12-NEXT:    v_mov_b32_e32 v1, 152568; GFX12-NEXT:    v_mov_b32_e32 v2, 02569; GFX12-NEXT:    s_wait_storecnt 0x02570; GFX12-NEXT:    scratch_store_b64 v0, v[1:2], off scope:SCOPE_SYS2571; GFX12-NEXT:    s_wait_storecnt 0x02572; GFX12-NEXT:    scratch_load_b64 v[0:1], v0, off scope:SCOPE_SYS2573; GFX12-NEXT:    s_wait_loadcnt 0x02574; GFX12-NEXT:    s_setpc_b64 s[30:31]2575;2576; UNALIGNED_GFX9-LABEL: store_load_i64_unaligned:2577; UNALIGNED_GFX9:       ; %bb.0: ; %bb2578; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2579; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 152580; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off2581; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2582; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 02583; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:12584; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2585; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:22586; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2587; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:32588; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2589; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:42590; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2591; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:52592; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2593; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:62594; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2595; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:72596; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2597; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off glc2598; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2599; UNALIGNED_GFX9-NEXT:    ; kill: killed $vgpr02600; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:1 glc2601; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2602; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:2 glc2603; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2604; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:3 glc2605; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2606; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:4 glc2607; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2608; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:5 glc2609; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2610; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:6 glc2611; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2612; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:7 glc2613; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2614; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]2615;2616; UNALIGNED_GFX10-LABEL: store_load_i64_unaligned:2617; UNALIGNED_GFX10:       ; %bb.0: ; %bb2618; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2619; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 152620; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 02621; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v1, off2622; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02623; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:12624; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02625; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:22626; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02627; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:32628; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02629; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:42630; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02631; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:52632; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02633; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:62634; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02635; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:72636; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02637; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off glc dlc2638; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2639; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:1 glc dlc2640; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2641; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:2 glc dlc2642; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2643; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:3 glc dlc2644; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2645; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:4 glc dlc2646; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2647; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:5 glc dlc2648; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2649; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:6 glc dlc2650; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2651; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v0, v0, off offset:7 glc dlc2652; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2653; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]2654;2655; UNALIGNED_GFX942-LABEL: store_load_i64_unaligned:2656; UNALIGNED_GFX942:       ; %bb.0: ; %bb2657; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2658; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 152659; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off sc0 sc12660; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2661; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 02662; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:1 sc0 sc12663; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2664; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:2 sc0 sc12665; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2666; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:3 sc0 sc12667; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2668; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:4 sc0 sc12669; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2670; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:5 sc0 sc12671; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2672; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:6 sc0 sc12673; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2674; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:7 sc0 sc12675; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2676; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off sc0 sc12677; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2678; UNALIGNED_GFX942-NEXT:    ; kill: killed $vgpr02679; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:1 sc0 sc12680; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2681; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:2 sc0 sc12682; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2683; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:3 sc0 sc12684; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2685; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:4 sc0 sc12686; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2687; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:5 sc0 sc12688; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2689; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:6 sc0 sc12690; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2691; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:7 sc0 sc12692; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2693; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]2694;2695; UNALIGNED_GFX11-LABEL: store_load_i64_unaligned:2696; UNALIGNED_GFX11:       ; %bb.0: ; %bb2697; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2698; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_mov_b32 v2, 02699; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v1, off dlc2700; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02701; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:1 dlc2702; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02703; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:2 dlc2704; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02705; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:3 dlc2706; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02707; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:4 dlc2708; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02709; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:5 dlc2710; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02711; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:6 dlc2712; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02713; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:7 dlc2714; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x02715; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off glc dlc2716; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2717; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:1 glc dlc2718; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2719; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:2 glc dlc2720; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2721; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:3 glc dlc2722; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2723; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:4 glc dlc2724; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2725; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:5 glc dlc2726; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2727; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:6 glc dlc2728; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2729; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v0, v0, off offset:7 glc dlc2730; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)2731; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]2732;2733; UNALIGNED_GFX12-LABEL: store_load_i64_unaligned:2734; UNALIGNED_GFX12:       ; %bb.0: ; %bb2735; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02736; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x02737; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x02738; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x02739; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x02740; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_mov_b32 v2, 02741; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02742; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v1, off scope:SCOPE_SYS2743; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02744; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:1 scope:SCOPE_SYS2745; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02746; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:2 scope:SCOPE_SYS2747; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02748; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:3 scope:SCOPE_SYS2749; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02750; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:4 scope:SCOPE_SYS2751; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02752; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:5 scope:SCOPE_SYS2753; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02754; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:6 scope:SCOPE_SYS2755; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02756; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:7 scope:SCOPE_SYS2757; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x02758; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off scope:SCOPE_SYS2759; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02760; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:1 scope:SCOPE_SYS2761; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02762; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:2 scope:SCOPE_SYS2763; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02764; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:3 scope:SCOPE_SYS2765; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02766; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:4 scope:SCOPE_SYS2767; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02768; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:5 scope:SCOPE_SYS2769; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02770; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:6 scope:SCOPE_SYS2771; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02772; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v0, v0, off offset:7 scope:SCOPE_SYS2773; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x02774; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]2775bb:2776  store volatile i64 15, ptr addrspace(5) %arg, align 12777  %load = load volatile i64, ptr addrspace(5) %arg, align 12778  ret void2779}2780 2781define void @store_load_v3i32_unaligned(ptr addrspace(5) nocapture %arg) {2782; GFX9-LABEL: store_load_v3i32_unaligned:2783; GFX9:       ; %bb.0: ; %bb2784; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2785; GFX9-NEXT:    s_mov_b32 s2, 32786; GFX9-NEXT:    s_mov_b32 s1, 22787; GFX9-NEXT:    s_mov_b32 s0, 12788; GFX9-NEXT:    v_mov_b32_e32 v3, s22789; GFX9-NEXT:    v_mov_b32_e32 v2, s12790; GFX9-NEXT:    v_mov_b32_e32 v1, s02791; GFX9-NEXT:    scratch_store_dwordx3 v0, v[1:3], off2792; GFX9-NEXT:    s_waitcnt vmcnt(0)2793; GFX9-NEXT:    scratch_load_dwordx3 v[0:2], v0, off glc2794; GFX9-NEXT:    s_waitcnt vmcnt(0)2795; GFX9-NEXT:    s_setpc_b64 s[30:31]2796;2797; GFX10-LABEL: store_load_v3i32_unaligned:2798; GFX10:       ; %bb.0: ; %bb2799; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2800; GFX10-NEXT:    s_mov_b32 s2, 32801; GFX10-NEXT:    s_mov_b32 s1, 22802; GFX10-NEXT:    s_mov_b32 s0, 12803; GFX10-NEXT:    v_mov_b32_e32 v3, s22804; GFX10-NEXT:    v_mov_b32_e32 v2, s12805; GFX10-NEXT:    v_mov_b32_e32 v1, s02806; GFX10-NEXT:    scratch_store_dwordx3 v0, v[1:3], off2807; GFX10-NEXT:    s_waitcnt_vscnt null, 0x02808; GFX10-NEXT:    scratch_load_dwordx3 v[0:2], v0, off glc dlc2809; GFX10-NEXT:    s_waitcnt vmcnt(0)2810; GFX10-NEXT:    s_setpc_b64 s[30:31]2811;2812; GFX942-LABEL: store_load_v3i32_unaligned:2813; GFX942:       ; %bb.0: ; %bb2814; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2815; GFX942-NEXT:    s_mov_b32 s2, 32816; GFX942-NEXT:    s_mov_b32 s1, 22817; GFX942-NEXT:    s_mov_b32 s0, 12818; GFX942-NEXT:    v_mov_b32_e32 v4, s22819; GFX942-NEXT:    v_mov_b32_e32 v3, s12820; GFX942-NEXT:    v_mov_b32_e32 v2, s02821; GFX942-NEXT:    scratch_store_dwordx3 v0, v[2:4], off sc0 sc12822; GFX942-NEXT:    s_waitcnt vmcnt(0)2823; GFX942-NEXT:    scratch_load_dwordx3 v[0:2], v0, off sc0 sc12824; GFX942-NEXT:    s_waitcnt vmcnt(0)2825; GFX942-NEXT:    s_setpc_b64 s[30:31]2826;2827; GFX11-LABEL: store_load_v3i32_unaligned:2828; GFX11:       ; %bb.0: ; %bb2829; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2830; GFX11-NEXT:    s_mov_b32 s2, 32831; GFX11-NEXT:    s_mov_b32 s1, 22832; GFX11-NEXT:    s_mov_b32 s0, 12833; GFX11-NEXT:    v_dual_mov_b32 v3, s2 :: v_dual_mov_b32 v2, s12834; GFX11-NEXT:    v_mov_b32_e32 v1, s02835; GFX11-NEXT:    scratch_store_b96 v0, v[1:3], off dlc2836; GFX11-NEXT:    s_waitcnt_vscnt null, 0x02837; GFX11-NEXT:    scratch_load_b96 v[0:2], v0, off glc dlc2838; GFX11-NEXT:    s_waitcnt vmcnt(0)2839; GFX11-NEXT:    s_setpc_b64 s[30:31]2840;2841; GFX12-LABEL: store_load_v3i32_unaligned:2842; GFX12:       ; %bb.0: ; %bb2843; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x02844; GFX12-NEXT:    s_wait_expcnt 0x02845; GFX12-NEXT:    s_wait_samplecnt 0x02846; GFX12-NEXT:    s_wait_bvhcnt 0x02847; GFX12-NEXT:    s_wait_kmcnt 0x02848; GFX12-NEXT:    s_mov_b32 s2, 32849; GFX12-NEXT:    s_mov_b32 s1, 22850; GFX12-NEXT:    s_mov_b32 s0, 12851; GFX12-NEXT:    s_wait_alu depctr_sa_sdst(0)2852; GFX12-NEXT:    v_dual_mov_b32 v3, s2 :: v_dual_mov_b32 v2, s12853; GFX12-NEXT:    v_mov_b32_e32 v1, s02854; GFX12-NEXT:    s_wait_storecnt 0x02855; GFX12-NEXT:    scratch_store_b96 v0, v[1:3], off scope:SCOPE_SYS2856; GFX12-NEXT:    s_wait_storecnt 0x02857; GFX12-NEXT:    scratch_load_b96 v[0:2], v0, off scope:SCOPE_SYS2858; GFX12-NEXT:    s_wait_loadcnt 0x02859; GFX12-NEXT:    s_setpc_b64 s[30:31]2860;2861; UNALIGNED_GFX9-LABEL: store_load_v3i32_unaligned:2862; UNALIGNED_GFX9:       ; %bb.0: ; %bb2863; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2864; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 12865; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off2866; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2867; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 02868; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 22869; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:12870; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2871; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:22872; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2873; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:32874; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2875; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v2, off offset:42876; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2877; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:52878; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2879; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:62880; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2881; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:72882; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2883; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 32884; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v2, off offset:82885; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2886; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:92887; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2888; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:102889; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2890; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:112891; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2892; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off glc2893; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2894; UNALIGNED_GFX9-NEXT:    ; kill: killed $vgpr02895; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:1 glc2896; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2897; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:2 glc2898; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2899; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:3 glc2900; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2901; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:4 glc2902; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2903; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:5 glc2904; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2905; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:6 glc2906; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2907; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:7 glc2908; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2909; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:8 glc2910; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2911; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:9 glc2912; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2913; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:10 glc2914; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2915; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:11 glc2916; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)2917; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]2918;2919; UNALIGNED_GFX10-LABEL: store_load_v3i32_unaligned:2920; UNALIGNED_GFX10:       ; %bb.0: ; %bb2921; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2922; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 12923; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 02924; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v3, 22925; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v1, off2926; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02927; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:12928; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02929; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:22930; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02931; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:32932; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02933; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 32934; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v3, off offset:42935; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02936; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:52937; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02938; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:62939; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02940; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:72941; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02942; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v1, off offset:82943; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02944; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:92945; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02946; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:102947; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02948; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:112949; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x02950; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off glc dlc2951; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2952; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:1 glc dlc2953; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2954; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:2 glc dlc2955; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2956; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:3 glc dlc2957; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2958; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:4 glc dlc2959; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2960; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:5 glc dlc2961; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2962; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:6 glc dlc2963; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2964; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:7 glc dlc2965; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2966; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:8 glc dlc2967; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2968; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:9 glc dlc2969; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2970; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:10 glc dlc2971; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2972; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v0, v0, off offset:11 glc dlc2973; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)2974; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]2975;2976; UNALIGNED_GFX942-LABEL: store_load_v3i32_unaligned:2977; UNALIGNED_GFX942:       ; %bb.0: ; %bb2978; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)2979; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 12980; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off sc0 sc12981; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2982; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 02983; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 22984; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:1 sc0 sc12985; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2986; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:2 sc0 sc12987; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2988; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:3 sc0 sc12989; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2990; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v2, off offset:4 sc0 sc12991; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2992; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:5 sc0 sc12993; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2994; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:6 sc0 sc12995; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2996; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:7 sc0 sc12997; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)2998; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 32999; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v2, off offset:8 sc0 sc13000; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3001; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:9 sc0 sc13002; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3003; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:10 sc0 sc13004; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3005; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:11 sc0 sc13006; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3007; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off sc0 sc13008; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3009; UNALIGNED_GFX942-NEXT:    ; kill: killed $vgpr03010; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:1 sc0 sc13011; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3012; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:2 sc0 sc13013; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3014; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:3 sc0 sc13015; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3016; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:4 sc0 sc13017; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3018; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:5 sc0 sc13019; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3020; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:6 sc0 sc13021; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3022; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:7 sc0 sc13023; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3024; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:8 sc0 sc13025; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3026; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:9 sc0 sc13027; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3028; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:10 sc0 sc13029; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3030; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:11 sc0 sc13031; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3032; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]3033;3034; UNALIGNED_GFX11-LABEL: store_load_v3i32_unaligned:3035; UNALIGNED_GFX11:       ; %bb.0: ; %bb3036; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3037; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v1, 1 :: v_dual_mov_b32 v2, 03038; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v3, 23039; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v1, off dlc3040; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03041; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:1 dlc3042; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03043; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:2 dlc3044; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03045; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:3 dlc3046; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03047; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v1, 33048; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v3, off offset:4 dlc3049; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03050; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:5 dlc3051; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03052; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:6 dlc3053; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03054; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:7 dlc3055; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03056; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v1, off offset:8 dlc3057; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03058; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:9 dlc3059; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03060; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:10 dlc3061; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03062; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:11 dlc3063; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03064; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off glc dlc3065; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3066; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:1 glc dlc3067; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3068; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:2 glc dlc3069; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3070; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:3 glc dlc3071; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3072; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:4 glc dlc3073; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3074; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:5 glc dlc3075; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3076; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:6 glc dlc3077; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3078; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:7 glc dlc3079; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3080; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:8 glc dlc3081; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3082; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:9 glc dlc3083; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3084; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:10 glc dlc3085; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3086; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v0, v0, off offset:11 glc dlc3087; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3088; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]3089;3090; UNALIGNED_GFX12-LABEL: store_load_v3i32_unaligned:3091; UNALIGNED_GFX12:       ; %bb.0: ; %bb3092; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x03093; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x03094; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x03095; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x03096; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x03097; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v1, 1 :: v_dual_mov_b32 v2, 03098; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v3, 23099; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03100; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v1, off scope:SCOPE_SYS3101; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03102; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:1 scope:SCOPE_SYS3103; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03104; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:2 scope:SCOPE_SYS3105; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03106; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:3 scope:SCOPE_SYS3107; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03108; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v1, 33109; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v3, off offset:4 scope:SCOPE_SYS3110; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03111; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:5 scope:SCOPE_SYS3112; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03113; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:6 scope:SCOPE_SYS3114; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03115; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:7 scope:SCOPE_SYS3116; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03117; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v1, off offset:8 scope:SCOPE_SYS3118; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03119; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:9 scope:SCOPE_SYS3120; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03121; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:10 scope:SCOPE_SYS3122; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03123; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:11 scope:SCOPE_SYS3124; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03125; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off scope:SCOPE_SYS3126; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03127; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:1 scope:SCOPE_SYS3128; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03129; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:2 scope:SCOPE_SYS3130; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03131; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:3 scope:SCOPE_SYS3132; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03133; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:4 scope:SCOPE_SYS3134; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03135; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:5 scope:SCOPE_SYS3136; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03137; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:6 scope:SCOPE_SYS3138; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03139; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:7 scope:SCOPE_SYS3140; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03141; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:8 scope:SCOPE_SYS3142; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03143; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:9 scope:SCOPE_SYS3144; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03145; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:10 scope:SCOPE_SYS3146; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03147; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v0, v0, off offset:11 scope:SCOPE_SYS3148; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03149; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]3150bb:3151  store volatile <3 x i32> <i32 1, i32 2, i32 3>, ptr addrspace(5) %arg, align 13152  %load = load volatile <3 x i32>, ptr addrspace(5) %arg, align 13153  ret void3154}3155 3156define void @store_load_v4i32_unaligned(ptr addrspace(5) nocapture %arg) {3157; GFX9-LABEL: store_load_v4i32_unaligned:3158; GFX9:       ; %bb.0: ; %bb3159; GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3160; GFX9-NEXT:    s_mov_b32 s3, 43161; GFX9-NEXT:    s_mov_b32 s2, 33162; GFX9-NEXT:    s_mov_b32 s1, 23163; GFX9-NEXT:    s_mov_b32 s0, 13164; GFX9-NEXT:    v_mov_b32_e32 v4, s33165; GFX9-NEXT:    v_mov_b32_e32 v3, s23166; GFX9-NEXT:    v_mov_b32_e32 v2, s13167; GFX9-NEXT:    v_mov_b32_e32 v1, s03168; GFX9-NEXT:    scratch_store_dwordx4 v0, v[1:4], off3169; GFX9-NEXT:    s_waitcnt vmcnt(0)3170; GFX9-NEXT:    scratch_load_dwordx4 v[0:3], v0, off glc3171; GFX9-NEXT:    s_waitcnt vmcnt(0)3172; GFX9-NEXT:    s_setpc_b64 s[30:31]3173;3174; GFX10-LABEL: store_load_v4i32_unaligned:3175; GFX10:       ; %bb.0: ; %bb3176; GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3177; GFX10-NEXT:    s_mov_b32 s3, 43178; GFX10-NEXT:    s_mov_b32 s2, 33179; GFX10-NEXT:    s_mov_b32 s1, 23180; GFX10-NEXT:    s_mov_b32 s0, 13181; GFX10-NEXT:    v_mov_b32_e32 v4, s33182; GFX10-NEXT:    v_mov_b32_e32 v3, s23183; GFX10-NEXT:    v_mov_b32_e32 v2, s13184; GFX10-NEXT:    v_mov_b32_e32 v1, s03185; GFX10-NEXT:    scratch_store_dwordx4 v0, v[1:4], off3186; GFX10-NEXT:    s_waitcnt_vscnt null, 0x03187; GFX10-NEXT:    scratch_load_dwordx4 v[0:3], v0, off glc dlc3188; GFX10-NEXT:    s_waitcnt vmcnt(0)3189; GFX10-NEXT:    s_setpc_b64 s[30:31]3190;3191; GFX942-LABEL: store_load_v4i32_unaligned:3192; GFX942:       ; %bb.0: ; %bb3193; GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3194; GFX942-NEXT:    s_mov_b32 s3, 43195; GFX942-NEXT:    s_mov_b32 s2, 33196; GFX942-NEXT:    s_mov_b32 s1, 23197; GFX942-NEXT:    s_mov_b32 s0, 13198; GFX942-NEXT:    v_mov_b64_e32 v[4:5], s[2:3]3199; GFX942-NEXT:    v_mov_b64_e32 v[2:3], s[0:1]3200; GFX942-NEXT:    scratch_store_dwordx4 v0, v[2:5], off sc0 sc13201; GFX942-NEXT:    s_waitcnt vmcnt(0)3202; GFX942-NEXT:    scratch_load_dwordx4 v[0:3], v0, off sc0 sc13203; GFX942-NEXT:    s_waitcnt vmcnt(0)3204; GFX942-NEXT:    s_setpc_b64 s[30:31]3205;3206; GFX11-LABEL: store_load_v4i32_unaligned:3207; GFX11:       ; %bb.0: ; %bb3208; GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3209; GFX11-NEXT:    s_mov_b32 s3, 43210; GFX11-NEXT:    s_mov_b32 s2, 33211; GFX11-NEXT:    s_mov_b32 s1, 23212; GFX11-NEXT:    s_mov_b32 s0, 13213; GFX11-NEXT:    v_dual_mov_b32 v4, s3 :: v_dual_mov_b32 v3, s23214; GFX11-NEXT:    v_dual_mov_b32 v2, s1 :: v_dual_mov_b32 v1, s03215; GFX11-NEXT:    scratch_store_b128 v0, v[1:4], off dlc3216; GFX11-NEXT:    s_waitcnt_vscnt null, 0x03217; GFX11-NEXT:    scratch_load_b128 v[0:3], v0, off glc dlc3218; GFX11-NEXT:    s_waitcnt vmcnt(0)3219; GFX11-NEXT:    s_setpc_b64 s[30:31]3220;3221; GFX12-LABEL: store_load_v4i32_unaligned:3222; GFX12:       ; %bb.0: ; %bb3223; GFX12-NEXT:    s_wait_loadcnt_dscnt 0x03224; GFX12-NEXT:    s_wait_expcnt 0x03225; GFX12-NEXT:    s_wait_samplecnt 0x03226; GFX12-NEXT:    s_wait_bvhcnt 0x03227; GFX12-NEXT:    s_wait_kmcnt 0x03228; GFX12-NEXT:    s_mov_b32 s3, 43229; GFX12-NEXT:    s_mov_b32 s2, 33230; GFX12-NEXT:    s_mov_b32 s1, 23231; GFX12-NEXT:    s_mov_b32 s0, 13232; GFX12-NEXT:    s_wait_alu depctr_sa_sdst(0)3233; GFX12-NEXT:    v_dual_mov_b32 v4, s3 :: v_dual_mov_b32 v3, s23234; GFX12-NEXT:    v_dual_mov_b32 v2, s1 :: v_dual_mov_b32 v1, s03235; GFX12-NEXT:    s_wait_storecnt 0x03236; GFX12-NEXT:    scratch_store_b128 v0, v[1:4], off scope:SCOPE_SYS3237; GFX12-NEXT:    s_wait_storecnt 0x03238; GFX12-NEXT:    scratch_load_b128 v[0:3], v0, off scope:SCOPE_SYS3239; GFX12-NEXT:    s_wait_loadcnt 0x03240; GFX12-NEXT:    s_setpc_b64 s[30:31]3241;3242; UNALIGNED_GFX9-LABEL: store_load_v4i32_unaligned:3243; UNALIGNED_GFX9:       ; %bb.0: ; %bb3244; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3245; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 13246; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off3247; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3248; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 03249; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 23250; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:13251; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3252; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:23253; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3254; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:33255; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3256; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v2, off offset:43257; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3258; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:53259; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3260; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:63261; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3262; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:73263; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3264; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 33265; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v2, off offset:83266; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3267; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:93268; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3269; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:103270; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3271; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:113272; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3273; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v2, 43274; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v2, off offset:123275; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3276; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:133277; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3278; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:143279; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3280; UNALIGNED_GFX9-NEXT:    scratch_store_byte v0, v1, off offset:153281; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3282; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off glc3283; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3284; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:1 glc3285; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3286; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:2 glc3287; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3288; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:3 glc3289; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3290; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:4 glc3291; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3292; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:5 glc3293; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3294; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:6 glc3295; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3296; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:7 glc3297; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3298; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:8 glc3299; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3300; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:9 glc3301; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3302; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:10 glc3303; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3304; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:11 glc3305; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3306; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:12 glc3307; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3308; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:13 glc3309; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3310; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v1, v0, off offset:14 glc3311; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3312; UNALIGNED_GFX9-NEXT:    scratch_load_ubyte v0, v0, off offset:15 glc3313; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3314; UNALIGNED_GFX9-NEXT:    s_setpc_b64 s[30:31]3315;3316; UNALIGNED_GFX10-LABEL: store_load_v4i32_unaligned:3317; UNALIGNED_GFX10:       ; %bb.0: ; %bb3318; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3319; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 13320; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v2, 03321; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v3, 23322; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v1, off3323; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03324; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:13325; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03326; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:23327; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03328; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:33329; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03330; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v3, off offset:43331; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03332; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 33333; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v3, 43334; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:53335; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03336; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:63337; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03338; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:73339; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03340; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v1, off offset:83341; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03342; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:93343; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03344; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:103345; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03346; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:113347; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03348; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v3, off offset:123349; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03350; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:133351; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03352; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:143353; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03354; UNALIGNED_GFX10-NEXT:    scratch_store_byte v0, v2, off offset:153355; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03356; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off glc dlc3357; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3358; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:1 glc dlc3359; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3360; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:2 glc dlc3361; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3362; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:3 glc dlc3363; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3364; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:4 glc dlc3365; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3366; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:5 glc dlc3367; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3368; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:6 glc dlc3369; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3370; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:7 glc dlc3371; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3372; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:8 glc dlc3373; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3374; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:9 glc dlc3375; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3376; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:10 glc dlc3377; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3378; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:11 glc dlc3379; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3380; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:12 glc dlc3381; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3382; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:13 glc dlc3383; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3384; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v1, v0, off offset:14 glc dlc3385; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3386; UNALIGNED_GFX10-NEXT:    scratch_load_ubyte v0, v0, off offset:15 glc dlc3387; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3388; UNALIGNED_GFX10-NEXT:    s_setpc_b64 s[30:31]3389;3390; UNALIGNED_GFX942-LABEL: store_load_v4i32_unaligned:3391; UNALIGNED_GFX942:       ; %bb.0: ; %bb3392; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3393; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 13394; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off sc0 sc13395; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3396; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 03397; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 23398; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:1 sc0 sc13399; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3400; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:2 sc0 sc13401; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3402; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:3 sc0 sc13403; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3404; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v2, off offset:4 sc0 sc13405; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3406; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:5 sc0 sc13407; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3408; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:6 sc0 sc13409; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3410; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:7 sc0 sc13411; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3412; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 33413; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v2, off offset:8 sc0 sc13414; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3415; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:9 sc0 sc13416; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3417; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:10 sc0 sc13418; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3419; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:11 sc0 sc13420; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3421; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v2, 43422; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v2, off offset:12 sc0 sc13423; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3424; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:13 sc0 sc13425; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3426; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:14 sc0 sc13427; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3428; UNALIGNED_GFX942-NEXT:    scratch_store_byte v0, v1, off offset:15 sc0 sc13429; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3430; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off sc0 sc13431; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3432; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:1 sc0 sc13433; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3434; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:2 sc0 sc13435; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3436; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:3 sc0 sc13437; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3438; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:4 sc0 sc13439; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3440; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:5 sc0 sc13441; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3442; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:6 sc0 sc13443; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3444; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:7 sc0 sc13445; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3446; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:8 sc0 sc13447; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3448; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:9 sc0 sc13449; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3450; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:10 sc0 sc13451; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3452; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:11 sc0 sc13453; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3454; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:12 sc0 sc13455; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3456; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:13 sc0 sc13457; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3458; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v1, v0, off offset:14 sc0 sc13459; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3460; UNALIGNED_GFX942-NEXT:    scratch_load_ubyte v0, v0, off offset:15 sc0 sc13461; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3462; UNALIGNED_GFX942-NEXT:    s_setpc_b64 s[30:31]3463;3464; UNALIGNED_GFX11-LABEL: store_load_v4i32_unaligned:3465; UNALIGNED_GFX11:       ; %bb.0: ; %bb3466; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)3467; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v1, 1 :: v_dual_mov_b32 v2, 03468; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v3, 23469; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v1, off dlc3470; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03471; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:1 dlc3472; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03473; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:2 dlc3474; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03475; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:3 dlc3476; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03477; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v3, off offset:4 dlc3478; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03479; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v1, 33480; UNALIGNED_GFX11-NEXT:    v_mov_b32_e32 v3, 43481; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:5 dlc3482; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03483; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:6 dlc3484; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03485; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:7 dlc3486; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03487; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v1, off offset:8 dlc3488; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03489; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:9 dlc3490; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03491; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:10 dlc3492; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03493; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:11 dlc3494; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03495; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v3, off offset:12 dlc3496; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03497; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:13 dlc3498; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03499; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:14 dlc3500; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03501; UNALIGNED_GFX11-NEXT:    scratch_store_b8 v0, v2, off offset:15 dlc3502; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03503; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off glc dlc3504; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3505; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:1 glc dlc3506; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3507; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:2 glc dlc3508; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3509; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:3 glc dlc3510; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3511; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:4 glc dlc3512; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3513; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:5 glc dlc3514; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3515; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:6 glc dlc3516; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3517; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:7 glc dlc3518; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3519; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:8 glc dlc3520; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3521; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:9 glc dlc3522; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3523; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:10 glc dlc3524; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3525; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:11 glc dlc3526; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3527; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:12 glc dlc3528; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3529; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:13 glc dlc3530; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3531; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v1, v0, off offset:14 glc dlc3532; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3533; UNALIGNED_GFX11-NEXT:    scratch_load_u8 v0, v0, off offset:15 glc dlc3534; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3535; UNALIGNED_GFX11-NEXT:    s_setpc_b64 s[30:31]3536;3537; UNALIGNED_GFX12-LABEL: store_load_v4i32_unaligned:3538; UNALIGNED_GFX12:       ; %bb.0: ; %bb3539; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt_dscnt 0x03540; UNALIGNED_GFX12-NEXT:    s_wait_expcnt 0x03541; UNALIGNED_GFX12-NEXT:    s_wait_samplecnt 0x03542; UNALIGNED_GFX12-NEXT:    s_wait_bvhcnt 0x03543; UNALIGNED_GFX12-NEXT:    s_wait_kmcnt 0x03544; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v1, 1 :: v_dual_mov_b32 v2, 03545; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v3, 23546; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03547; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v1, off scope:SCOPE_SYS3548; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03549; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:1 scope:SCOPE_SYS3550; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03551; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:2 scope:SCOPE_SYS3552; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03553; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:3 scope:SCOPE_SYS3554; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03555; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v3, off offset:4 scope:SCOPE_SYS3556; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03557; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v1, 33558; UNALIGNED_GFX12-NEXT:    v_mov_b32_e32 v3, 43559; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:5 scope:SCOPE_SYS3560; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03561; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:6 scope:SCOPE_SYS3562; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03563; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:7 scope:SCOPE_SYS3564; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03565; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v1, off offset:8 scope:SCOPE_SYS3566; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03567; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:9 scope:SCOPE_SYS3568; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03569; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:10 scope:SCOPE_SYS3570; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03571; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:11 scope:SCOPE_SYS3572; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03573; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v3, off offset:12 scope:SCOPE_SYS3574; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03575; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:13 scope:SCOPE_SYS3576; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03577; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:14 scope:SCOPE_SYS3578; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03579; UNALIGNED_GFX12-NEXT:    scratch_store_b8 v0, v2, off offset:15 scope:SCOPE_SYS3580; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03581; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off scope:SCOPE_SYS3582; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03583; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:1 scope:SCOPE_SYS3584; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03585; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:2 scope:SCOPE_SYS3586; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03587; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:3 scope:SCOPE_SYS3588; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03589; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:4 scope:SCOPE_SYS3590; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03591; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:5 scope:SCOPE_SYS3592; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03593; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:6 scope:SCOPE_SYS3594; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03595; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:7 scope:SCOPE_SYS3596; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03597; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:8 scope:SCOPE_SYS3598; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03599; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:9 scope:SCOPE_SYS3600; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03601; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:10 scope:SCOPE_SYS3602; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03603; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:11 scope:SCOPE_SYS3604; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03605; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:12 scope:SCOPE_SYS3606; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03607; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:13 scope:SCOPE_SYS3608; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03609; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v1, v0, off offset:14 scope:SCOPE_SYS3610; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03611; UNALIGNED_GFX12-NEXT:    scratch_load_u8 v0, v0, off offset:15 scope:SCOPE_SYS3612; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03613; UNALIGNED_GFX12-NEXT:    s_setpc_b64 s[30:31]3614bb:3615  store volatile <4 x i32> <i32 1, i32 2, i32 3, i32 4>, ptr addrspace(5) %arg, align 13616  %load = load volatile <4 x i32>, ptr addrspace(5) %arg, align 13617  ret void3618}3619 3620define amdgpu_gs void @sgpr_base_large_offset(ptr addrspace(1) %out, ptr addrspace(5) inreg %sgpr_base) {3621; GFX9-LABEL: sgpr_base_large_offset:3622; GFX9:       ; %bb.0: ; %entry3623; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s53624; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 03625; GFX9-NEXT:    s_add_u32 s0, s2, 0xffe83626; GFX9-NEXT:    scratch_load_dword v2, off, s03627; GFX9-NEXT:    s_waitcnt vmcnt(0)3628; GFX9-NEXT:    global_store_dword v[0:1], v2, off3629; GFX9-NEXT:    s_endpgm3630;3631; GFX10-LABEL: sgpr_base_large_offset:3632; GFX10:       ; %bb.0: ; %entry3633; GFX10-NEXT:    s_add_u32 s0, s0, s53634; GFX10-NEXT:    s_addc_u32 s1, s1, 03635; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s03636; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s13637; GFX10-NEXT:    s_add_u32 s0, s2, 0xffe83638; GFX10-NEXT:    scratch_load_dword v2, off, s03639; GFX10-NEXT:    s_waitcnt vmcnt(0)3640; GFX10-NEXT:    global_store_dword v[0:1], v2, off3641; GFX10-NEXT:    s_endpgm3642;3643; GFX942-LABEL: sgpr_base_large_offset:3644; GFX942:       ; %bb.0: ; %entry3645; GFX942-NEXT:    s_add_u32 s0, s0, 0xffe83646; GFX942-NEXT:    scratch_load_dword v2, off, s03647; GFX942-NEXT:    s_waitcnt vmcnt(0)3648; GFX942-NEXT:    global_store_dword v[0:1], v2, off3649; GFX942-NEXT:    s_endpgm3650;3651; GFX11-LABEL: sgpr_base_large_offset:3652; GFX11:       ; %bb.0: ; %entry3653; GFX11-NEXT:    s_add_u32 s0, s0, 0xffe83654; GFX11-NEXT:    scratch_load_b32 v2, off, s03655; GFX11-NEXT:    s_waitcnt vmcnt(0)3656; GFX11-NEXT:    global_store_b32 v[0:1], v2, off3657; GFX11-NEXT:    s_endpgm3658;3659; GFX12-LABEL: sgpr_base_large_offset:3660; GFX12:       ; %bb.0: ; %entry3661; GFX12-NEXT:    scratch_load_b32 v2, off, s0 offset:655123662; GFX12-NEXT:    s_wait_loadcnt 0x03663; GFX12-NEXT:    global_store_b32 v[0:1], v2, off3664; GFX12-NEXT:    s_endpgm3665;3666; UNALIGNED_GFX9-LABEL: sgpr_base_large_offset:3667; UNALIGNED_GFX9:       ; %bb.0: ; %entry3668; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s53669; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 03670; UNALIGNED_GFX9-NEXT:    s_add_u32 s0, s2, 0xffe83671; UNALIGNED_GFX9-NEXT:    scratch_load_dword v2, off, s03672; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3673; UNALIGNED_GFX9-NEXT:    global_store_dword v[0:1], v2, off3674; UNALIGNED_GFX9-NEXT:    s_endpgm3675;3676; UNALIGNED_GFX10-LABEL: sgpr_base_large_offset:3677; UNALIGNED_GFX10:       ; %bb.0: ; %entry3678; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, s0, s53679; UNALIGNED_GFX10-NEXT:    s_addc_u32 s1, s1, 03680; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s03681; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s13682; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, s2, 0xffe83683; UNALIGNED_GFX10-NEXT:    scratch_load_dword v2, off, s03684; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3685; UNALIGNED_GFX10-NEXT:    global_store_dword v[0:1], v2, off3686; UNALIGNED_GFX10-NEXT:    s_endpgm3687;3688; UNALIGNED_GFX942-LABEL: sgpr_base_large_offset:3689; UNALIGNED_GFX942:       ; %bb.0: ; %entry3690; UNALIGNED_GFX942-NEXT:    s_add_u32 s0, s0, 0xffe83691; UNALIGNED_GFX942-NEXT:    scratch_load_dword v2, off, s03692; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3693; UNALIGNED_GFX942-NEXT:    global_store_dword v[0:1], v2, off3694; UNALIGNED_GFX942-NEXT:    s_endpgm3695;3696; UNALIGNED_GFX11-LABEL: sgpr_base_large_offset:3697; UNALIGNED_GFX11:       ; %bb.0: ; %entry3698; UNALIGNED_GFX11-NEXT:    s_add_u32 s0, s0, 0xffe83699; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v2, off, s03700; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3701; UNALIGNED_GFX11-NEXT:    global_store_b32 v[0:1], v2, off3702; UNALIGNED_GFX11-NEXT:    s_endpgm3703;3704; UNALIGNED_GFX12-LABEL: sgpr_base_large_offset:3705; UNALIGNED_GFX12:       ; %bb.0: ; %entry3706; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v2, off, s0 offset:655123707; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03708; UNALIGNED_GFX12-NEXT:    global_store_b32 v[0:1], v2, off3709; UNALIGNED_GFX12-NEXT:    s_endpgm3710entry:3711  %large_offset = getelementptr i8, ptr addrspace(5) %sgpr_base, i32 655123712  %load = load i32, ptr addrspace(5) %large_offset, align 43713  store i32 %load, ptr addrspace(1) %out3714  ret void3715}3716 3717define amdgpu_gs void @sgpr_base_large_offset_split(ptr addrspace(1) %out, ptr addrspace(5) inreg %sgpr_base) {3718; GFX9-LABEL: sgpr_base_large_offset_split:3719; GFX9:       ; %bb.0: ; %entry3720; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s53721; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 03722; GFX9-NEXT:    s_and_b32 s0, s2, -43723; GFX9-NEXT:    s_add_u32 s0, s0, 0x100ffe83724; GFX9-NEXT:    scratch_load_dword v2, off, s0 glc3725; GFX9-NEXT:    s_waitcnt vmcnt(0)3726; GFX9-NEXT:    global_store_dword v[0:1], v2, off3727; GFX9-NEXT:    s_endpgm3728;3729; GFX10-LABEL: sgpr_base_large_offset_split:3730; GFX10:       ; %bb.0: ; %entry3731; GFX10-NEXT:    s_add_u32 s0, s0, s53732; GFX10-NEXT:    s_addc_u32 s1, s1, 03733; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s03734; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s13735; GFX10-NEXT:    s_and_b32 s0, s2, -43736; GFX10-NEXT:    s_add_u32 s0, s0, 0x100ffe83737; GFX10-NEXT:    scratch_load_dword v2, off, s0 glc dlc3738; GFX10-NEXT:    s_waitcnt vmcnt(0)3739; GFX10-NEXT:    global_store_dword v[0:1], v2, off3740; GFX10-NEXT:    s_endpgm3741;3742; GFX942-LABEL: sgpr_base_large_offset_split:3743; GFX942:       ; %bb.0: ; %entry3744; GFX942-NEXT:    s_and_b32 s0, s0, -43745; GFX942-NEXT:    s_add_u32 s0, s0, 0x100ffe83746; GFX942-NEXT:    scratch_load_dword v2, off, s0 sc0 sc13747; GFX942-NEXT:    s_waitcnt vmcnt(0)3748; GFX942-NEXT:    global_store_dword v[0:1], v2, off3749; GFX942-NEXT:    s_endpgm3750;3751; GFX11-LABEL: sgpr_base_large_offset_split:3752; GFX11:       ; %bb.0: ; %entry3753; GFX11-NEXT:    s_and_b32 s0, s0, -43754; GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)3755; GFX11-NEXT:    s_add_u32 s0, s0, 0x100ffe83756; GFX11-NEXT:    scratch_load_b32 v2, off, s0 glc dlc3757; GFX11-NEXT:    s_waitcnt vmcnt(0)3758; GFX11-NEXT:    global_store_b32 v[0:1], v2, off3759; GFX11-NEXT:    s_endpgm3760;3761; GFX12-LABEL: sgpr_base_large_offset_split:3762; GFX12:       ; %bb.0: ; %entry3763; GFX12-NEXT:    s_and_b32 s0, s0, -43764; GFX12-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)3765; GFX12-NEXT:    s_add_co_u32 s0, s0, 0x100ffe83766; GFX12-NEXT:    scratch_load_b32 v2, off, s0 scope:SCOPE_SYS3767; GFX12-NEXT:    s_wait_loadcnt 0x03768; GFX12-NEXT:    global_store_b32 v[0:1], v2, off3769; GFX12-NEXT:    s_endpgm3770;3771; UNALIGNED_GFX9-LABEL: sgpr_base_large_offset_split:3772; UNALIGNED_GFX9:       ; %bb.0: ; %entry3773; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s53774; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 03775; UNALIGNED_GFX9-NEXT:    s_and_b32 s0, s2, -43776; UNALIGNED_GFX9-NEXT:    s_add_u32 s0, s0, 0x100ffe83777; UNALIGNED_GFX9-NEXT:    scratch_load_dword v2, off, s0 glc3778; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3779; UNALIGNED_GFX9-NEXT:    global_store_dword v[0:1], v2, off3780; UNALIGNED_GFX9-NEXT:    s_endpgm3781;3782; UNALIGNED_GFX10-LABEL: sgpr_base_large_offset_split:3783; UNALIGNED_GFX10:       ; %bb.0: ; %entry3784; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, s0, s53785; UNALIGNED_GFX10-NEXT:    s_addc_u32 s1, s1, 03786; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s03787; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s13788; UNALIGNED_GFX10-NEXT:    s_and_b32 s0, s2, -43789; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, s0, 0x100ffe83790; UNALIGNED_GFX10-NEXT:    scratch_load_dword v2, off, s0 glc dlc3791; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)3792; UNALIGNED_GFX10-NEXT:    global_store_dword v[0:1], v2, off3793; UNALIGNED_GFX10-NEXT:    s_endpgm3794;3795; UNALIGNED_GFX942-LABEL: sgpr_base_large_offset_split:3796; UNALIGNED_GFX942:       ; %bb.0: ; %entry3797; UNALIGNED_GFX942-NEXT:    s_and_b32 s0, s0, -43798; UNALIGNED_GFX942-NEXT:    s_add_u32 s0, s0, 0x100ffe83799; UNALIGNED_GFX942-NEXT:    scratch_load_dword v2, off, s0 sc0 sc13800; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3801; UNALIGNED_GFX942-NEXT:    global_store_dword v[0:1], v2, off3802; UNALIGNED_GFX942-NEXT:    s_endpgm3803;3804; UNALIGNED_GFX11-LABEL: sgpr_base_large_offset_split:3805; UNALIGNED_GFX11:       ; %bb.0: ; %entry3806; UNALIGNED_GFX11-NEXT:    s_and_b32 s0, s0, -43807; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)3808; UNALIGNED_GFX11-NEXT:    s_add_u32 s0, s0, 0x100ffe83809; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v2, off, s0 glc dlc3810; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)3811; UNALIGNED_GFX11-NEXT:    global_store_b32 v[0:1], v2, off3812; UNALIGNED_GFX11-NEXT:    s_endpgm3813;3814; UNALIGNED_GFX12-LABEL: sgpr_base_large_offset_split:3815; UNALIGNED_GFX12:       ; %bb.0: ; %entry3816; UNALIGNED_GFX12-NEXT:    s_and_b32 s0, s0, -43817; UNALIGNED_GFX12-NEXT:    s_delay_alu instid0(SALU_CYCLE_1)3818; UNALIGNED_GFX12-NEXT:    s_add_co_u32 s0, s0, 0x100ffe83819; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v2, off, s0 scope:SCOPE_SYS3820; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x03821; UNALIGNED_GFX12-NEXT:    global_store_b32 v[0:1], v2, off3822; UNALIGNED_GFX12-NEXT:    s_endpgm3823entry:3824  ;%allignedBase = alloca [33554432 x i8], align 4, addrspace(5)3825  %sgpr_base_i32 = ptrtoint ptr addrspace(5) %sgpr_base to i323826  %sgpr_base_i32_align4 = and i32 %sgpr_base_i32, 42949672923827  %sgpr_base_align4 = inttoptr i32 %sgpr_base_i32_align4 to ptr addrspace(5)3828  %split_offset = getelementptr inbounds [33554432 x i8], ptr addrspace(5) %sgpr_base_align4, i32 0, i32 168427283829  %load = load volatile i32, ptr addrspace(5) %split_offset, align 43830  store i32 %load, ptr addrspace(1) %out3831  ret void3832}3833 3834define amdgpu_gs void @sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset(ptr addrspace(5) inreg %sgpr_base, i32 inreg %sidx, i32 %vidx) {3835; GFX9-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3836; GFX9:       ; %bb.0: ; %bb3837; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s53838; GFX9-NEXT:    v_add_u32_e32 v0, s3, v03839; GFX9-NEXT:    v_mov_b32_e32 v1, 0xffe83840; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 03841; GFX9-NEXT:    v_add3_u32 v0, s2, v0, v13842; GFX9-NEXT:    v_mov_b32_e32 v1, 153843; GFX9-NEXT:    scratch_store_dword v0, v1, off3844; GFX9-NEXT:    s_waitcnt vmcnt(0)3845; GFX9-NEXT:    s_endpgm3846;3847; GFX10-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3848; GFX10:       ; %bb.0: ; %bb3849; GFX10-NEXT:    s_add_u32 s0, s0, s53850; GFX10-NEXT:    s_addc_u32 s1, s1, 03851; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s03852; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s13853; GFX10-NEXT:    v_add_nc_u32_e32 v0, s3, v03854; GFX10-NEXT:    v_mov_b32_e32 v1, 153855; GFX10-NEXT:    v_add3_u32 v0, s2, v0, 0xffe83856; GFX10-NEXT:    scratch_store_dword v0, v1, off3857; GFX10-NEXT:    s_waitcnt_vscnt null, 0x03858; GFX10-NEXT:    s_endpgm3859;3860; GFX942-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3861; GFX942:       ; %bb.0: ; %bb3862; GFX942-NEXT:    v_add_u32_e32 v0, s1, v03863; GFX942-NEXT:    v_mov_b32_e32 v1, 0xffe83864; GFX942-NEXT:    v_add3_u32 v0, s0, v0, v13865; GFX942-NEXT:    v_mov_b32_e32 v1, 153866; GFX942-NEXT:    scratch_store_dword v0, v1, off sc0 sc13867; GFX942-NEXT:    s_waitcnt vmcnt(0)3868; GFX942-NEXT:    s_endpgm3869;3870; GFX11-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3871; GFX11:       ; %bb.0: ; %bb3872; GFX11-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_add_nc_u32 v0, s1, v03873; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)3874; GFX11-NEXT:    v_add3_u32 v0, s0, v0, 0xffe83875; GFX11-NEXT:    scratch_store_b32 v0, v1, off dlc3876; GFX11-NEXT:    s_waitcnt_vscnt null, 0x03877; GFX11-NEXT:    s_endpgm3878;3879; GFX12-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3880; GFX12:       ; %bb.0: ; %bb3881; GFX12-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_add_nc_u32 v0, s1, v03882; GFX12-NEXT:    scratch_store_b32 v0, v1, s0 offset:65512 scope:SCOPE_SYS3883; GFX12-NEXT:    s_wait_storecnt 0x03884; GFX12-NEXT:    s_endpgm3885;3886; UNALIGNED_GFX9-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3887; UNALIGNED_GFX9:       ; %bb.0: ; %bb3888; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s53889; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, s3, v03890; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 0xffe83891; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 03892; UNALIGNED_GFX9-NEXT:    v_add3_u32 v0, s2, v0, v13893; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 153894; UNALIGNED_GFX9-NEXT:    scratch_store_dword v0, v1, off3895; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)3896; UNALIGNED_GFX9-NEXT:    s_endpgm3897;3898; UNALIGNED_GFX10-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3899; UNALIGNED_GFX10:       ; %bb.0: ; %bb3900; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, s0, s53901; UNALIGNED_GFX10-NEXT:    s_addc_u32 s1, s1, 03902; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s03903; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s13904; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, s3, v03905; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 153906; UNALIGNED_GFX10-NEXT:    v_add3_u32 v0, s2, v0, 0xffe83907; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v1, off3908; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x03909; UNALIGNED_GFX10-NEXT:    s_endpgm3910;3911; UNALIGNED_GFX942-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3912; UNALIGNED_GFX942:       ; %bb.0: ; %bb3913; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v0, s1, v03914; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 0xffe83915; UNALIGNED_GFX942-NEXT:    v_add3_u32 v0, s0, v0, v13916; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 153917; UNALIGNED_GFX942-NEXT:    scratch_store_dword v0, v1, off sc0 sc13918; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)3919; UNALIGNED_GFX942-NEXT:    s_endpgm3920;3921; UNALIGNED_GFX11-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3922; UNALIGNED_GFX11:       ; %bb.0: ; %bb3923; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_add_nc_u32 v0, s1, v03924; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)3925; UNALIGNED_GFX11-NEXT:    v_add3_u32 v0, s0, v0, 0xffe83926; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v0, v1, off dlc3927; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x03928; UNALIGNED_GFX11-NEXT:    s_endpgm3929;3930; UNALIGNED_GFX12-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_large_imm_offset:3931; UNALIGNED_GFX12:       ; %bb.0: ; %bb3932; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_add_nc_u32 v0, s1, v03933; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v1, s0 offset:65512 scope:SCOPE_SYS3934; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x03935; UNALIGNED_GFX12-NEXT:    s_endpgm3936bb:3937  %add1 = add nsw i32 %sidx, %vidx3938  %add2 = add nsw i32 %add1, 655123939  %gep = getelementptr inbounds [33554432 x i8], ptr addrspace(5) %sgpr_base, i32 0, i32 %add23940  store volatile i32 15, ptr addrspace(5) %gep, align 43941  ret void3942}3943 3944define amdgpu_gs void @sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset(ptr addrspace(5) inreg %sgpr_base, i32 inreg %sidx, i32 %vidx) {3945; GFX9-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:3946; GFX9:       ; %bb.0: ; %bb3947; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s53948; GFX9-NEXT:    v_add_u32_e32 v0, s3, v03949; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 03950; GFX9-NEXT:    v_add3_u32 v0, s2, v0, -163951; GFX9-NEXT:    v_mov_b32_e32 v1, 153952; GFX9-NEXT:    scratch_store_dword v0, v1, off3953; GFX9-NEXT:    s_waitcnt vmcnt(0)3954; GFX9-NEXT:    s_endpgm3955;3956; GFX10-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:3957; GFX10:       ; %bb.0: ; %bb3958; GFX10-NEXT:    s_add_u32 s0, s0, s53959; GFX10-NEXT:    s_addc_u32 s1, s1, 03960; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s03961; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s13962; GFX10-NEXT:    v_add_nc_u32_e32 v0, s3, v03963; GFX10-NEXT:    v_mov_b32_e32 v1, 153964; GFX10-NEXT:    v_add_nc_u32_e32 v0, s2, v03965; GFX10-NEXT:    scratch_store_dword v0, v1, off offset:-163966; GFX10-NEXT:    s_waitcnt_vscnt null, 0x03967; GFX10-NEXT:    s_endpgm3968;3969; GFX942-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:3970; GFX942:       ; %bb.0: ; %bb3971; GFX942-NEXT:    v_add_u32_e32 v0, s1, v03972; GFX942-NEXT:    v_add3_u32 v0, s0, v0, -163973; GFX942-NEXT:    v_mov_b32_e32 v1, 153974; GFX942-NEXT:    scratch_store_dword v0, v1, off sc0 sc13975; GFX942-NEXT:    s_waitcnt vmcnt(0)3976; GFX942-NEXT:    s_endpgm3977;3978; GFX11-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:3979; GFX11:       ; %bb.0: ; %bb3980; GFX11-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_add_nc_u32 v0, s1, v03981; GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)3982; GFX11-NEXT:    v_add_nc_u32_e32 v0, s0, v03983; GFX11-NEXT:    scratch_store_b32 v0, v1, off offset:-16 dlc3984; GFX11-NEXT:    s_waitcnt_vscnt null, 0x03985; GFX11-NEXT:    s_endpgm3986;3987; GFX12-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:3988; GFX12:       ; %bb.0: ; %bb3989; GFX12-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_add_nc_u32 v0, s1, v03990; GFX12-NEXT:    scratch_store_b32 v0, v1, s0 offset:-16 scope:SCOPE_SYS3991; GFX12-NEXT:    s_wait_storecnt 0x03992; GFX12-NEXT:    s_endpgm3993;3994; UNALIGNED_GFX9-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:3995; UNALIGNED_GFX9:       ; %bb.0: ; %bb3996; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s53997; UNALIGNED_GFX9-NEXT:    v_add_u32_e32 v0, s3, v03998; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 03999; UNALIGNED_GFX9-NEXT:    v_add3_u32 v0, s2, v0, -164000; UNALIGNED_GFX9-NEXT:    v_mov_b32_e32 v1, 154001; UNALIGNED_GFX9-NEXT:    scratch_store_dword v0, v1, off4002; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)4003; UNALIGNED_GFX9-NEXT:    s_endpgm4004;4005; UNALIGNED_GFX10-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:4006; UNALIGNED_GFX10:       ; %bb.0: ; %bb4007; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, s0, s54008; UNALIGNED_GFX10-NEXT:    s_addc_u32 s1, s1, 04009; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s04010; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s14011; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, s3, v04012; UNALIGNED_GFX10-NEXT:    v_mov_b32_e32 v1, 154013; UNALIGNED_GFX10-NEXT:    v_add_nc_u32_e32 v0, s2, v04014; UNALIGNED_GFX10-NEXT:    scratch_store_dword v0, v1, off offset:-164015; UNALIGNED_GFX10-NEXT:    s_waitcnt_vscnt null, 0x04016; UNALIGNED_GFX10-NEXT:    s_endpgm4017;4018; UNALIGNED_GFX942-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:4019; UNALIGNED_GFX942:       ; %bb.0: ; %bb4020; UNALIGNED_GFX942-NEXT:    v_add_u32_e32 v0, s1, v04021; UNALIGNED_GFX942-NEXT:    v_add3_u32 v0, s0, v0, -164022; UNALIGNED_GFX942-NEXT:    v_mov_b32_e32 v1, 154023; UNALIGNED_GFX942-NEXT:    scratch_store_dword v0, v1, off sc0 sc14024; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)4025; UNALIGNED_GFX942-NEXT:    s_endpgm4026;4027; UNALIGNED_GFX11-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:4028; UNALIGNED_GFX11:       ; %bb.0: ; %bb4029; UNALIGNED_GFX11-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_add_nc_u32 v0, s1, v04030; UNALIGNED_GFX11-NEXT:    s_delay_alu instid0(VALU_DEP_1)4031; UNALIGNED_GFX11-NEXT:    v_add_nc_u32_e32 v0, s0, v04032; UNALIGNED_GFX11-NEXT:    scratch_store_b32 v0, v1, off offset:-16 dlc4033; UNALIGNED_GFX11-NEXT:    s_waitcnt_vscnt null, 0x04034; UNALIGNED_GFX11-NEXT:    s_endpgm4035;4036; UNALIGNED_GFX12-LABEL: sgpr_base_plus_sgpr_plus_vgpr_plus_negative_imm_offset:4037; UNALIGNED_GFX12:       ; %bb.0: ; %bb4038; UNALIGNED_GFX12-NEXT:    v_dual_mov_b32 v1, 15 :: v_dual_add_nc_u32 v0, s1, v04039; UNALIGNED_GFX12-NEXT:    scratch_store_b32 v0, v1, s0 offset:-16 scope:SCOPE_SYS4040; UNALIGNED_GFX12-NEXT:    s_wait_storecnt 0x04041; UNALIGNED_GFX12-NEXT:    s_endpgm4042bb:4043  %add1 = add nsw i32 %sidx, %vidx4044  %add2 = add nsw i32 %add1, -164045  %gep = getelementptr inbounds [16 x i8], ptr addrspace(5) %sgpr_base, i32 0, i32 %add24046  store volatile i32 15, ptr addrspace(5) %gep, align 44047  ret void4048}4049 4050define amdgpu_gs void @sgpr_base_negative_offset(ptr addrspace(1) %out, ptr addrspace(5) inreg %scevgep) {4051; GFX9-LABEL: sgpr_base_negative_offset:4052; GFX9:       ; %bb.0: ; %entry4053; GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s54054; GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 04055; GFX9-NEXT:    s_add_u32 s0, s2, 0xffffffe84056; GFX9-NEXT:    scratch_load_dword v2, off, s04057; GFX9-NEXT:    s_waitcnt vmcnt(0)4058; GFX9-NEXT:    global_store_dword v[0:1], v2, off4059; GFX9-NEXT:    s_endpgm4060;4061; GFX10-LABEL: sgpr_base_negative_offset:4062; GFX10:       ; %bb.0: ; %entry4063; GFX10-NEXT:    s_add_u32 s0, s0, s54064; GFX10-NEXT:    s_addc_u32 s1, s1, 04065; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s04066; GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s14067; GFX10-NEXT:    scratch_load_dword v2, off, s2 offset:-244068; GFX10-NEXT:    s_waitcnt vmcnt(0)4069; GFX10-NEXT:    global_store_dword v[0:1], v2, off4070; GFX10-NEXT:    s_endpgm4071;4072; GFX942-LABEL: sgpr_base_negative_offset:4073; GFX942:       ; %bb.0: ; %entry4074; GFX942-NEXT:    s_add_u32 s0, s0, 0xffffffe84075; GFX942-NEXT:    scratch_load_dword v2, off, s04076; GFX942-NEXT:    s_waitcnt vmcnt(0)4077; GFX942-NEXT:    global_store_dword v[0:1], v2, off4078; GFX942-NEXT:    s_endpgm4079;4080; GFX11-LABEL: sgpr_base_negative_offset:4081; GFX11:       ; %bb.0: ; %entry4082; GFX11-NEXT:    scratch_load_b32 v2, off, s0 offset:-244083; GFX11-NEXT:    s_waitcnt vmcnt(0)4084; GFX11-NEXT:    global_store_b32 v[0:1], v2, off4085; GFX11-NEXT:    s_endpgm4086;4087; GFX12-LABEL: sgpr_base_negative_offset:4088; GFX12:       ; %bb.0: ; %entry4089; GFX12-NEXT:    scratch_load_b32 v2, off, s0 offset:-244090; GFX12-NEXT:    s_wait_loadcnt 0x04091; GFX12-NEXT:    global_store_b32 v[0:1], v2, off4092; GFX12-NEXT:    s_endpgm4093;4094; UNALIGNED_GFX9-LABEL: sgpr_base_negative_offset:4095; UNALIGNED_GFX9:       ; %bb.0: ; %entry4096; UNALIGNED_GFX9-NEXT:    s_add_u32 flat_scratch_lo, s0, s54097; UNALIGNED_GFX9-NEXT:    s_addc_u32 flat_scratch_hi, s1, 04098; UNALIGNED_GFX9-NEXT:    s_add_u32 s0, s2, 0xffffffe84099; UNALIGNED_GFX9-NEXT:    scratch_load_dword v2, off, s04100; UNALIGNED_GFX9-NEXT:    s_waitcnt vmcnt(0)4101; UNALIGNED_GFX9-NEXT:    global_store_dword v[0:1], v2, off4102; UNALIGNED_GFX9-NEXT:    s_endpgm4103;4104; UNALIGNED_GFX10-LABEL: sgpr_base_negative_offset:4105; UNALIGNED_GFX10:       ; %bb.0: ; %entry4106; UNALIGNED_GFX10-NEXT:    s_add_u32 s0, s0, s54107; UNALIGNED_GFX10-NEXT:    s_addc_u32 s1, s1, 04108; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_LO), s04109; UNALIGNED_GFX10-NEXT:    s_setreg_b32 hwreg(HW_REG_FLAT_SCR_HI), s14110; UNALIGNED_GFX10-NEXT:    scratch_load_dword v2, off, s2 offset:-244111; UNALIGNED_GFX10-NEXT:    s_waitcnt vmcnt(0)4112; UNALIGNED_GFX10-NEXT:    global_store_dword v[0:1], v2, off4113; UNALIGNED_GFX10-NEXT:    s_endpgm4114;4115; UNALIGNED_GFX942-LABEL: sgpr_base_negative_offset:4116; UNALIGNED_GFX942:       ; %bb.0: ; %entry4117; UNALIGNED_GFX942-NEXT:    s_add_u32 s0, s0, 0xffffffe84118; UNALIGNED_GFX942-NEXT:    scratch_load_dword v2, off, s04119; UNALIGNED_GFX942-NEXT:    s_waitcnt vmcnt(0)4120; UNALIGNED_GFX942-NEXT:    global_store_dword v[0:1], v2, off4121; UNALIGNED_GFX942-NEXT:    s_endpgm4122;4123; UNALIGNED_GFX11-LABEL: sgpr_base_negative_offset:4124; UNALIGNED_GFX11:       ; %bb.0: ; %entry4125; UNALIGNED_GFX11-NEXT:    scratch_load_b32 v2, off, s0 offset:-244126; UNALIGNED_GFX11-NEXT:    s_waitcnt vmcnt(0)4127; UNALIGNED_GFX11-NEXT:    global_store_b32 v[0:1], v2, off4128; UNALIGNED_GFX11-NEXT:    s_endpgm4129;4130; UNALIGNED_GFX12-LABEL: sgpr_base_negative_offset:4131; UNALIGNED_GFX12:       ; %bb.0: ; %entry4132; UNALIGNED_GFX12-NEXT:    scratch_load_b32 v2, off, s0 offset:-244133; UNALIGNED_GFX12-NEXT:    s_wait_loadcnt 0x04134; UNALIGNED_GFX12-NEXT:    global_store_b32 v[0:1], v2, off4135; UNALIGNED_GFX12-NEXT:    s_endpgm4136entry:4137  %scevgep28 = getelementptr i8, ptr addrspace(5) %scevgep, i32 -244138  %0 = load i32, ptr addrspace(5) %scevgep28, align 44139  store i32 %0, ptr addrspace(1) %out4140  ret void4141}4142 4143declare i32 @llvm.amdgcn.workitem.id.x()4144