brintos

brintos / llvm-project-archived public Read only

0
0
Text · 72.9 KiB · d2394ba Raw
1679 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 < %s | FileCheck -check-prefixes=GCN,WAVE32,WAVE32-OPT %s3; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -mattr=+wavefrontsize64 < %s | FileCheck -check-prefixes=GCN,WAVE64,WAVE64-OPT %s4 5; RUN: llc -O0 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 < %s | FileCheck -check-prefixes=GCN,WAVE32,WAVE32-O0 %s6; RUN: llc -O0 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -mattr=+wavefrontsize64 < %s | FileCheck -check-prefixes=GCN,WAVE64,WAVE64-O0 %s7; RUN: llc -O0 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1030 -amdgpu-prealloc-sgpr-spill-vgprs=1 < %s | FileCheck -check-prefixes=GCN,WAVE32,WAVE32-WWM-PREALLOC %s8 9declare ptr addrspace(5) @llvm.stacksave.p5()10declare void @llvm.stackrestore.p5(ptr addrspace(5))11 12define hidden void @stack_passed_argument([32 x i32], i32) {13; GCN-LABEL: stack_passed_argument:14; GCN:       ; %bb.0:15; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)16; GCN-NEXT:    s_setpc_b64 s[30:31]17  ret void18}19 20define void @func_store_stacksave() {21; WAVE32-OPT-LABEL: func_store_stacksave:22; WAVE32-OPT:       ; %bb.0:23; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)24; WAVE32-OPT-NEXT:    s_lshr_b32 s4, s32, 525; WAVE32-OPT-NEXT:    ;;#ASMSTART26; WAVE32-OPT-NEXT:    ; use s427; WAVE32-OPT-NEXT:    ;;#ASMEND28; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]29;30; WAVE64-OPT-LABEL: func_store_stacksave:31; WAVE64-OPT:       ; %bb.0:32; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)33; WAVE64-OPT-NEXT:    s_lshr_b32 s4, s32, 634; WAVE64-OPT-NEXT:    ;;#ASMSTART35; WAVE64-OPT-NEXT:    ; use s436; WAVE64-OPT-NEXT:    ;;#ASMEND37; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]38;39; WAVE32-O0-LABEL: func_store_stacksave:40; WAVE32-O0:       ; %bb.0:41; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)42; WAVE32-O0-NEXT:    s_mov_b32 s4, s3243; WAVE32-O0-NEXT:    s_lshr_b32 s4, s4, 544; WAVE32-O0-NEXT:    ;;#ASMSTART45; WAVE32-O0-NEXT:    ; use s446; WAVE32-O0-NEXT:    ;;#ASMEND47; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]48;49; WAVE64-O0-LABEL: func_store_stacksave:50; WAVE64-O0:       ; %bb.0:51; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)52; WAVE64-O0-NEXT:    s_mov_b32 s4, s3253; WAVE64-O0-NEXT:    s_lshr_b32 s4, s4, 654; WAVE64-O0-NEXT:    ;;#ASMSTART55; WAVE64-O0-NEXT:    ; use s456; WAVE64-O0-NEXT:    ;;#ASMEND57; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]58;59; WAVE32-WWM-PREALLOC-LABEL: func_store_stacksave:60; WAVE32-WWM-PREALLOC:       ; %bb.0:61; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)62; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, s3263; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s4, s4, 564; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMSTART65; WAVE32-WWM-PREALLOC-NEXT:    ; use s466; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMEND67; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]68  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()69  call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %stacksave)70  ret void71}72 73define amdgpu_kernel void @kernel_store_stacksave() {74; WAVE32-OPT-LABEL: kernel_store_stacksave:75; WAVE32-OPT:       ; %bb.0:76; WAVE32-OPT-NEXT:    s_lshr_b32 s0, s32, 577; WAVE32-OPT-NEXT:    ;;#ASMSTART78; WAVE32-OPT-NEXT:    ; use s079; WAVE32-OPT-NEXT:    ;;#ASMEND80; WAVE32-OPT-NEXT:    s_endpgm81;82; WAVE64-OPT-LABEL: kernel_store_stacksave:83; WAVE64-OPT:       ; %bb.0:84; WAVE64-OPT-NEXT:    s_lshr_b32 s0, s32, 685; WAVE64-OPT-NEXT:    ;;#ASMSTART86; WAVE64-OPT-NEXT:    ; use s087; WAVE64-OPT-NEXT:    ;;#ASMEND88; WAVE64-OPT-NEXT:    s_endpgm89;90; WAVE32-O0-LABEL: kernel_store_stacksave:91; WAVE32-O0:       ; %bb.0:92; WAVE32-O0-NEXT:    s_mov_b32 s0, s3293; WAVE32-O0-NEXT:    s_lshr_b32 s0, s0, 594; WAVE32-O0-NEXT:    ;;#ASMSTART95; WAVE32-O0-NEXT:    ; use s096; WAVE32-O0-NEXT:    ;;#ASMEND97; WAVE32-O0-NEXT:    s_endpgm98;99; WAVE64-O0-LABEL: kernel_store_stacksave:100; WAVE64-O0:       ; %bb.0:101; WAVE64-O0-NEXT:    s_mov_b32 s0, s32102; WAVE64-O0-NEXT:    s_lshr_b32 s0, s0, 6103; WAVE64-O0-NEXT:    ;;#ASMSTART104; WAVE64-O0-NEXT:    ; use s0105; WAVE64-O0-NEXT:    ;;#ASMEND106; WAVE64-O0-NEXT:    s_endpgm107;108; WAVE32-WWM-PREALLOC-LABEL: kernel_store_stacksave:109; WAVE32-WWM-PREALLOC:       ; %bb.0:110; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s0, s32111; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s0, s0, 5112; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMSTART113; WAVE32-WWM-PREALLOC-NEXT:    ; use s0114; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMEND115; WAVE32-WWM-PREALLOC-NEXT:    s_endpgm116  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()117  call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %stacksave)118  ret void119}120 121define amdgpu_kernel void @kernel_store_stacksave_nocall() {122; WAVE32-OPT-LABEL: kernel_store_stacksave_nocall:123; WAVE32-OPT:       ; %bb.0:124; WAVE32-OPT-NEXT:    s_getpc_b64 s[12:13]125; WAVE32-OPT-NEXT:    s_mov_b32 s12, s0126; WAVE32-OPT-NEXT:    v_mov_b32_e32 v0, 0127; WAVE32-OPT-NEXT:    s_load_dwordx4 s[12:15], s[12:13], 0x0128; WAVE32-OPT-NEXT:    s_waitcnt lgkmcnt(0)129; WAVE32-OPT-NEXT:    s_bitset0_b32 s15, 21130; WAVE32-OPT-NEXT:    s_add_u32 s12, s12, s11131; WAVE32-OPT-NEXT:    s_addc_u32 s13, s13, 0132; WAVE32-OPT-NEXT:    s_lshr_b32 s0, s32, 5133; WAVE32-OPT-NEXT:    v_mov_b32_e32 v1, s0134; WAVE32-OPT-NEXT:    buffer_store_dword v0, v1, s[12:15], 0 offen135; WAVE32-OPT-NEXT:    s_endpgm136;137; WAVE64-OPT-LABEL: kernel_store_stacksave_nocall:138; WAVE64-OPT:       ; %bb.0:139; WAVE64-OPT-NEXT:    s_getpc_b64 s[12:13]140; WAVE64-OPT-NEXT:    s_mov_b32 s12, s0141; WAVE64-OPT-NEXT:    v_mov_b32_e32 v0, 0142; WAVE64-OPT-NEXT:    s_load_dwordx4 s[12:15], s[12:13], 0x0143; WAVE64-OPT-NEXT:    s_waitcnt lgkmcnt(0)144; WAVE64-OPT-NEXT:    s_add_u32 s12, s12, s11145; WAVE64-OPT-NEXT:    s_addc_u32 s13, s13, 0146; WAVE64-OPT-NEXT:    s_lshr_b32 s0, s32, 6147; WAVE64-OPT-NEXT:    v_mov_b32_e32 v1, s0148; WAVE64-OPT-NEXT:    buffer_store_dword v0, v1, s[12:15], 0 offen149; WAVE64-OPT-NEXT:    s_endpgm150;151; WAVE32-O0-LABEL: kernel_store_stacksave_nocall:152; WAVE32-O0:       ; %bb.0:153; WAVE32-O0-NEXT:    s_getpc_b64 s[12:13]154; WAVE32-O0-NEXT:    s_mov_b32 s12, s0155; WAVE32-O0-NEXT:    s_load_dwordx4 s[12:15], s[12:13], 0x0156; WAVE32-O0-NEXT:    s_waitcnt lgkmcnt(0)157; WAVE32-O0-NEXT:    s_bitset0_b32 s15, 21158; WAVE32-O0-NEXT:    s_add_u32 s12, s12, s11159; WAVE32-O0-NEXT:    s_addc_u32 s13, s13, 0160; WAVE32-O0-NEXT:    s_mov_b32 s0, s32161; WAVE32-O0-NEXT:    s_lshr_b32 s0, s0, 5162; WAVE32-O0-NEXT:    v_mov_b32_e32 v0, 0163; WAVE32-O0-NEXT:    v_mov_b32_e32 v1, s0164; WAVE32-O0-NEXT:    buffer_store_dword v0, v1, s[12:15], 0 offen165; WAVE32-O0-NEXT:    s_endpgm166;167; WAVE64-O0-LABEL: kernel_store_stacksave_nocall:168; WAVE64-O0:       ; %bb.0:169; WAVE64-O0-NEXT:    s_getpc_b64 s[12:13]170; WAVE64-O0-NEXT:    s_mov_b32 s12, s0171; WAVE64-O0-NEXT:    s_load_dwordx4 s[12:15], s[12:13], 0x0172; WAVE64-O0-NEXT:    s_waitcnt lgkmcnt(0)173; WAVE64-O0-NEXT:    s_add_u32 s12, s12, s11174; WAVE64-O0-NEXT:    s_addc_u32 s13, s13, 0175; WAVE64-O0-NEXT:    s_mov_b32 s0, s32176; WAVE64-O0-NEXT:    s_lshr_b32 s0, s0, 6177; WAVE64-O0-NEXT:    v_mov_b32_e32 v0, 0178; WAVE64-O0-NEXT:    v_mov_b32_e32 v1, s0179; WAVE64-O0-NEXT:    buffer_store_dword v0, v1, s[12:15], 0 offen180; WAVE64-O0-NEXT:    s_endpgm181;182; WAVE32-WWM-PREALLOC-LABEL: kernel_store_stacksave_nocall:183; WAVE32-WWM-PREALLOC:       ; %bb.0:184; WAVE32-WWM-PREALLOC-NEXT:    s_getpc_b64 s[12:13]185; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s12, s0186; WAVE32-WWM-PREALLOC-NEXT:    s_load_dwordx4 s[12:15], s[12:13], 0x0187; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt lgkmcnt(0)188; WAVE32-WWM-PREALLOC-NEXT:    s_bitset0_b32 s15, 21189; WAVE32-WWM-PREALLOC-NEXT:    s_add_u32 s12, s12, s11190; WAVE32-WWM-PREALLOC-NEXT:    s_addc_u32 s13, s13, 0191; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s0, s32192; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s0, s0, 5193; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v0, 0194; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v1, s0195; WAVE32-WWM-PREALLOC-NEXT:    buffer_store_dword v0, v1, s[12:15], 0 offen196; WAVE32-WWM-PREALLOC-NEXT:    s_endpgm197  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()198  store i32 0, ptr addrspace(5) %stacksave199  ret void200}201 202define void @func_stacksave_nonentry_block(i1 %cond) {203; WAVE32-OPT-LABEL: func_stacksave_nonentry_block:204; WAVE32-OPT:       ; %bb.0: ; %bb0205; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)206; WAVE32-OPT-NEXT:    v_and_b32_e32 v0, 1, v0207; WAVE32-OPT-NEXT:    s_mov_b32 s4, exec_lo208; WAVE32-OPT-NEXT:    v_cmpx_eq_u32_e32 1, v0209; WAVE32-OPT-NEXT:    s_cbranch_execz .LBB4_2210; WAVE32-OPT-NEXT:  ; %bb.1: ; %bb1211; WAVE32-OPT-NEXT:    s_lshr_b32 s5, s32, 5212; WAVE32-OPT-NEXT:    ;;#ASMSTART213; WAVE32-OPT-NEXT:    ; use s5214; WAVE32-OPT-NEXT:    ;;#ASMEND215; WAVE32-OPT-NEXT:  .LBB4_2: ; %bb2216; WAVE32-OPT-NEXT:    s_or_b32 exec_lo, exec_lo, s4217; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]218;219; WAVE64-OPT-LABEL: func_stacksave_nonentry_block:220; WAVE64-OPT:       ; %bb.0: ; %bb0221; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)222; WAVE64-OPT-NEXT:    v_and_b32_e32 v0, 1, v0223; WAVE64-OPT-NEXT:    s_mov_b64 s[4:5], exec224; WAVE64-OPT-NEXT:    v_cmpx_eq_u32_e32 1, v0225; WAVE64-OPT-NEXT:    s_cbranch_execz .LBB4_2226; WAVE64-OPT-NEXT:  ; %bb.1: ; %bb1227; WAVE64-OPT-NEXT:    s_lshr_b32 s6, s32, 6228; WAVE64-OPT-NEXT:    ;;#ASMSTART229; WAVE64-OPT-NEXT:    ; use s6230; WAVE64-OPT-NEXT:    ;;#ASMEND231; WAVE64-OPT-NEXT:  .LBB4_2: ; %bb2232; WAVE64-OPT-NEXT:    s_or_b64 exec, exec, s[4:5]233; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]234;235; WAVE32-O0-LABEL: func_stacksave_nonentry_block:236; WAVE32-O0:       ; %bb.0: ; %bb0237; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)238; WAVE32-O0-NEXT:    s_xor_saveexec_b32 s4, -1239; WAVE32-O0-NEXT:    buffer_store_dword v1, off, s[0:3], s32 offset:4 ; 4-byte Folded Spill240; WAVE32-O0-NEXT:    s_mov_b32 exec_lo, s4241; WAVE32-O0-NEXT:    v_and_b32_e64 v0, 1, v0242; WAVE32-O0-NEXT:    v_cmp_eq_u32_e64 s5, v0, 1243; WAVE32-O0-NEXT:    s_mov_b32 s4, exec_lo244; WAVE32-O0-NEXT:    ; implicit-def: $vgpr1 : SGPR spill to VGPR lane245; WAVE32-O0-NEXT:    v_writelane_b32 v1, s4, 0246; WAVE32-O0-NEXT:    s_or_saveexec_b32 s7, -1247; WAVE32-O0-NEXT:    buffer_store_dword v1, off, s[0:3], s32 ; 4-byte Folded Spill248; WAVE32-O0-NEXT:    s_mov_b32 exec_lo, s7249; WAVE32-O0-NEXT:    s_and_b32 s4, s4, s5250; WAVE32-O0-NEXT:    s_mov_b32 exec_lo, s4251; WAVE32-O0-NEXT:    s_cbranch_execz .LBB4_2252; WAVE32-O0-NEXT:  ; %bb.1: ; %bb1253; WAVE32-O0-NEXT:    s_mov_b32 s4, s32254; WAVE32-O0-NEXT:    s_lshr_b32 s4, s4, 5255; WAVE32-O0-NEXT:    ;;#ASMSTART256; WAVE32-O0-NEXT:    ; use s4257; WAVE32-O0-NEXT:    ;;#ASMEND258; WAVE32-O0-NEXT:  .LBB4_2: ; %bb2259; WAVE32-O0-NEXT:    s_or_saveexec_b32 s7, -1260; WAVE32-O0-NEXT:    buffer_load_dword v1, off, s[0:3], s32 ; 4-byte Folded Reload261; WAVE32-O0-NEXT:    s_mov_b32 exec_lo, s7262; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0)263; WAVE32-O0-NEXT:    v_readlane_b32 s4, v1, 0264; WAVE32-O0-NEXT:    s_or_b32 exec_lo, exec_lo, s4265; WAVE32-O0-NEXT:    s_xor_saveexec_b32 s4, -1266; WAVE32-O0-NEXT:    buffer_load_dword v1, off, s[0:3], s32 offset:4 ; 4-byte Folded Reload267; WAVE32-O0-NEXT:    s_mov_b32 exec_lo, s4268; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0)269; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]270;271; WAVE64-O0-LABEL: func_stacksave_nonentry_block:272; WAVE64-O0:       ; %bb.0: ; %bb0273; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)274; WAVE64-O0-NEXT:    s_xor_saveexec_b64 s[4:5], -1275; WAVE64-O0-NEXT:    buffer_store_dword v1, off, s[0:3], s32 offset:4 ; 4-byte Folded Spill276; WAVE64-O0-NEXT:    s_mov_b64 exec, s[4:5]277; WAVE64-O0-NEXT:    v_and_b32_e64 v0, 1, v0278; WAVE64-O0-NEXT:    v_cmp_eq_u32_e64 s[6:7], v0, 1279; WAVE64-O0-NEXT:    s_mov_b64 s[4:5], exec280; WAVE64-O0-NEXT:    ; implicit-def: $vgpr1 : SGPR spill to VGPR lane281; WAVE64-O0-NEXT:    v_writelane_b32 v1, s4, 0282; WAVE64-O0-NEXT:    v_writelane_b32 v1, s5, 1283; WAVE64-O0-NEXT:    s_or_saveexec_b64 s[10:11], -1284; WAVE64-O0-NEXT:    buffer_store_dword v1, off, s[0:3], s32 ; 4-byte Folded Spill285; WAVE64-O0-NEXT:    s_mov_b64 exec, s[10:11]286; WAVE64-O0-NEXT:    s_and_b64 s[4:5], s[4:5], s[6:7]287; WAVE64-O0-NEXT:    s_mov_b64 exec, s[4:5]288; WAVE64-O0-NEXT:    s_cbranch_execz .LBB4_2289; WAVE64-O0-NEXT:  ; %bb.1: ; %bb1290; WAVE64-O0-NEXT:    s_mov_b32 s4, s32291; WAVE64-O0-NEXT:    s_lshr_b32 s4, s4, 6292; WAVE64-O0-NEXT:    ;;#ASMSTART293; WAVE64-O0-NEXT:    ; use s4294; WAVE64-O0-NEXT:    ;;#ASMEND295; WAVE64-O0-NEXT:  .LBB4_2: ; %bb2296; WAVE64-O0-NEXT:    s_or_saveexec_b64 s[10:11], -1297; WAVE64-O0-NEXT:    buffer_load_dword v1, off, s[0:3], s32 ; 4-byte Folded Reload298; WAVE64-O0-NEXT:    s_mov_b64 exec, s[10:11]299; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0)300; WAVE64-O0-NEXT:    v_readlane_b32 s4, v1, 0301; WAVE64-O0-NEXT:    v_readlane_b32 s5, v1, 1302; WAVE64-O0-NEXT:    s_or_b64 exec, exec, s[4:5]303; WAVE64-O0-NEXT:    s_xor_saveexec_b64 s[4:5], -1304; WAVE64-O0-NEXT:    buffer_load_dword v1, off, s[0:3], s32 offset:4 ; 4-byte Folded Reload305; WAVE64-O0-NEXT:    s_mov_b64 exec, s[4:5]306; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0)307; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]308;309; WAVE32-WWM-PREALLOC-LABEL: func_stacksave_nonentry_block:310; WAVE32-WWM-PREALLOC:       ; %bb.0: ; %bb0311; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)312; WAVE32-WWM-PREALLOC-NEXT:    s_xor_saveexec_b32 s4, -1313; WAVE32-WWM-PREALLOC-NEXT:    buffer_store_dword v1, off, s[0:3], s32 ; 4-byte Folded Spill314; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 exec_lo, s4315; WAVE32-WWM-PREALLOC-NEXT:    v_and_b32_e64 v0, 1, v0316; WAVE32-WWM-PREALLOC-NEXT:    v_cmp_eq_u32_e64 s5, v0, 1317; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, exec_lo318; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $vgpr1 : SGPR spill to VGPR lane319; WAVE32-WWM-PREALLOC-NEXT:    v_writelane_b32 v1, s4, 0320; WAVE32-WWM-PREALLOC-NEXT:    s_and_b32 s4, s4, s5321; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 exec_lo, s4322; WAVE32-WWM-PREALLOC-NEXT:    s_cbranch_execz .LBB4_2323; WAVE32-WWM-PREALLOC-NEXT:  ; %bb.1: ; %bb1324; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, s32325; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s4, s4, 5326; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMSTART327; WAVE32-WWM-PREALLOC-NEXT:    ; use s4328; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMEND329; WAVE32-WWM-PREALLOC-NEXT:  .LBB4_2: ; %bb2330; WAVE32-WWM-PREALLOC-NEXT:    v_readlane_b32 s4, v1, 0331; WAVE32-WWM-PREALLOC-NEXT:    s_or_b32 exec_lo, exec_lo, s4332; WAVE32-WWM-PREALLOC-NEXT:    s_xor_saveexec_b32 s4, -1333; WAVE32-WWM-PREALLOC-NEXT:    buffer_load_dword v1, off, s[0:3], s32 ; 4-byte Folded Reload334; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 exec_lo, s4335; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0)336; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]337bb0:338  br i1 %cond, label %bb1, label %bb2339 340bb1:341  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()342  call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %stacksave)343  br label %bb2344 345bb2:346  ret void347}348 349define void @func_stackrestore_poison() {350; WAVE32-OPT-LABEL: func_stackrestore_poison:351; WAVE32-OPT:       ; %bb.0:352; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)353; WAVE32-OPT-NEXT:    s_lshl_b32 s32, s4, 5354; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]355;356; WAVE64-OPT-LABEL: func_stackrestore_poison:357; WAVE64-OPT:       ; %bb.0:358; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)359; WAVE64-OPT-NEXT:    s_lshl_b32 s32, s4, 6360; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]361;362; WAVE32-O0-LABEL: func_stackrestore_poison:363; WAVE32-O0:       ; %bb.0:364; WAVE32-O0-NEXT:    ; implicit-def: $sgpr4365; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)366; WAVE32-O0-NEXT:    s_lshl_b32 s4, s4, 5367; WAVE32-O0-NEXT:    s_mov_b32 s32, s4368; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]369;370; WAVE64-O0-LABEL: func_stackrestore_poison:371; WAVE64-O0:       ; %bb.0:372; WAVE64-O0-NEXT:    ; implicit-def: $sgpr4373; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)374; WAVE64-O0-NEXT:    s_lshl_b32 s4, s4, 6375; WAVE64-O0-NEXT:    s_mov_b32 s32, s4376; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]377;378; WAVE32-WWM-PREALLOC-LABEL: func_stackrestore_poison:379; WAVE32-WWM-PREALLOC:       ; %bb.0:380; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr4381; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)382; WAVE32-WWM-PREALLOC-NEXT:    s_lshl_b32 s4, s4, 5383; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s4384; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]385  call void @llvm.stackrestore.p5(ptr addrspace(5) poison)386  ret void387}388 389define void @func_stackrestore_null() {390; WAVE32-OPT-LABEL: func_stackrestore_null:391; WAVE32-OPT:       ; %bb.0:392; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)393; WAVE32-OPT-NEXT:    s_mov_b32 s32, 0394; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]395;396; WAVE64-OPT-LABEL: func_stackrestore_null:397; WAVE64-OPT:       ; %bb.0:398; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)399; WAVE64-OPT-NEXT:    s_mov_b32 s32, 0400; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]401;402; WAVE32-O0-LABEL: func_stackrestore_null:403; WAVE32-O0:       ; %bb.0:404; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)405; WAVE32-O0-NEXT:    s_mov_b32 s4, 0406; WAVE32-O0-NEXT:    s_lshl_b32 s4, s4, 5407; WAVE32-O0-NEXT:    s_mov_b32 s32, s4408; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]409;410; WAVE64-O0-LABEL: func_stackrestore_null:411; WAVE64-O0:       ; %bb.0:412; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)413; WAVE64-O0-NEXT:    s_mov_b32 s4, 0414; WAVE64-O0-NEXT:    s_lshl_b32 s4, s4, 6415; WAVE64-O0-NEXT:    s_mov_b32 s32, s4416; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]417;418; WAVE32-WWM-PREALLOC-LABEL: func_stackrestore_null:419; WAVE32-WWM-PREALLOC:       ; %bb.0:420; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)421; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, 0422; WAVE32-WWM-PREALLOC-NEXT:    s_lshl_b32 s4, s4, 5423; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s4424; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]425  call void @llvm.stackrestore.p5(ptr addrspace(5) null)426  ret void427}428 429define void @func_stackrestore_neg1() {430; WAVE32-OPT-LABEL: func_stackrestore_neg1:431; WAVE32-OPT:       ; %bb.0:432; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)433; WAVE32-OPT-NEXT:    s_movk_i32 s32, 0xffe0434; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]435;436; WAVE64-OPT-LABEL: func_stackrestore_neg1:437; WAVE64-OPT:       ; %bb.0:438; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)439; WAVE64-OPT-NEXT:    s_movk_i32 s32, 0xffc0440; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]441;442; WAVE32-O0-LABEL: func_stackrestore_neg1:443; WAVE32-O0:       ; %bb.0:444; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)445; WAVE32-O0-NEXT:    s_mov_b32 s4, -1446; WAVE32-O0-NEXT:    s_lshl_b32 s4, s4, 5447; WAVE32-O0-NEXT:    s_mov_b32 s32, s4448; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]449;450; WAVE64-O0-LABEL: func_stackrestore_neg1:451; WAVE64-O0:       ; %bb.0:452; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)453; WAVE64-O0-NEXT:    s_mov_b32 s4, -1454; WAVE64-O0-NEXT:    s_lshl_b32 s4, s4, 6455; WAVE64-O0-NEXT:    s_mov_b32 s32, s4456; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]457;458; WAVE32-WWM-PREALLOC-LABEL: func_stackrestore_neg1:459; WAVE32-WWM-PREALLOC:       ; %bb.0:460; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)461; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, -1462; WAVE32-WWM-PREALLOC-NEXT:    s_lshl_b32 s4, s4, 5463; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s4464; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]465  call void @llvm.stackrestore.p5(ptr addrspace(5) inttoptr (i32 -1 to ptr addrspace(5)))466  ret void467}468 469define void @func_stackrestore_42() {470; WAVE32-OPT-LABEL: func_stackrestore_42:471; WAVE32-OPT:       ; %bb.0:472; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)473; WAVE32-OPT-NEXT:    s_movk_i32 s32, 0x540474; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]475;476; WAVE64-OPT-LABEL: func_stackrestore_42:477; WAVE64-OPT:       ; %bb.0:478; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)479; WAVE64-OPT-NEXT:    s_movk_i32 s32, 0xa80480; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]481;482; WAVE32-O0-LABEL: func_stackrestore_42:483; WAVE32-O0:       ; %bb.0:484; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)485; WAVE32-O0-NEXT:    s_mov_b32 s4, 42486; WAVE32-O0-NEXT:    s_lshl_b32 s4, s4, 5487; WAVE32-O0-NEXT:    s_mov_b32 s32, s4488; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]489;490; WAVE64-O0-LABEL: func_stackrestore_42:491; WAVE64-O0:       ; %bb.0:492; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)493; WAVE64-O0-NEXT:    s_mov_b32 s4, 42494; WAVE64-O0-NEXT:    s_lshl_b32 s4, s4, 6495; WAVE64-O0-NEXT:    s_mov_b32 s32, s4496; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]497;498; WAVE32-WWM-PREALLOC-LABEL: func_stackrestore_42:499; WAVE32-WWM-PREALLOC:       ; %bb.0:500; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)501; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, 42502; WAVE32-WWM-PREALLOC-NEXT:    s_lshl_b32 s4, s4, 5503; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s4504; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]505  call void @llvm.stackrestore.p5(ptr addrspace(5) inttoptr (i32 42 to ptr addrspace(5)))506  ret void507}508 509define void @func_stacksave_stackrestore() {510; WAVE32-OPT-LABEL: func_stacksave_stackrestore:511; WAVE32-OPT:       ; %bb.0:512; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)513; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]514;515; WAVE64-OPT-LABEL: func_stacksave_stackrestore:516; WAVE64-OPT:       ; %bb.0:517; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)518; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]519;520; WAVE32-O0-LABEL: func_stacksave_stackrestore:521; WAVE32-O0:       ; %bb.0:522; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)523; WAVE32-O0-NEXT:    s_mov_b32 s4, s32524; WAVE32-O0-NEXT:    s_mov_b32 s32, s4525; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]526;527; WAVE64-O0-LABEL: func_stacksave_stackrestore:528; WAVE64-O0:       ; %bb.0:529; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)530; WAVE64-O0-NEXT:    s_mov_b32 s4, s32531; WAVE64-O0-NEXT:    s_mov_b32 s32, s4532; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]533;534; WAVE32-WWM-PREALLOC-LABEL: func_stacksave_stackrestore:535; WAVE32-WWM-PREALLOC:       ; %bb.0:536; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)537; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, s32538; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s4539; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]540  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()541  call void @llvm.stackrestore.p5(ptr addrspace(5) %stacksave)542  ret void543}544 545define void @func_stacksave_stackrestore_use() {546; WAVE32-OPT-LABEL: func_stacksave_stackrestore_use:547; WAVE32-OPT:       ; %bb.0:548; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)549; WAVE32-OPT-NEXT:    s_lshr_b32 s4, s32, 5550; WAVE32-OPT-NEXT:    ;;#ASMSTART551; WAVE32-OPT-NEXT:    ; use s4552; WAVE32-OPT-NEXT:    ;;#ASMEND553; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]554;555; WAVE64-OPT-LABEL: func_stacksave_stackrestore_use:556; WAVE64-OPT:       ; %bb.0:557; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)558; WAVE64-OPT-NEXT:    s_lshr_b32 s4, s32, 6559; WAVE64-OPT-NEXT:    ;;#ASMSTART560; WAVE64-OPT-NEXT:    ; use s4561; WAVE64-OPT-NEXT:    ;;#ASMEND562; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]563;564; WAVE32-O0-LABEL: func_stacksave_stackrestore_use:565; WAVE32-O0:       ; %bb.0:566; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)567; WAVE32-O0-NEXT:    s_mov_b32 s4, s32568; WAVE32-O0-NEXT:    s_lshr_b32 s5, s4, 5569; WAVE32-O0-NEXT:    ;;#ASMSTART570; WAVE32-O0-NEXT:    ; use s5571; WAVE32-O0-NEXT:    ;;#ASMEND572; WAVE32-O0-NEXT:    s_mov_b32 s32, s4573; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]574;575; WAVE64-O0-LABEL: func_stacksave_stackrestore_use:576; WAVE64-O0:       ; %bb.0:577; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)578; WAVE64-O0-NEXT:    s_mov_b32 s4, s32579; WAVE64-O0-NEXT:    s_lshr_b32 s5, s4, 6580; WAVE64-O0-NEXT:    ;;#ASMSTART581; WAVE64-O0-NEXT:    ; use s5582; WAVE64-O0-NEXT:    ;;#ASMEND583; WAVE64-O0-NEXT:    s_mov_b32 s32, s4584; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]585;586; WAVE32-WWM-PREALLOC-LABEL: func_stacksave_stackrestore_use:587; WAVE32-WWM-PREALLOC:       ; %bb.0:588; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)589; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, s32590; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s5, s4, 5591; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMSTART592; WAVE32-WWM-PREALLOC-NEXT:    ; use s5593; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMEND594; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s4595; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]596  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()597  call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %stacksave)598  call void @llvm.stackrestore.p5(ptr addrspace(5) %stacksave)599  ret void600}601 602define amdgpu_kernel void @kernel_stacksave_stackrestore_use() {603; WAVE32-OPT-LABEL: kernel_stacksave_stackrestore_use:604; WAVE32-OPT:       ; %bb.0:605; WAVE32-OPT-NEXT:    s_lshr_b32 s0, s32, 5606; WAVE32-OPT-NEXT:    ;;#ASMSTART607; WAVE32-OPT-NEXT:    ; use s0608; WAVE32-OPT-NEXT:    ;;#ASMEND609; WAVE32-OPT-NEXT:    s_endpgm610;611; WAVE64-OPT-LABEL: kernel_stacksave_stackrestore_use:612; WAVE64-OPT:       ; %bb.0:613; WAVE64-OPT-NEXT:    s_lshr_b32 s0, s32, 6614; WAVE64-OPT-NEXT:    ;;#ASMSTART615; WAVE64-OPT-NEXT:    ; use s0616; WAVE64-OPT-NEXT:    ;;#ASMEND617; WAVE64-OPT-NEXT:    s_endpgm618;619; WAVE32-O0-LABEL: kernel_stacksave_stackrestore_use:620; WAVE32-O0:       ; %bb.0:621; WAVE32-O0-NEXT:    s_mov_b32 s0, s32622; WAVE32-O0-NEXT:    s_lshr_b32 s1, s0, 5623; WAVE32-O0-NEXT:    ;;#ASMSTART624; WAVE32-O0-NEXT:    ; use s1625; WAVE32-O0-NEXT:    ;;#ASMEND626; WAVE32-O0-NEXT:    s_mov_b32 s32, s0627; WAVE32-O0-NEXT:    s_endpgm628;629; WAVE64-O0-LABEL: kernel_stacksave_stackrestore_use:630; WAVE64-O0:       ; %bb.0:631; WAVE64-O0-NEXT:    s_mov_b32 s0, s32632; WAVE64-O0-NEXT:    s_lshr_b32 s1, s0, 6633; WAVE64-O0-NEXT:    ;;#ASMSTART634; WAVE64-O0-NEXT:    ; use s1635; WAVE64-O0-NEXT:    ;;#ASMEND636; WAVE64-O0-NEXT:    s_mov_b32 s32, s0637; WAVE64-O0-NEXT:    s_endpgm638;639; WAVE32-WWM-PREALLOC-LABEL: kernel_stacksave_stackrestore_use:640; WAVE32-WWM-PREALLOC:       ; %bb.0:641; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s0, s32642; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s1, s0, 5643; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMSTART644; WAVE32-WWM-PREALLOC-NEXT:    ; use s1645; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMEND646; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s0647; WAVE32-WWM-PREALLOC-NEXT:    s_endpgm648  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()649  call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %stacksave)650  call void @llvm.stackrestore.p5(ptr addrspace(5) %stacksave)651  ret void652}653 654define void @func_stacksave_stackrestore_voffset(i32 %offset) {655; WAVE32-OPT-LABEL: func_stacksave_stackrestore_voffset:656; WAVE32-OPT:       ; %bb.0:657; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)658; WAVE32-OPT-NEXT:    s_lshr_b32 s4, s32, 5659; WAVE32-OPT-NEXT:    v_add_nc_u32_e32 v0, s4, v0660; WAVE32-OPT-NEXT:    v_readfirstlane_b32 s4, v0661; WAVE32-OPT-NEXT:    s_lshl_b32 s32, s4, 5662; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]663;664; WAVE64-OPT-LABEL: func_stacksave_stackrestore_voffset:665; WAVE64-OPT:       ; %bb.0:666; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)667; WAVE64-OPT-NEXT:    s_lshr_b32 s4, s32, 6668; WAVE64-OPT-NEXT:    v_add_nc_u32_e32 v0, s4, v0669; WAVE64-OPT-NEXT:    v_readfirstlane_b32 s4, v0670; WAVE64-OPT-NEXT:    s_lshl_b32 s32, s4, 6671; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]672;673; WAVE32-O0-LABEL: func_stacksave_stackrestore_voffset:674; WAVE32-O0:       ; %bb.0:675; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)676; WAVE32-O0-NEXT:    s_mov_b32 s4, s32677; WAVE32-O0-NEXT:    s_lshr_b32 s4, s4, 5678; WAVE32-O0-NEXT:    v_add_nc_u32_e64 v0, s4, v0679; WAVE32-O0-NEXT:    v_readfirstlane_b32 s4, v0680; WAVE32-O0-NEXT:    s_lshl_b32 s4, s4, 5681; WAVE32-O0-NEXT:    s_mov_b32 s32, s4682; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]683;684; WAVE64-O0-LABEL: func_stacksave_stackrestore_voffset:685; WAVE64-O0:       ; %bb.0:686; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)687; WAVE64-O0-NEXT:    s_mov_b32 s4, s32688; WAVE64-O0-NEXT:    s_lshr_b32 s4, s4, 6689; WAVE64-O0-NEXT:    v_add_nc_u32_e64 v0, s4, v0690; WAVE64-O0-NEXT:    v_readfirstlane_b32 s4, v0691; WAVE64-O0-NEXT:    s_lshl_b32 s4, s4, 6692; WAVE64-O0-NEXT:    s_mov_b32 s32, s4693; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]694;695; WAVE32-WWM-PREALLOC-LABEL: func_stacksave_stackrestore_voffset:696; WAVE32-WWM-PREALLOC:       ; %bb.0:697; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)698; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s4, s32699; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s4, s4, 5700; WAVE32-WWM-PREALLOC-NEXT:    v_add_nc_u32_e64 v0, s4, v0701; WAVE32-WWM-PREALLOC-NEXT:    v_readfirstlane_b32 s4, v0702; WAVE32-WWM-PREALLOC-NEXT:    s_lshl_b32 s4, s4, 5703; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s4704; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]705  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()706  %gep = getelementptr i8, ptr addrspace(5) %stacksave, i32 %offset707  call void @llvm.stackrestore.p5(ptr addrspace(5) %gep)708  ret void709}710 711define void @func_stacksave_vgpr(ptr addrspace(5) %stack) {712; WAVE32-OPT-LABEL: func_stacksave_vgpr:713; WAVE32-OPT:       ; %bb.0:714; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)715; WAVE32-OPT-NEXT:    v_readfirstlane_b32 s4, v0716; WAVE32-OPT-NEXT:    s_lshl_b32 s32, s4, 5717; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]718;719; WAVE64-OPT-LABEL: func_stacksave_vgpr:720; WAVE64-OPT:       ; %bb.0:721; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)722; WAVE64-OPT-NEXT:    v_readfirstlane_b32 s4, v0723; WAVE64-OPT-NEXT:    s_lshl_b32 s32, s4, 6724; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]725;726; WAVE32-O0-LABEL: func_stacksave_vgpr:727; WAVE32-O0:       ; %bb.0:728; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)729; WAVE32-O0-NEXT:    v_readfirstlane_b32 s4, v0730; WAVE32-O0-NEXT:    s_lshl_b32 s4, s4, 5731; WAVE32-O0-NEXT:    s_mov_b32 s32, s4732; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]733;734; WAVE64-O0-LABEL: func_stacksave_vgpr:735; WAVE64-O0:       ; %bb.0:736; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)737; WAVE64-O0-NEXT:    v_readfirstlane_b32 s4, v0738; WAVE64-O0-NEXT:    s_lshl_b32 s4, s4, 6739; WAVE64-O0-NEXT:    s_mov_b32 s32, s4740; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]741;742; WAVE32-WWM-PREALLOC-LABEL: func_stacksave_vgpr:743; WAVE32-WWM-PREALLOC:       ; %bb.0:744; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)745; WAVE32-WWM-PREALLOC-NEXT:    v_readfirstlane_b32 s4, v0746; WAVE32-WWM-PREALLOC-NEXT:    s_lshl_b32 s4, s4, 5747; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s4748; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]749  call void @llvm.stackrestore.p5(ptr addrspace(5) %stack)750  ret void751}752 753define amdgpu_gfx void @func_stacksave_sgpr(ptr addrspace(5) inreg %stack) {754; WAVE32-OPT-LABEL: func_stacksave_sgpr:755; WAVE32-OPT:       ; %bb.0:756; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)757; WAVE32-OPT-NEXT:    s_lshl_b32 s32, s4, 5758; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]759;760; WAVE64-OPT-LABEL: func_stacksave_sgpr:761; WAVE64-OPT:       ; %bb.0:762; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)763; WAVE64-OPT-NEXT:    s_lshl_b32 s32, s4, 6764; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]765;766; WAVE32-O0-LABEL: func_stacksave_sgpr:767; WAVE32-O0:       ; %bb.0:768; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)769; WAVE32-O0-NEXT:    s_lshl_b32 s34, s4, 5770; WAVE32-O0-NEXT:    s_mov_b32 s32, s34771; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]772;773; WAVE64-O0-LABEL: func_stacksave_sgpr:774; WAVE64-O0:       ; %bb.0:775; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)776; WAVE64-O0-NEXT:    s_lshl_b32 s34, s4, 6777; WAVE64-O0-NEXT:    s_mov_b32 s32, s34778; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]779;780; WAVE32-WWM-PREALLOC-LABEL: func_stacksave_sgpr:781; WAVE32-WWM-PREALLOC:       ; %bb.0:782; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)783; WAVE32-WWM-PREALLOC-NEXT:    s_lshl_b32 s34, s4, 5784; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s34785; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]786  call void @llvm.stackrestore.p5(ptr addrspace(5) %stack)787  ret void788}789 790define amdgpu_kernel void @kernel_stacksave_sgpr(ptr addrspace(5) %stack) {791; WAVE32-OPT-LABEL: kernel_stacksave_sgpr:792; WAVE32-OPT:       ; %bb.0:793; WAVE32-OPT-NEXT:    s_load_dword s0, s[4:5], 0x0794; WAVE32-OPT-NEXT:    s_waitcnt lgkmcnt(0)795; WAVE32-OPT-NEXT:    ;;#ASMSTART796; WAVE32-OPT-NEXT:    ; use s0797; WAVE32-OPT-NEXT:    ;;#ASMEND798; WAVE32-OPT-NEXT:    s_endpgm799;800; WAVE64-OPT-LABEL: kernel_stacksave_sgpr:801; WAVE64-OPT:       ; %bb.0:802; WAVE64-OPT-NEXT:    s_load_dword s0, s[4:5], 0x0803; WAVE64-OPT-NEXT:    s_waitcnt lgkmcnt(0)804; WAVE64-OPT-NEXT:    ;;#ASMSTART805; WAVE64-OPT-NEXT:    ; use s0806; WAVE64-OPT-NEXT:    ;;#ASMEND807; WAVE64-OPT-NEXT:    s_endpgm808;809; WAVE32-O0-LABEL: kernel_stacksave_sgpr:810; WAVE32-O0:       ; %bb.0:811; WAVE32-O0-NEXT:    s_load_dword s0, s[4:5], 0x0812; WAVE32-O0-NEXT:    s_waitcnt lgkmcnt(0)813; WAVE32-O0-NEXT:    s_mov_b32 s1, s0814; WAVE32-O0-NEXT:    ;;#ASMSTART815; WAVE32-O0-NEXT:    ; use s1816; WAVE32-O0-NEXT:    ;;#ASMEND817; WAVE32-O0-NEXT:    s_lshl_b32 s0, s0, 5818; WAVE32-O0-NEXT:    s_mov_b32 s32, s0819; WAVE32-O0-NEXT:    s_endpgm820;821; WAVE64-O0-LABEL: kernel_stacksave_sgpr:822; WAVE64-O0:       ; %bb.0:823; WAVE64-O0-NEXT:    s_load_dword s0, s[4:5], 0x0824; WAVE64-O0-NEXT:    s_waitcnt lgkmcnt(0)825; WAVE64-O0-NEXT:    s_mov_b32 s1, s0826; WAVE64-O0-NEXT:    ;;#ASMSTART827; WAVE64-O0-NEXT:    ; use s1828; WAVE64-O0-NEXT:    ;;#ASMEND829; WAVE64-O0-NEXT:    s_lshl_b32 s0, s0, 6830; WAVE64-O0-NEXT:    s_mov_b32 s32, s0831; WAVE64-O0-NEXT:    s_endpgm832;833; WAVE32-WWM-PREALLOC-LABEL: kernel_stacksave_sgpr:834; WAVE32-WWM-PREALLOC:       ; %bb.0:835; WAVE32-WWM-PREALLOC-NEXT:    s_load_dword s0, s[4:5], 0x0836; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt lgkmcnt(0)837; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s1, s0838; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMSTART839; WAVE32-WWM-PREALLOC-NEXT:    ; use s1840; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMEND841; WAVE32-WWM-PREALLOC-NEXT:    s_lshl_b32 s0, s0, 5842; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s0843; WAVE32-WWM-PREALLOC-NEXT:    s_endpgm844  call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %stack)845  call void @llvm.stackrestore.p5(ptr addrspace(5) %stack)846  ret void847}848 849define amdgpu_kernel void @kernel_stacksave_stackrestore_call_with_stack_objects() {850; WAVE32-OPT-LABEL: kernel_stacksave_stackrestore_call_with_stack_objects:851; WAVE32-OPT:       ; %bb.0:852; WAVE32-OPT-NEXT:    s_getpc_b64 s[20:21]853; WAVE32-OPT-NEXT:    s_mov_b32 s20, s0854; WAVE32-OPT-NEXT:    v_lshlrev_b32_e32 v2, 20, v2855; WAVE32-OPT-NEXT:    s_load_dwordx4 s[20:23], s[20:21], 0x0856; WAVE32-OPT-NEXT:    v_lshlrev_b32_e32 v1, 10, v1857; WAVE32-OPT-NEXT:    s_movk_i32 s32, 0x1200858; WAVE32-OPT-NEXT:    s_mov_b32 s13, s9859; WAVE32-OPT-NEXT:    s_mov_b32 s12, s8860; WAVE32-OPT-NEXT:    s_mov_b64 s[8:9], s[4:5]861; WAVE32-OPT-NEXT:    s_mov_b32 s4, s32862; WAVE32-OPT-NEXT:    v_mov_b32_e32 v3, 42863; WAVE32-OPT-NEXT:    v_mov_b32_e32 v4, 17864; WAVE32-OPT-NEXT:    v_or3_b32 v31, v0, v1, v2865; WAVE32-OPT-NEXT:    s_mov_b32 s14, s10866; WAVE32-OPT-NEXT:    s_mov_b32 s17, stack_passed_argument@abs32@hi867; WAVE32-OPT-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo868; WAVE32-OPT-NEXT:    s_waitcnt lgkmcnt(0)869; WAVE32-OPT-NEXT:    s_bitset0_b32 s23, 21870; WAVE32-OPT-NEXT:    s_add_u32 s20, s20, s11871; WAVE32-OPT-NEXT:    s_addc_u32 s21, s21, 0872; WAVE32-OPT-NEXT:    s_mov_b64 s[10:11], s[6:7]873; WAVE32-OPT-NEXT:    s_lshr_b32 s15, s4, 5874; WAVE32-OPT-NEXT:    s_mov_b64 s[4:5], s[0:1]875; WAVE32-OPT-NEXT:    s_mov_b64 s[6:7], s[2:3]876; WAVE32-OPT-NEXT:    s_mov_b64 s[0:1], s[20:21]877; WAVE32-OPT-NEXT:    s_mov_b64 s[2:3], s[22:23]878; WAVE32-OPT-NEXT:    buffer_store_dword v3, off, s[20:23], 0879; WAVE32-OPT-NEXT:    s_waitcnt_vscnt null, 0x0880; WAVE32-OPT-NEXT:    buffer_store_dword v4, off, s[20:23], s32 offset:4881; WAVE32-OPT-NEXT:    s_swappc_b64 s[30:31], s[16:17]882; WAVE32-OPT-NEXT:    ;;#ASMSTART883; WAVE32-OPT-NEXT:    ; use s15884; WAVE32-OPT-NEXT:    ;;#ASMEND885; WAVE32-OPT-NEXT:    s_endpgm886;887; WAVE64-OPT-LABEL: kernel_stacksave_stackrestore_call_with_stack_objects:888; WAVE64-OPT:       ; %bb.0:889; WAVE64-OPT-NEXT:    s_getpc_b64 s[20:21]890; WAVE64-OPT-NEXT:    s_mov_b32 s20, s0891; WAVE64-OPT-NEXT:    v_lshlrev_b32_e32 v2, 20, v2892; WAVE64-OPT-NEXT:    s_load_dwordx4 s[20:23], s[20:21], 0x0893; WAVE64-OPT-NEXT:    v_lshlrev_b32_e32 v1, 10, v1894; WAVE64-OPT-NEXT:    s_movk_i32 s32, 0x2400895; WAVE64-OPT-NEXT:    s_mov_b32 s13, s9896; WAVE64-OPT-NEXT:    s_mov_b32 s12, s8897; WAVE64-OPT-NEXT:    s_mov_b64 s[8:9], s[4:5]898; WAVE64-OPT-NEXT:    s_mov_b32 s4, s32899; WAVE64-OPT-NEXT:    v_mov_b32_e32 v3, 42900; WAVE64-OPT-NEXT:    v_mov_b32_e32 v4, 17901; WAVE64-OPT-NEXT:    v_or3_b32 v31, v0, v1, v2902; WAVE64-OPT-NEXT:    s_mov_b32 s14, s10903; WAVE64-OPT-NEXT:    s_mov_b32 s17, stack_passed_argument@abs32@hi904; WAVE64-OPT-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo905; WAVE64-OPT-NEXT:    s_waitcnt lgkmcnt(0)906; WAVE64-OPT-NEXT:    s_add_u32 s20, s20, s11907; WAVE64-OPT-NEXT:    s_addc_u32 s21, s21, 0908; WAVE64-OPT-NEXT:    s_mov_b64 s[10:11], s[6:7]909; WAVE64-OPT-NEXT:    s_lshr_b32 s15, s4, 6910; WAVE64-OPT-NEXT:    s_mov_b64 s[4:5], s[0:1]911; WAVE64-OPT-NEXT:    s_mov_b64 s[6:7], s[2:3]912; WAVE64-OPT-NEXT:    s_mov_b64 s[0:1], s[20:21]913; WAVE64-OPT-NEXT:    s_mov_b64 s[2:3], s[22:23]914; WAVE64-OPT-NEXT:    buffer_store_dword v3, off, s[20:23], 0915; WAVE64-OPT-NEXT:    s_waitcnt_vscnt null, 0x0916; WAVE64-OPT-NEXT:    buffer_store_dword v4, off, s[20:23], s32 offset:4917; WAVE64-OPT-NEXT:    s_swappc_b64 s[30:31], s[16:17]918; WAVE64-OPT-NEXT:    ;;#ASMSTART919; WAVE64-OPT-NEXT:    ; use s15920; WAVE64-OPT-NEXT:    ;;#ASMEND921; WAVE64-OPT-NEXT:    s_endpgm922;923; WAVE32-O0-LABEL: kernel_stacksave_stackrestore_call_with_stack_objects:924; WAVE32-O0:       ; %bb.0:925; WAVE32-O0-NEXT:    s_mov_b32 s32, 0x1200926; WAVE32-O0-NEXT:    s_getpc_b64 s[20:21]927; WAVE32-O0-NEXT:    s_mov_b32 s20, s0928; WAVE32-O0-NEXT:    s_load_dwordx4 s[20:23], s[20:21], 0x0929; WAVE32-O0-NEXT:    s_waitcnt lgkmcnt(0)930; WAVE32-O0-NEXT:    s_bitset0_b32 s23, 21931; WAVE32-O0-NEXT:    s_add_u32 s20, s20, s11932; WAVE32-O0-NEXT:    s_addc_u32 s21, s21, 0933; WAVE32-O0-NEXT:    s_mov_b32 s14, s10934; WAVE32-O0-NEXT:    s_mov_b32 s13, s9935; WAVE32-O0-NEXT:    s_mov_b32 s12, s8936; WAVE32-O0-NEXT:    s_mov_b64 s[10:11], s[6:7]937; WAVE32-O0-NEXT:    s_mov_b64 s[8:9], s[4:5]938; WAVE32-O0-NEXT:    s_mov_b64 s[6:7], s[2:3]939; WAVE32-O0-NEXT:    s_mov_b64 s[4:5], s[0:1]940; WAVE32-O0-NEXT:    s_mov_b32 s0, s32941; WAVE32-O0-NEXT:    ; implicit-def: $vgpr32 : SGPR spill to VGPR lane942; WAVE32-O0-NEXT:    v_writelane_b32 v32, s0, 0943; WAVE32-O0-NEXT:    s_lshr_b32 s0, s0, 5944; WAVE32-O0-NEXT:    v_writelane_b32 v32, s0, 1945; WAVE32-O0-NEXT:    v_mov_b32_e32 v3, 42946; WAVE32-O0-NEXT:    buffer_store_dword v3, off, s[20:23], 0947; WAVE32-O0-NEXT:    s_waitcnt_vscnt null, 0x0948; WAVE32-O0-NEXT:    s_mov_b64 s[0:1], s[20:21]949; WAVE32-O0-NEXT:    s_mov_b64 s[2:3], s[22:23]950; WAVE32-O0-NEXT:    s_mov_b32 s15, s32951; WAVE32-O0-NEXT:    v_mov_b32_e32 v3, 17952; WAVE32-O0-NEXT:    buffer_store_dword v3, off, s[20:23], s15 offset:4953; WAVE32-O0-NEXT:    s_mov_b32 s15, stack_passed_argument@abs32@hi954; WAVE32-O0-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo955; WAVE32-O0-NEXT:    ; kill: def $sgpr16 killed $sgpr16 def $sgpr16_sgpr17956; WAVE32-O0-NEXT:    s_mov_b32 s17, s15957; WAVE32-O0-NEXT:    s_mov_b32 s15, 20958; WAVE32-O0-NEXT:    v_lshlrev_b32_e64 v2, s15, v2959; WAVE32-O0-NEXT:    s_mov_b32 s15, 10960; WAVE32-O0-NEXT:    v_lshlrev_b32_e64 v1, s15, v1961; WAVE32-O0-NEXT:    v_or3_b32 v31, v0, v1, v2962; WAVE32-O0-NEXT:    ; implicit-def: $sgpr15963; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18964; WAVE32-O0-NEXT:    v_mov_b32_e32 v0, s18965; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18966; WAVE32-O0-NEXT:    v_mov_b32_e32 v1, s18967; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18968; WAVE32-O0-NEXT:    v_mov_b32_e32 v2, s18969; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18970; WAVE32-O0-NEXT:    v_mov_b32_e32 v3, s18971; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18972; WAVE32-O0-NEXT:    v_mov_b32_e32 v4, s18973; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18974; WAVE32-O0-NEXT:    v_mov_b32_e32 v5, s18975; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18976; WAVE32-O0-NEXT:    v_mov_b32_e32 v6, s18977; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18978; WAVE32-O0-NEXT:    v_mov_b32_e32 v7, s18979; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18980; WAVE32-O0-NEXT:    v_mov_b32_e32 v8, s18981; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18982; WAVE32-O0-NEXT:    v_mov_b32_e32 v9, s18983; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18984; WAVE32-O0-NEXT:    v_mov_b32_e32 v10, s18985; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18986; WAVE32-O0-NEXT:    v_mov_b32_e32 v11, s18987; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18988; WAVE32-O0-NEXT:    v_mov_b32_e32 v12, s18989; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18990; WAVE32-O0-NEXT:    v_mov_b32_e32 v13, s18991; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18992; WAVE32-O0-NEXT:    v_mov_b32_e32 v14, s18993; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18994; WAVE32-O0-NEXT:    v_mov_b32_e32 v15, s18995; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18996; WAVE32-O0-NEXT:    v_mov_b32_e32 v16, s18997; WAVE32-O0-NEXT:    ; implicit-def: $sgpr18998; WAVE32-O0-NEXT:    v_mov_b32_e32 v17, s18999; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181000; WAVE32-O0-NEXT:    v_mov_b32_e32 v18, s181001; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181002; WAVE32-O0-NEXT:    v_mov_b32_e32 v19, s181003; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181004; WAVE32-O0-NEXT:    v_mov_b32_e32 v20, s181005; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181006; WAVE32-O0-NEXT:    v_mov_b32_e32 v21, s181007; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181008; WAVE32-O0-NEXT:    v_mov_b32_e32 v22, s181009; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181010; WAVE32-O0-NEXT:    v_mov_b32_e32 v23, s181011; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181012; WAVE32-O0-NEXT:    v_mov_b32_e32 v24, s181013; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181014; WAVE32-O0-NEXT:    v_mov_b32_e32 v25, s181015; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181016; WAVE32-O0-NEXT:    v_mov_b32_e32 v26, s181017; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181018; WAVE32-O0-NEXT:    v_mov_b32_e32 v27, s181019; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181020; WAVE32-O0-NEXT:    v_mov_b32_e32 v28, s181021; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181022; WAVE32-O0-NEXT:    v_mov_b32_e32 v29, s181023; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181024; WAVE32-O0-NEXT:    v_mov_b32_e32 v30, s181025; WAVE32-O0-NEXT:    s_swappc_b64 s[30:31], s[16:17]1026; WAVE32-O0-NEXT:    v_readlane_b32 s1, v32, 11027; WAVE32-O0-NEXT:    v_readlane_b32 s0, v32, 01028; WAVE32-O0-NEXT:    ;;#ASMSTART1029; WAVE32-O0-NEXT:    ; use s11030; WAVE32-O0-NEXT:    ;;#ASMEND1031; WAVE32-O0-NEXT:    s_mov_b32 s32, s01032; WAVE32-O0-NEXT:    s_endpgm1033;1034; WAVE64-O0-LABEL: kernel_stacksave_stackrestore_call_with_stack_objects:1035; WAVE64-O0:       ; %bb.0:1036; WAVE64-O0-NEXT:    s_mov_b32 s32, 0x24001037; WAVE64-O0-NEXT:    s_getpc_b64 s[24:25]1038; WAVE64-O0-NEXT:    s_mov_b32 s24, s01039; WAVE64-O0-NEXT:    s_load_dwordx4 s[24:27], s[24:25], 0x01040; WAVE64-O0-NEXT:    s_waitcnt lgkmcnt(0)1041; WAVE64-O0-NEXT:    s_add_u32 s24, s24, s111042; WAVE64-O0-NEXT:    s_addc_u32 s25, s25, 01043; WAVE64-O0-NEXT:    s_mov_b32 s14, s101044; WAVE64-O0-NEXT:    s_mov_b32 s13, s91045; WAVE64-O0-NEXT:    s_mov_b32 s12, s81046; WAVE64-O0-NEXT:    s_mov_b64 s[10:11], s[6:7]1047; WAVE64-O0-NEXT:    s_mov_b64 s[8:9], s[4:5]1048; WAVE64-O0-NEXT:    s_mov_b64 s[6:7], s[2:3]1049; WAVE64-O0-NEXT:    s_mov_b64 s[4:5], s[0:1]1050; WAVE64-O0-NEXT:    s_mov_b32 s0, s321051; WAVE64-O0-NEXT:    ; implicit-def: $vgpr32 : SGPR spill to VGPR lane1052; WAVE64-O0-NEXT:    v_writelane_b32 v32, s0, 01053; WAVE64-O0-NEXT:    s_lshr_b32 s0, s0, 61054; WAVE64-O0-NEXT:    v_writelane_b32 v32, s0, 11055; WAVE64-O0-NEXT:    v_mov_b32_e32 v3, 421056; WAVE64-O0-NEXT:    buffer_store_dword v3, off, s[24:27], 01057; WAVE64-O0-NEXT:    s_waitcnt_vscnt null, 0x01058; WAVE64-O0-NEXT:    s_mov_b64 s[0:1], s[24:25]1059; WAVE64-O0-NEXT:    s_mov_b64 s[2:3], s[26:27]1060; WAVE64-O0-NEXT:    s_mov_b32 s15, s321061; WAVE64-O0-NEXT:    v_mov_b32_e32 v3, 171062; WAVE64-O0-NEXT:    buffer_store_dword v3, off, s[24:27], s15 offset:41063; WAVE64-O0-NEXT:    s_mov_b32 s15, stack_passed_argument@abs32@hi1064; WAVE64-O0-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo1065; WAVE64-O0-NEXT:    ; kill: def $sgpr16 killed $sgpr16 def $sgpr16_sgpr171066; WAVE64-O0-NEXT:    s_mov_b32 s17, s151067; WAVE64-O0-NEXT:    s_mov_b32 s15, 201068; WAVE64-O0-NEXT:    v_lshlrev_b32_e64 v2, s15, v21069; WAVE64-O0-NEXT:    s_mov_b32 s15, 101070; WAVE64-O0-NEXT:    v_lshlrev_b32_e64 v1, s15, v11071; WAVE64-O0-NEXT:    v_or3_b32 v31, v0, v1, v21072; WAVE64-O0-NEXT:    ; implicit-def: $sgpr151073; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181074; WAVE64-O0-NEXT:    v_mov_b32_e32 v0, s181075; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181076; WAVE64-O0-NEXT:    v_mov_b32_e32 v1, s181077; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181078; WAVE64-O0-NEXT:    v_mov_b32_e32 v2, s181079; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181080; WAVE64-O0-NEXT:    v_mov_b32_e32 v3, s181081; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181082; WAVE64-O0-NEXT:    v_mov_b32_e32 v4, s181083; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181084; WAVE64-O0-NEXT:    v_mov_b32_e32 v5, s181085; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181086; WAVE64-O0-NEXT:    v_mov_b32_e32 v6, s181087; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181088; WAVE64-O0-NEXT:    v_mov_b32_e32 v7, s181089; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181090; WAVE64-O0-NEXT:    v_mov_b32_e32 v8, s181091; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181092; WAVE64-O0-NEXT:    v_mov_b32_e32 v9, s181093; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181094; WAVE64-O0-NEXT:    v_mov_b32_e32 v10, s181095; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181096; WAVE64-O0-NEXT:    v_mov_b32_e32 v11, s181097; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181098; WAVE64-O0-NEXT:    v_mov_b32_e32 v12, s181099; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181100; WAVE64-O0-NEXT:    v_mov_b32_e32 v13, s181101; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181102; WAVE64-O0-NEXT:    v_mov_b32_e32 v14, s181103; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181104; WAVE64-O0-NEXT:    v_mov_b32_e32 v15, s181105; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181106; WAVE64-O0-NEXT:    v_mov_b32_e32 v16, s181107; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181108; WAVE64-O0-NEXT:    v_mov_b32_e32 v17, s181109; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181110; WAVE64-O0-NEXT:    v_mov_b32_e32 v18, s181111; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181112; WAVE64-O0-NEXT:    v_mov_b32_e32 v19, s181113; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181114; WAVE64-O0-NEXT:    v_mov_b32_e32 v20, s181115; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181116; WAVE64-O0-NEXT:    v_mov_b32_e32 v21, s181117; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181118; WAVE64-O0-NEXT:    v_mov_b32_e32 v22, s181119; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181120; WAVE64-O0-NEXT:    v_mov_b32_e32 v23, s181121; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181122; WAVE64-O0-NEXT:    v_mov_b32_e32 v24, s181123; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181124; WAVE64-O0-NEXT:    v_mov_b32_e32 v25, s181125; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181126; WAVE64-O0-NEXT:    v_mov_b32_e32 v26, s181127; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181128; WAVE64-O0-NEXT:    v_mov_b32_e32 v27, s181129; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181130; WAVE64-O0-NEXT:    v_mov_b32_e32 v28, s181131; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181132; WAVE64-O0-NEXT:    v_mov_b32_e32 v29, s181133; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181134; WAVE64-O0-NEXT:    v_mov_b32_e32 v30, s181135; WAVE64-O0-NEXT:    s_swappc_b64 s[30:31], s[16:17]1136; WAVE64-O0-NEXT:    v_readlane_b32 s1, v32, 11137; WAVE64-O0-NEXT:    v_readlane_b32 s0, v32, 01138; WAVE64-O0-NEXT:    ;;#ASMSTART1139; WAVE64-O0-NEXT:    ; use s11140; WAVE64-O0-NEXT:    ;;#ASMEND1141; WAVE64-O0-NEXT:    s_mov_b32 s32, s01142; WAVE64-O0-NEXT:    s_endpgm1143;1144; WAVE32-WWM-PREALLOC-LABEL: kernel_stacksave_stackrestore_call_with_stack_objects:1145; WAVE32-WWM-PREALLOC:       ; %bb.0:1146; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, 0x12001147; WAVE32-WWM-PREALLOC-NEXT:    s_getpc_b64 s[20:21]1148; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s20, s01149; WAVE32-WWM-PREALLOC-NEXT:    s_load_dwordx4 s[20:23], s[20:21], 0x01150; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt lgkmcnt(0)1151; WAVE32-WWM-PREALLOC-NEXT:    s_bitset0_b32 s23, 211152; WAVE32-WWM-PREALLOC-NEXT:    s_add_u32 s20, s20, s111153; WAVE32-WWM-PREALLOC-NEXT:    s_addc_u32 s21, s21, 01154; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s14, s101155; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s13, s91156; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s12, s81157; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[10:11], s[6:7]1158; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[8:9], s[4:5]1159; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[6:7], s[2:3]1160; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[4:5], s[0:1]1161; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s0, s321162; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $vgpr32 : SGPR spill to VGPR lane1163; WAVE32-WWM-PREALLOC-NEXT:    v_writelane_b32 v32, s0, 01164; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s0, s0, 51165; WAVE32-WWM-PREALLOC-NEXT:    v_writelane_b32 v32, s0, 11166; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v3, 421167; WAVE32-WWM-PREALLOC-NEXT:    buffer_store_dword v3, off, s[20:23], 01168; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt_vscnt null, 0x01169; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[0:1], s[20:21]1170; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[2:3], s[22:23]1171; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s15, s321172; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v3, 171173; WAVE32-WWM-PREALLOC-NEXT:    buffer_store_dword v3, off, s[20:23], s15 offset:41174; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s15, stack_passed_argument@abs32@hi1175; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo1176; WAVE32-WWM-PREALLOC-NEXT:    ; kill: def $sgpr16 killed $sgpr16 def $sgpr16_sgpr171177; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s17, s151178; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s15, 201179; WAVE32-WWM-PREALLOC-NEXT:    v_lshlrev_b32_e64 v2, s15, v21180; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s15, 101181; WAVE32-WWM-PREALLOC-NEXT:    v_lshlrev_b32_e64 v1, s15, v11182; WAVE32-WWM-PREALLOC-NEXT:    v_or3_b32 v31, v0, v1, v21183; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr151184; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181185; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v0, s181186; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181187; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v1, s181188; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181189; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v2, s181190; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181191; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v3, s181192; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181193; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v4, s181194; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181195; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v5, s181196; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181197; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v6, s181198; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181199; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v7, s181200; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181201; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v8, s181202; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181203; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v9, s181204; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181205; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v10, s181206; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181207; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v11, s181208; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181209; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v12, s181210; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181211; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v13, s181212; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181213; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v14, s181214; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181215; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v15, s181216; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181217; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v16, s181218; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181219; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v17, s181220; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181221; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v18, s181222; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181223; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v19, s181224; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181225; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v20, s181226; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181227; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v21, s181228; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181229; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v22, s181230; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181231; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v23, s181232; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181233; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v24, s181234; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181235; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v25, s181236; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181237; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v26, s181238; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181239; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v27, s181240; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181241; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v28, s181242; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181243; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v29, s181244; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181245; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v30, s181246; WAVE32-WWM-PREALLOC-NEXT:    s_swappc_b64 s[30:31], s[16:17]1247; WAVE32-WWM-PREALLOC-NEXT:    v_readlane_b32 s1, v32, 11248; WAVE32-WWM-PREALLOC-NEXT:    v_readlane_b32 s0, v32, 01249; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMSTART1250; WAVE32-WWM-PREALLOC-NEXT:    ; use s11251; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMEND1252; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s01253; WAVE32-WWM-PREALLOC-NEXT:    s_endpgm1254  %alloca = alloca [32 x i32], addrspace(5)1255  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()1256  store volatile i32 42, ptr addrspace(5) %alloca1257  call void @stack_passed_argument([32 x i32] poison, i32 17)1258  call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %stacksave)1259  call void @llvm.stackrestore.p5(ptr addrspace(5) %stacksave)1260  ret void1261}1262 1263define void @func_stacksave_stackrestore_call_with_stack_objects() {1264; WAVE32-OPT-LABEL: func_stacksave_stackrestore_call_with_stack_objects:1265; WAVE32-OPT:       ; %bb.0:1266; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1267; WAVE32-OPT-NEXT:    s_mov_b32 s20, s331268; WAVE32-OPT-NEXT:    s_mov_b32 s33, s321269; WAVE32-OPT-NEXT:    s_xor_saveexec_b32 s16, -11270; WAVE32-OPT-NEXT:    buffer_store_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Spill1271; WAVE32-OPT-NEXT:    s_mov_b32 exec_lo, s161272; WAVE32-OPT-NEXT:    v_writelane_b32 v32, s30, 01273; WAVE32-OPT-NEXT:    v_mov_b32_e32 v0, 421274; WAVE32-OPT-NEXT:    v_mov_b32_e32 v1, 171275; WAVE32-OPT-NEXT:    s_addk_i32 s32, 0x12001276; WAVE32-OPT-NEXT:    s_mov_b32 s17, stack_passed_argument@abs32@hi1277; WAVE32-OPT-NEXT:    s_mov_b32 s18, s321278; WAVE32-OPT-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo1279; WAVE32-OPT-NEXT:    v_writelane_b32 v32, s31, 11280; WAVE32-OPT-NEXT:    s_lshr_b32 s19, s18, 51281; WAVE32-OPT-NEXT:    buffer_store_dword v0, off, s[0:3], s331282; WAVE32-OPT-NEXT:    s_waitcnt_vscnt null, 0x01283; WAVE32-OPT-NEXT:    buffer_store_dword v1, off, s[0:3], s32 offset:41284; WAVE32-OPT-NEXT:    s_swappc_b64 s[30:31], s[16:17]1285; WAVE32-OPT-NEXT:    s_mov_b32 s32, s181286; WAVE32-OPT-NEXT:    ;;#ASMSTART1287; WAVE32-OPT-NEXT:    ; use s191288; WAVE32-OPT-NEXT:    ;;#ASMEND1289; WAVE32-OPT-NEXT:    v_readlane_b32 s31, v32, 11290; WAVE32-OPT-NEXT:    v_readlane_b32 s30, v32, 01291; WAVE32-OPT-NEXT:    s_mov_b32 s32, s331292; WAVE32-OPT-NEXT:    s_xor_saveexec_b32 s4, -11293; WAVE32-OPT-NEXT:    buffer_load_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Reload1294; WAVE32-OPT-NEXT:    s_mov_b32 exec_lo, s41295; WAVE32-OPT-NEXT:    s_mov_b32 s33, s201296; WAVE32-OPT-NEXT:    s_waitcnt vmcnt(0)1297; WAVE32-OPT-NEXT:    s_setpc_b64 s[30:31]1298;1299; WAVE64-OPT-LABEL: func_stacksave_stackrestore_call_with_stack_objects:1300; WAVE64-OPT:       ; %bb.0:1301; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1302; WAVE64-OPT-NEXT:    s_mov_b32 s20, s331303; WAVE64-OPT-NEXT:    s_mov_b32 s33, s321304; WAVE64-OPT-NEXT:    s_xor_saveexec_b64 s[16:17], -11305; WAVE64-OPT-NEXT:    buffer_store_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Spill1306; WAVE64-OPT-NEXT:    s_mov_b64 exec, s[16:17]1307; WAVE64-OPT-NEXT:    v_writelane_b32 v32, s30, 01308; WAVE64-OPT-NEXT:    v_mov_b32_e32 v0, 421309; WAVE64-OPT-NEXT:    v_mov_b32_e32 v1, 171310; WAVE64-OPT-NEXT:    s_addk_i32 s32, 0x24001311; WAVE64-OPT-NEXT:    s_mov_b32 s17, stack_passed_argument@abs32@hi1312; WAVE64-OPT-NEXT:    s_mov_b32 s18, s321313; WAVE64-OPT-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo1314; WAVE64-OPT-NEXT:    v_writelane_b32 v32, s31, 11315; WAVE64-OPT-NEXT:    s_lshr_b32 s19, s18, 61316; WAVE64-OPT-NEXT:    buffer_store_dword v0, off, s[0:3], s331317; WAVE64-OPT-NEXT:    s_waitcnt_vscnt null, 0x01318; WAVE64-OPT-NEXT:    buffer_store_dword v1, off, s[0:3], s32 offset:41319; WAVE64-OPT-NEXT:    s_swappc_b64 s[30:31], s[16:17]1320; WAVE64-OPT-NEXT:    s_mov_b32 s32, s181321; WAVE64-OPT-NEXT:    ;;#ASMSTART1322; WAVE64-OPT-NEXT:    ; use s191323; WAVE64-OPT-NEXT:    ;;#ASMEND1324; WAVE64-OPT-NEXT:    v_readlane_b32 s31, v32, 11325; WAVE64-OPT-NEXT:    v_readlane_b32 s30, v32, 01326; WAVE64-OPT-NEXT:    s_mov_b32 s32, s331327; WAVE64-OPT-NEXT:    s_xor_saveexec_b64 s[4:5], -11328; WAVE64-OPT-NEXT:    buffer_load_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Reload1329; WAVE64-OPT-NEXT:    s_mov_b64 exec, s[4:5]1330; WAVE64-OPT-NEXT:    s_mov_b32 s33, s201331; WAVE64-OPT-NEXT:    s_waitcnt vmcnt(0)1332; WAVE64-OPT-NEXT:    s_setpc_b64 s[30:31]1333;1334; WAVE32-O0-LABEL: func_stacksave_stackrestore_call_with_stack_objects:1335; WAVE32-O0:       ; %bb.0:1336; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1337; WAVE32-O0-NEXT:    s_mov_b32 s24, s331338; WAVE32-O0-NEXT:    s_mov_b32 s33, s321339; WAVE32-O0-NEXT:    s_xor_saveexec_b32 s16, -11340; WAVE32-O0-NEXT:    buffer_store_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Spill1341; WAVE32-O0-NEXT:    buffer_store_dword v33, off, s[0:3], s33 offset:132 ; 4-byte Folded Spill1342; WAVE32-O0-NEXT:    s_mov_b32 exec_lo, s161343; WAVE32-O0-NEXT:    s_add_i32 s32, s32, 0x12001344; WAVE32-O0-NEXT:    v_writelane_b32 v32, s30, 01345; WAVE32-O0-NEXT:    v_writelane_b32 v32, s31, 11346; WAVE32-O0-NEXT:    s_mov_b32 s16, s321347; WAVE32-O0-NEXT:    ; implicit-def: $vgpr33 : SGPR spill to VGPR lane1348; WAVE32-O0-NEXT:    v_writelane_b32 v33, s16, 01349; WAVE32-O0-NEXT:    s_lshr_b32 s16, s16, 51350; WAVE32-O0-NEXT:    v_writelane_b32 v33, s16, 11351; WAVE32-O0-NEXT:    v_mov_b32_e32 v0, 421352; WAVE32-O0-NEXT:    buffer_store_dword v0, off, s[0:3], s331353; WAVE32-O0-NEXT:    s_waitcnt_vscnt null, 0x01354; WAVE32-O0-NEXT:    s_mov_b64 s[22:23], s[2:3]1355; WAVE32-O0-NEXT:    s_mov_b64 s[20:21], s[0:1]1356; WAVE32-O0-NEXT:    s_mov_b32 s16, s321357; WAVE32-O0-NEXT:    v_mov_b32_e32 v0, 171358; WAVE32-O0-NEXT:    buffer_store_dword v0, off, s[0:3], s16 offset:41359; WAVE32-O0-NEXT:    s_mov_b32 s18, stack_passed_argument@abs32@hi1360; WAVE32-O0-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo1361; WAVE32-O0-NEXT:    ; kill: def $sgpr16 killed $sgpr16 def $sgpr16_sgpr171362; WAVE32-O0-NEXT:    s_mov_b32 s17, s181363; WAVE32-O0-NEXT:    s_mov_b64 s[0:1], s[20:21]1364; WAVE32-O0-NEXT:    s_mov_b64 s[2:3], s[22:23]1365; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181366; WAVE32-O0-NEXT:    v_mov_b32_e32 v0, s181367; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181368; WAVE32-O0-NEXT:    v_mov_b32_e32 v1, s181369; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181370; WAVE32-O0-NEXT:    v_mov_b32_e32 v2, s181371; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181372; WAVE32-O0-NEXT:    v_mov_b32_e32 v3, s181373; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181374; WAVE32-O0-NEXT:    v_mov_b32_e32 v4, s181375; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181376; WAVE32-O0-NEXT:    v_mov_b32_e32 v5, s181377; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181378; WAVE32-O0-NEXT:    v_mov_b32_e32 v6, s181379; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181380; WAVE32-O0-NEXT:    v_mov_b32_e32 v7, s181381; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181382; WAVE32-O0-NEXT:    v_mov_b32_e32 v8, s181383; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181384; WAVE32-O0-NEXT:    v_mov_b32_e32 v9, s181385; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181386; WAVE32-O0-NEXT:    v_mov_b32_e32 v10, s181387; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181388; WAVE32-O0-NEXT:    v_mov_b32_e32 v11, s181389; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181390; WAVE32-O0-NEXT:    v_mov_b32_e32 v12, s181391; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181392; WAVE32-O0-NEXT:    v_mov_b32_e32 v13, s181393; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181394; WAVE32-O0-NEXT:    v_mov_b32_e32 v14, s181395; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181396; WAVE32-O0-NEXT:    v_mov_b32_e32 v15, s181397; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181398; WAVE32-O0-NEXT:    v_mov_b32_e32 v16, s181399; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181400; WAVE32-O0-NEXT:    v_mov_b32_e32 v17, s181401; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181402; WAVE32-O0-NEXT:    v_mov_b32_e32 v18, s181403; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181404; WAVE32-O0-NEXT:    v_mov_b32_e32 v19, s181405; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181406; WAVE32-O0-NEXT:    v_mov_b32_e32 v20, s181407; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181408; WAVE32-O0-NEXT:    v_mov_b32_e32 v21, s181409; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181410; WAVE32-O0-NEXT:    v_mov_b32_e32 v22, s181411; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181412; WAVE32-O0-NEXT:    v_mov_b32_e32 v23, s181413; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181414; WAVE32-O0-NEXT:    v_mov_b32_e32 v24, s181415; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181416; WAVE32-O0-NEXT:    v_mov_b32_e32 v25, s181417; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181418; WAVE32-O0-NEXT:    v_mov_b32_e32 v26, s181419; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181420; WAVE32-O0-NEXT:    v_mov_b32_e32 v27, s181421; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181422; WAVE32-O0-NEXT:    v_mov_b32_e32 v28, s181423; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181424; WAVE32-O0-NEXT:    v_mov_b32_e32 v29, s181425; WAVE32-O0-NEXT:    ; implicit-def: $sgpr181426; WAVE32-O0-NEXT:    v_mov_b32_e32 v30, s181427; WAVE32-O0-NEXT:    s_swappc_b64 s[30:31], s[16:17]1428; WAVE32-O0-NEXT:    v_readlane_b32 s5, v33, 11429; WAVE32-O0-NEXT:    v_readlane_b32 s4, v33, 01430; WAVE32-O0-NEXT:    ;;#ASMSTART1431; WAVE32-O0-NEXT:    ; use s51432; WAVE32-O0-NEXT:    ;;#ASMEND1433; WAVE32-O0-NEXT:    s_mov_b32 s32, s41434; WAVE32-O0-NEXT:    v_readlane_b32 s31, v32, 11435; WAVE32-O0-NEXT:    v_readlane_b32 s30, v32, 01436; WAVE32-O0-NEXT:    s_mov_b32 s32, s331437; WAVE32-O0-NEXT:    s_xor_saveexec_b32 s4, -11438; WAVE32-O0-NEXT:    buffer_load_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Reload1439; WAVE32-O0-NEXT:    buffer_load_dword v33, off, s[0:3], s33 offset:132 ; 4-byte Folded Reload1440; WAVE32-O0-NEXT:    s_mov_b32 exec_lo, s41441; WAVE32-O0-NEXT:    s_mov_b32 s33, s241442; WAVE32-O0-NEXT:    s_waitcnt vmcnt(0)1443; WAVE32-O0-NEXT:    s_setpc_b64 s[30:31]1444;1445; WAVE64-O0-LABEL: func_stacksave_stackrestore_call_with_stack_objects:1446; WAVE64-O0:       ; %bb.0:1447; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1448; WAVE64-O0-NEXT:    s_mov_b32 s19, s331449; WAVE64-O0-NEXT:    s_mov_b32 s33, s321450; WAVE64-O0-NEXT:    s_xor_saveexec_b64 s[16:17], -11451; WAVE64-O0-NEXT:    buffer_store_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Spill1452; WAVE64-O0-NEXT:    buffer_store_dword v33, off, s[0:3], s33 offset:132 ; 4-byte Folded Spill1453; WAVE64-O0-NEXT:    s_mov_b64 exec, s[16:17]1454; WAVE64-O0-NEXT:    s_add_i32 s32, s32, 0x24001455; WAVE64-O0-NEXT:    v_writelane_b32 v32, s30, 01456; WAVE64-O0-NEXT:    v_writelane_b32 v32, s31, 11457; WAVE64-O0-NEXT:    s_mov_b32 s16, s321458; WAVE64-O0-NEXT:    ; implicit-def: $vgpr33 : SGPR spill to VGPR lane1459; WAVE64-O0-NEXT:    v_writelane_b32 v33, s16, 01460; WAVE64-O0-NEXT:    s_lshr_b32 s16, s16, 61461; WAVE64-O0-NEXT:    v_writelane_b32 v33, s16, 11462; WAVE64-O0-NEXT:    v_mov_b32_e32 v0, 421463; WAVE64-O0-NEXT:    buffer_store_dword v0, off, s[0:3], s331464; WAVE64-O0-NEXT:    s_waitcnt_vscnt null, 0x01465; WAVE64-O0-NEXT:    s_mov_b64 s[22:23], s[2:3]1466; WAVE64-O0-NEXT:    s_mov_b64 s[20:21], s[0:1]1467; WAVE64-O0-NEXT:    s_mov_b32 s16, s321468; WAVE64-O0-NEXT:    v_mov_b32_e32 v0, 171469; WAVE64-O0-NEXT:    buffer_store_dword v0, off, s[0:3], s16 offset:41470; WAVE64-O0-NEXT:    s_mov_b32 s18, stack_passed_argument@abs32@hi1471; WAVE64-O0-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo1472; WAVE64-O0-NEXT:    ; kill: def $sgpr16 killed $sgpr16 def $sgpr16_sgpr171473; WAVE64-O0-NEXT:    s_mov_b32 s17, s181474; WAVE64-O0-NEXT:    s_mov_b64 s[0:1], s[20:21]1475; WAVE64-O0-NEXT:    s_mov_b64 s[2:3], s[22:23]1476; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181477; WAVE64-O0-NEXT:    v_mov_b32_e32 v0, s181478; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181479; WAVE64-O0-NEXT:    v_mov_b32_e32 v1, s181480; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181481; WAVE64-O0-NEXT:    v_mov_b32_e32 v2, s181482; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181483; WAVE64-O0-NEXT:    v_mov_b32_e32 v3, s181484; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181485; WAVE64-O0-NEXT:    v_mov_b32_e32 v4, s181486; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181487; WAVE64-O0-NEXT:    v_mov_b32_e32 v5, s181488; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181489; WAVE64-O0-NEXT:    v_mov_b32_e32 v6, s181490; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181491; WAVE64-O0-NEXT:    v_mov_b32_e32 v7, s181492; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181493; WAVE64-O0-NEXT:    v_mov_b32_e32 v8, s181494; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181495; WAVE64-O0-NEXT:    v_mov_b32_e32 v9, s181496; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181497; WAVE64-O0-NEXT:    v_mov_b32_e32 v10, s181498; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181499; WAVE64-O0-NEXT:    v_mov_b32_e32 v11, s181500; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181501; WAVE64-O0-NEXT:    v_mov_b32_e32 v12, s181502; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181503; WAVE64-O0-NEXT:    v_mov_b32_e32 v13, s181504; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181505; WAVE64-O0-NEXT:    v_mov_b32_e32 v14, s181506; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181507; WAVE64-O0-NEXT:    v_mov_b32_e32 v15, s181508; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181509; WAVE64-O0-NEXT:    v_mov_b32_e32 v16, s181510; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181511; WAVE64-O0-NEXT:    v_mov_b32_e32 v17, s181512; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181513; WAVE64-O0-NEXT:    v_mov_b32_e32 v18, s181514; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181515; WAVE64-O0-NEXT:    v_mov_b32_e32 v19, s181516; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181517; WAVE64-O0-NEXT:    v_mov_b32_e32 v20, s181518; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181519; WAVE64-O0-NEXT:    v_mov_b32_e32 v21, s181520; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181521; WAVE64-O0-NEXT:    v_mov_b32_e32 v22, s181522; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181523; WAVE64-O0-NEXT:    v_mov_b32_e32 v23, s181524; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181525; WAVE64-O0-NEXT:    v_mov_b32_e32 v24, s181526; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181527; WAVE64-O0-NEXT:    v_mov_b32_e32 v25, s181528; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181529; WAVE64-O0-NEXT:    v_mov_b32_e32 v26, s181530; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181531; WAVE64-O0-NEXT:    v_mov_b32_e32 v27, s181532; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181533; WAVE64-O0-NEXT:    v_mov_b32_e32 v28, s181534; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181535; WAVE64-O0-NEXT:    v_mov_b32_e32 v29, s181536; WAVE64-O0-NEXT:    ; implicit-def: $sgpr181537; WAVE64-O0-NEXT:    v_mov_b32_e32 v30, s181538; WAVE64-O0-NEXT:    s_swappc_b64 s[30:31], s[16:17]1539; WAVE64-O0-NEXT:    v_readlane_b32 s5, v33, 11540; WAVE64-O0-NEXT:    v_readlane_b32 s4, v33, 01541; WAVE64-O0-NEXT:    ;;#ASMSTART1542; WAVE64-O0-NEXT:    ; use s51543; WAVE64-O0-NEXT:    ;;#ASMEND1544; WAVE64-O0-NEXT:    s_mov_b32 s32, s41545; WAVE64-O0-NEXT:    v_readlane_b32 s31, v32, 11546; WAVE64-O0-NEXT:    v_readlane_b32 s30, v32, 01547; WAVE64-O0-NEXT:    s_mov_b32 s32, s331548; WAVE64-O0-NEXT:    s_xor_saveexec_b64 s[4:5], -11549; WAVE64-O0-NEXT:    buffer_load_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Reload1550; WAVE64-O0-NEXT:    buffer_load_dword v33, off, s[0:3], s33 offset:132 ; 4-byte Folded Reload1551; WAVE64-O0-NEXT:    s_mov_b64 exec, s[4:5]1552; WAVE64-O0-NEXT:    s_mov_b32 s33, s191553; WAVE64-O0-NEXT:    s_waitcnt vmcnt(0)1554; WAVE64-O0-NEXT:    s_setpc_b64 s[30:31]1555;1556; WAVE32-WWM-PREALLOC-LABEL: func_stacksave_stackrestore_call_with_stack_objects:1557; WAVE32-WWM-PREALLOC:       ; %bb.0:1558; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1559; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s24, s331560; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s33, s321561; WAVE32-WWM-PREALLOC-NEXT:    s_xor_saveexec_b32 s16, -11562; WAVE32-WWM-PREALLOC-NEXT:    buffer_store_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Spill1563; WAVE32-WWM-PREALLOC-NEXT:    buffer_store_dword v33, off, s[0:3], s33 offset:132 ; 4-byte Folded Spill1564; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 exec_lo, s161565; WAVE32-WWM-PREALLOC-NEXT:    s_add_i32 s32, s32, 0x12001566; WAVE32-WWM-PREALLOC-NEXT:    v_writelane_b32 v33, s30, 01567; WAVE32-WWM-PREALLOC-NEXT:    v_writelane_b32 v33, s31, 11568; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s16, s321569; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $vgpr32 : SGPR spill to VGPR lane1570; WAVE32-WWM-PREALLOC-NEXT:    v_writelane_b32 v32, s16, 01571; WAVE32-WWM-PREALLOC-NEXT:    s_lshr_b32 s16, s16, 51572; WAVE32-WWM-PREALLOC-NEXT:    v_writelane_b32 v32, s16, 11573; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v0, 421574; WAVE32-WWM-PREALLOC-NEXT:    buffer_store_dword v0, off, s[0:3], s331575; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt_vscnt null, 0x01576; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[22:23], s[2:3]1577; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[20:21], s[0:1]1578; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s16, s321579; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v0, 171580; WAVE32-WWM-PREALLOC-NEXT:    buffer_store_dword v0, off, s[0:3], s16 offset:41581; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s18, stack_passed_argument@abs32@hi1582; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s16, stack_passed_argument@abs32@lo1583; WAVE32-WWM-PREALLOC-NEXT:    ; kill: def $sgpr16 killed $sgpr16 def $sgpr16_sgpr171584; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s17, s181585; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[0:1], s[20:21]1586; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b64 s[2:3], s[22:23]1587; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181588; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v0, s181589; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181590; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v1, s181591; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181592; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v2, s181593; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181594; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v3, s181595; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181596; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v4, s181597; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181598; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v5, s181599; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181600; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v6, s181601; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181602; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v7, s181603; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181604; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v8, s181605; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181606; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v9, s181607; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181608; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v10, s181609; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181610; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v11, s181611; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181612; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v12, s181613; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181614; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v13, s181615; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181616; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v14, s181617; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181618; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v15, s181619; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181620; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v16, s181621; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181622; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v17, s181623; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181624; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v18, s181625; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181626; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v19, s181627; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181628; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v20, s181629; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181630; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v21, s181631; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181632; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v22, s181633; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181634; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v23, s181635; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181636; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v24, s181637; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181638; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v25, s181639; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181640; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v26, s181641; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181642; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v27, s181643; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181644; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v28, s181645; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181646; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v29, s181647; WAVE32-WWM-PREALLOC-NEXT:    ; implicit-def: $sgpr181648; WAVE32-WWM-PREALLOC-NEXT:    v_mov_b32_e32 v30, s181649; WAVE32-WWM-PREALLOC-NEXT:    s_swappc_b64 s[30:31], s[16:17]1650; WAVE32-WWM-PREALLOC-NEXT:    v_readlane_b32 s5, v32, 11651; WAVE32-WWM-PREALLOC-NEXT:    v_readlane_b32 s4, v32, 01652; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMSTART1653; WAVE32-WWM-PREALLOC-NEXT:    ; use s51654; WAVE32-WWM-PREALLOC-NEXT:    ;;#ASMEND1655; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s41656; WAVE32-WWM-PREALLOC-NEXT:    v_readlane_b32 s31, v33, 11657; WAVE32-WWM-PREALLOC-NEXT:    v_readlane_b32 s30, v33, 01658; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s32, s331659; WAVE32-WWM-PREALLOC-NEXT:    s_xor_saveexec_b32 s4, -11660; WAVE32-WWM-PREALLOC-NEXT:    buffer_load_dword v32, off, s[0:3], s33 offset:128 ; 4-byte Folded Reload1661; WAVE32-WWM-PREALLOC-NEXT:    buffer_load_dword v33, off, s[0:3], s33 offset:132 ; 4-byte Folded Reload1662; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 exec_lo, s41663; WAVE32-WWM-PREALLOC-NEXT:    s_mov_b32 s33, s241664; WAVE32-WWM-PREALLOC-NEXT:    s_waitcnt vmcnt(0)1665; WAVE32-WWM-PREALLOC-NEXT:    s_setpc_b64 s[30:31]1666  %alloca = alloca [32 x i32], addrspace(5)1667  %stacksave = call ptr addrspace(5) @llvm.stacksave.p5()1668  store volatile i32 42, ptr addrspace(5) %alloca1669  call void @stack_passed_argument([32 x i32] poison, i32 17)1670  call void asm sideeffect "; use $0", "s"(ptr addrspace(5) %stacksave)1671  call void @llvm.stackrestore.p5(ptr addrspace(5) %stacksave)1672  ret void1673}1674 1675 1676;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:1677; WAVE32: {{.*}}1678; WAVE64: {{.*}}1679