1399 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn -mcpu=tahiti -amdgpu-remove-redundant-endcf -amdgpu-codegenprepare-break-large-phis=0 < %s | FileCheck -enable-var-scope -check-prefix=GCN %s3 4; Disabled endcf collapse at -O0.5; RUN: llc -mtriple=amdgcn -mcpu=tahiti -O0 -amdgpu-remove-redundant-endcf -amdgpu-codegenprepare-break-large-phis=0 < %s | FileCheck -enable-var-scope -check-prefix=GCN-O0 %s6 7; Note: Breaking large PHIs is disabled to branches from being eliminated (in scc_liveness)8 9define amdgpu_kernel void @simple_nested_if(ptr addrspace(1) nocapture %arg) {10; GCN-LABEL: simple_nested_if:11; GCN: ; %bb.0: ; %bb12; GCN-NEXT: v_cmp_lt_u32_e32 vcc, 1, v013; GCN-NEXT: s_and_saveexec_b64 s[6:7], vcc14; GCN-NEXT: s_cbranch_execz .LBB0_315; GCN-NEXT: ; %bb.1: ; %bb.outer.then16; GCN-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x917; GCN-NEXT: v_lshlrev_b32_e32 v1, 2, v018; GCN-NEXT: v_mov_b32_e32 v2, 019; GCN-NEXT: s_mov_b32 s3, 0xf00020; GCN-NEXT: s_mov_b32 s2, 021; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 2, v022; GCN-NEXT: s_waitcnt lgkmcnt(0)23; GCN-NEXT: buffer_store_dword v2, v[1:2], s[0:3], 0 addr6424; GCN-NEXT: s_and_b64 exec, exec, vcc25; GCN-NEXT: s_cbranch_execz .LBB0_326; GCN-NEXT: ; %bb.2: ; %bb.inner.then27; GCN-NEXT: s_waitcnt expcnt(0)28; GCN-NEXT: v_mov_b32_e32 v2, s129; GCN-NEXT: v_add_i32_e32 v0, vcc, s0, v130; GCN-NEXT: v_addc_u32_e32 v1, vcc, 0, v2, vcc31; GCN-NEXT: s_mov_b32 s0, s232; GCN-NEXT: s_mov_b32 s1, s233; GCN-NEXT: v_mov_b32_e32 v2, 134; GCN-NEXT: buffer_store_dword v2, v[0:1], s[0:3], 0 addr64 offset:435; GCN-NEXT: .LBB0_3: ; %bb.outer.end36; GCN-NEXT: s_or_b64 exec, exec, s[6:7]37; GCN-NEXT: v_mov_b32_e32 v0, 338; GCN-NEXT: v_mov_b32_e32 v1, 039; GCN-NEXT: s_mov_b32 m0, -140; GCN-NEXT: ds_write_b32 v1, v041; GCN-NEXT: s_endpgm42;43; GCN-O0-LABEL: simple_nested_if:44; GCN-O0: ; %bb.0: ; %bb45; GCN-O0-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD046; GCN-O0-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD147; GCN-O0-NEXT: s_mov_b32 s14, -148; GCN-O0-NEXT: s_mov_b32 s15, 0xe8f00049; GCN-O0-NEXT: s_add_u32 s12, s12, s1150; GCN-O0-NEXT: s_addc_u32 s13, s13, 051; GCN-O0-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x952; GCN-O0-NEXT: ; implicit-def: $vgpr4 : SGPR spill to VGPR lane53; GCN-O0-NEXT: s_waitcnt lgkmcnt(0)54; GCN-O0-NEXT: v_writelane_b32 v4, s0, 055; GCN-O0-NEXT: v_writelane_b32 v4, s1, 156; GCN-O0-NEXT: v_mov_b32_e32 v1, v057; GCN-O0-NEXT: buffer_store_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Spill58; GCN-O0-NEXT: s_mov_b32 s0, 159; GCN-O0-NEXT: v_cmp_gt_u32_e64 s[2:3], v0, s060; GCN-O0-NEXT: s_mov_b64 s[0:1], exec61; GCN-O0-NEXT: v_writelane_b32 v4, s0, 262; GCN-O0-NEXT: v_writelane_b32 v4, s1, 363; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -164; GCN-O0-NEXT: buffer_store_dword v4, off, s[12:15], 0 ; 4-byte Folded Spill65; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]66; GCN-O0-NEXT: s_and_b64 s[0:1], s[0:1], s[2:3]67; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]68; GCN-O0-NEXT: s_cbranch_execz .LBB0_469; GCN-O0-NEXT: ; %bb.1: ; %bb.outer.then70; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -171; GCN-O0-NEXT: s_waitcnt expcnt(0)72; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload73; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]74; GCN-O0-NEXT: s_waitcnt vmcnt(0)75; GCN-O0-NEXT: v_readlane_b32 s4, v4, 076; GCN-O0-NEXT: v_readlane_b32 s5, v4, 177; GCN-O0-NEXT: buffer_load_dword v0, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload78; GCN-O0-NEXT: s_mov_b32 s2, 0xf00079; GCN-O0-NEXT: s_mov_b32 s0, 080; GCN-O0-NEXT: ; kill: def $sgpr0 killed $sgpr0 def $sgpr0_sgpr181; GCN-O0-NEXT: s_mov_b32 s1, s282; GCN-O0-NEXT: ; kill: def $sgpr4_sgpr5 killed $sgpr4_sgpr5 def $sgpr4_sgpr5_sgpr6_sgpr783; GCN-O0-NEXT: s_mov_b64 s[6:7], s[0:1]84; GCN-O0-NEXT: s_waitcnt vmcnt(0)85; GCN-O0-NEXT: v_ashrrev_i32_e64 v3, 31, v086; GCN-O0-NEXT: v_mov_b32_e32 v1, v087; GCN-O0-NEXT: v_mov_b32_e32 v2, v388; GCN-O0-NEXT: s_mov_b32 s0, 289; GCN-O0-NEXT: v_lshl_b64 v[2:3], v[1:2], s090; GCN-O0-NEXT: v_mov_b32_e32 v1, 091; GCN-O0-NEXT: buffer_store_dword v1, v[2:3], s[4:7], 0 addr6492; GCN-O0-NEXT: v_cmp_ne_u32_e64 s[2:3], v0, s093; GCN-O0-NEXT: s_mov_b64 s[0:1], exec94; GCN-O0-NEXT: v_writelane_b32 v4, s0, 495; GCN-O0-NEXT: v_writelane_b32 v4, s1, 596; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -197; GCN-O0-NEXT: buffer_store_dword v4, off, s[12:15], 0 ; 4-byte Folded Spill98; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]99; GCN-O0-NEXT: s_and_b64 s[0:1], s[0:1], s[2:3]100; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]101; GCN-O0-NEXT: s_cbranch_execz .LBB0_3102; GCN-O0-NEXT: ; %bb.2: ; %bb.inner.then103; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1104; GCN-O0-NEXT: s_waitcnt expcnt(0)105; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload106; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]107; GCN-O0-NEXT: s_waitcnt vmcnt(0)108; GCN-O0-NEXT: v_readlane_b32 s0, v4, 0109; GCN-O0-NEXT: v_readlane_b32 s1, v4, 1110; GCN-O0-NEXT: buffer_load_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload111; GCN-O0-NEXT: v_mov_b32_e32 v0, 1112; GCN-O0-NEXT: s_waitcnt vmcnt(0)113; GCN-O0-NEXT: v_add_i32_e64 v1, s[2:3], v1, v0114; GCN-O0-NEXT: v_ashrrev_i32_e64 v3, 31, v1115; GCN-O0-NEXT: ; kill: def $vgpr1 killed $vgpr1 def $vgpr1_vgpr2 killed $exec116; GCN-O0-NEXT: v_mov_b32_e32 v2, v3117; GCN-O0-NEXT: s_mov_b32 s2, 2118; GCN-O0-NEXT: v_lshl_b64 v[1:2], v[1:2], s2119; GCN-O0-NEXT: s_mov_b32 s2, 0xf000120; GCN-O0-NEXT: s_mov_b32 s4, 0121; GCN-O0-NEXT: ; kill: def $sgpr4 killed $sgpr4 def $sgpr4_sgpr5122; GCN-O0-NEXT: s_mov_b32 s5, s2123; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3124; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]125; GCN-O0-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64126; GCN-O0-NEXT: .LBB0_3: ; %Flow127; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1128; GCN-O0-NEXT: s_waitcnt expcnt(0)129; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload130; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]131; GCN-O0-NEXT: s_waitcnt vmcnt(0)132; GCN-O0-NEXT: v_readlane_b32 s0, v4, 4133; GCN-O0-NEXT: v_readlane_b32 s1, v4, 5134; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]135; GCN-O0-NEXT: .LBB0_4: ; %bb.outer.end136; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1137; GCN-O0-NEXT: s_waitcnt expcnt(0)138; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload139; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]140; GCN-O0-NEXT: s_waitcnt vmcnt(0)141; GCN-O0-NEXT: v_readlane_b32 s0, v4, 2142; GCN-O0-NEXT: v_readlane_b32 s1, v4, 3143; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]144; GCN-O0-NEXT: v_mov_b32_e32 v1, 3145; GCN-O0-NEXT: v_mov_b32_e32 v0, 0146; GCN-O0-NEXT: s_mov_b32 m0, -1147; GCN-O0-NEXT: ds_write_b32 v0, v1148; GCN-O0-NEXT: s_endpgm149bb:150 %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()151 %tmp1 = icmp ugt i32 %tmp, 1152 br i1 %tmp1, label %bb.outer.then, label %bb.outer.end153 154bb.outer.then: ; preds = %bb155 %tmp4 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp156 store i32 0, ptr addrspace(1) %tmp4, align 4157 %tmp5 = icmp eq i32 %tmp, 2158 br i1 %tmp5, label %bb.outer.end, label %bb.inner.then159 160bb.inner.then: ; preds = %bb.outer.then161 %tmp7 = add i32 %tmp, 1162 %tmp9 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp7163 store i32 1, ptr addrspace(1) %tmp9, align 4164 br label %bb.outer.end165 166bb.outer.end: ; preds = %bb.outer.then, %bb.inner.then, %bb167 store i32 3, ptr addrspace(3) null168 ret void169}170 171define amdgpu_kernel void @uncollapsable_nested_if(ptr addrspace(1) nocapture %arg) {172; GCN-LABEL: uncollapsable_nested_if:173; GCN: ; %bb.0: ; %bb174; GCN-NEXT: v_cmp_lt_u32_e32 vcc, 1, v0175; GCN-NEXT: s_and_saveexec_b64 s[6:7], vcc176; GCN-NEXT: s_cbranch_execz .LBB1_4177; GCN-NEXT: ; %bb.1: ; %bb.outer.then178; GCN-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9179; GCN-NEXT: v_lshlrev_b32_e32 v3, 2, v0180; GCN-NEXT: v_mov_b32_e32 v4, 0181; GCN-NEXT: s_mov_b32 s3, 0xf000182; GCN-NEXT: s_mov_b32 s2, 0183; GCN-NEXT: s_waitcnt lgkmcnt(0)184; GCN-NEXT: v_mov_b32_e32 v2, s1185; GCN-NEXT: v_add_i32_e32 v1, vcc, s0, v3186; GCN-NEXT: v_addc_u32_e32 v2, vcc, 0, v2, vcc187; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 2, v0188; GCN-NEXT: buffer_store_dword v4, v[3:4], s[0:3], 0 addr64189; GCN-NEXT: s_and_saveexec_b64 s[4:5], vcc190; GCN-NEXT: s_cbranch_execz .LBB1_3191; GCN-NEXT: ; %bb.2: ; %bb.inner.then192; GCN-NEXT: s_mov_b32 s0, s2193; GCN-NEXT: s_mov_b32 s1, s2194; GCN-NEXT: v_mov_b32_e32 v0, 1195; GCN-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64 offset:4196; GCN-NEXT: .LBB1_3: ; %bb.inner.end197; GCN-NEXT: s_or_b64 exec, exec, s[4:5]198; GCN-NEXT: s_mov_b32 s0, s2199; GCN-NEXT: s_mov_b32 s1, s2200; GCN-NEXT: s_waitcnt expcnt(0)201; GCN-NEXT: v_mov_b32_e32 v0, 2202; GCN-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64 offset:8203; GCN-NEXT: .LBB1_4: ; %Flow204; GCN-NEXT: s_or_b64 exec, exec, s[6:7]205; GCN-NEXT: s_waitcnt expcnt(0)206; GCN-NEXT: v_mov_b32_e32 v0, 3207; GCN-NEXT: v_mov_b32_e32 v1, 0208; GCN-NEXT: s_mov_b32 m0, -1209; GCN-NEXT: ds_write_b32 v1, v0210; GCN-NEXT: s_endpgm211;212; GCN-O0-LABEL: uncollapsable_nested_if:213; GCN-O0: ; %bb.0: ; %bb214; GCN-O0-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0215; GCN-O0-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1216; GCN-O0-NEXT: s_mov_b32 s14, -1217; GCN-O0-NEXT: s_mov_b32 s15, 0xe8f000218; GCN-O0-NEXT: s_add_u32 s12, s12, s11219; GCN-O0-NEXT: s_addc_u32 s13, s13, 0220; GCN-O0-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9221; GCN-O0-NEXT: ; implicit-def: $vgpr4 : SGPR spill to VGPR lane222; GCN-O0-NEXT: s_waitcnt lgkmcnt(0)223; GCN-O0-NEXT: v_writelane_b32 v4, s0, 0224; GCN-O0-NEXT: v_writelane_b32 v4, s1, 1225; GCN-O0-NEXT: v_mov_b32_e32 v1, v0226; GCN-O0-NEXT: buffer_store_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Spill227; GCN-O0-NEXT: s_mov_b32 s0, 1228; GCN-O0-NEXT: v_cmp_gt_u32_e64 s[2:3], v0, s0229; GCN-O0-NEXT: s_mov_b64 s[0:1], exec230; GCN-O0-NEXT: v_writelane_b32 v4, s0, 2231; GCN-O0-NEXT: v_writelane_b32 v4, s1, 3232; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1233; GCN-O0-NEXT: buffer_store_dword v4, off, s[12:15], 0 ; 4-byte Folded Spill234; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]235; GCN-O0-NEXT: s_and_b64 s[0:1], s[0:1], s[2:3]236; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]237; GCN-O0-NEXT: s_cbranch_execz .LBB1_3238; GCN-O0-NEXT: ; %bb.1: ; %bb.outer.then239; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1240; GCN-O0-NEXT: s_waitcnt expcnt(0)241; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload242; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]243; GCN-O0-NEXT: s_waitcnt vmcnt(0)244; GCN-O0-NEXT: v_readlane_b32 s4, v4, 0245; GCN-O0-NEXT: v_readlane_b32 s5, v4, 1246; GCN-O0-NEXT: buffer_load_dword v0, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload247; GCN-O0-NEXT: s_mov_b32 s2, 0xf000248; GCN-O0-NEXT: s_mov_b32 s0, 0249; GCN-O0-NEXT: ; kill: def $sgpr0 killed $sgpr0 def $sgpr0_sgpr1250; GCN-O0-NEXT: s_mov_b32 s1, s2251; GCN-O0-NEXT: ; kill: def $sgpr4_sgpr5 killed $sgpr4_sgpr5 def $sgpr4_sgpr5_sgpr6_sgpr7252; GCN-O0-NEXT: s_mov_b64 s[6:7], s[0:1]253; GCN-O0-NEXT: s_waitcnt vmcnt(0)254; GCN-O0-NEXT: v_ashrrev_i32_e64 v3, 31, v0255; GCN-O0-NEXT: v_mov_b32_e32 v1, v0256; GCN-O0-NEXT: v_mov_b32_e32 v2, v3257; GCN-O0-NEXT: s_mov_b32 s0, 2258; GCN-O0-NEXT: v_lshl_b64 v[2:3], v[1:2], s0259; GCN-O0-NEXT: v_mov_b32_e32 v1, 0260; GCN-O0-NEXT: buffer_store_dword v1, v[2:3], s[4:7], 0 addr64261; GCN-O0-NEXT: v_cmp_ne_u32_e64 s[2:3], v0, s0262; GCN-O0-NEXT: s_mov_b64 s[0:1], exec263; GCN-O0-NEXT: v_writelane_b32 v4, s0, 4264; GCN-O0-NEXT: v_writelane_b32 v4, s1, 5265; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1266; GCN-O0-NEXT: buffer_store_dword v4, off, s[12:15], 0 ; 4-byte Folded Spill267; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]268; GCN-O0-NEXT: s_and_b64 s[0:1], s[0:1], s[2:3]269; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]270; GCN-O0-NEXT: s_cbranch_execz .LBB1_4271; GCN-O0-NEXT: ; %bb.2: ; %bb.inner.then272; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1273; GCN-O0-NEXT: s_waitcnt expcnt(0)274; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload275; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]276; GCN-O0-NEXT: s_waitcnt vmcnt(0)277; GCN-O0-NEXT: v_readlane_b32 s0, v4, 0278; GCN-O0-NEXT: v_readlane_b32 s1, v4, 1279; GCN-O0-NEXT: buffer_load_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload280; GCN-O0-NEXT: v_mov_b32_e32 v0, 1281; GCN-O0-NEXT: s_waitcnt vmcnt(0)282; GCN-O0-NEXT: v_add_i32_e64 v1, s[2:3], v1, v0283; GCN-O0-NEXT: v_ashrrev_i32_e64 v3, 31, v1284; GCN-O0-NEXT: ; kill: def $vgpr1 killed $vgpr1 def $vgpr1_vgpr2 killed $exec285; GCN-O0-NEXT: v_mov_b32_e32 v2, v3286; GCN-O0-NEXT: s_mov_b32 s2, 2287; GCN-O0-NEXT: v_lshl_b64 v[1:2], v[1:2], s2288; GCN-O0-NEXT: s_mov_b32 s2, 0xf000289; GCN-O0-NEXT: s_mov_b32 s4, 0290; GCN-O0-NEXT: ; kill: def $sgpr4 killed $sgpr4 def $sgpr4_sgpr5291; GCN-O0-NEXT: s_mov_b32 s5, s2292; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3293; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]294; GCN-O0-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64295; GCN-O0-NEXT: s_branch .LBB1_4296; GCN-O0-NEXT: .LBB1_3: ; %Flow297; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1298; GCN-O0-NEXT: s_waitcnt expcnt(0)299; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload300; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]301; GCN-O0-NEXT: s_waitcnt vmcnt(0)302; GCN-O0-NEXT: v_readlane_b32 s0, v4, 2303; GCN-O0-NEXT: v_readlane_b32 s1, v4, 3304; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]305; GCN-O0-NEXT: s_branch .LBB1_5306; GCN-O0-NEXT: .LBB1_4: ; %bb.inner.end307; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1308; GCN-O0-NEXT: s_waitcnt expcnt(0)309; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload310; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]311; GCN-O0-NEXT: s_waitcnt vmcnt(0)312; GCN-O0-NEXT: v_readlane_b32 s2, v4, 4313; GCN-O0-NEXT: v_readlane_b32 s3, v4, 5314; GCN-O0-NEXT: s_or_b64 exec, exec, s[2:3]315; GCN-O0-NEXT: v_readlane_b32 s0, v4, 0316; GCN-O0-NEXT: v_readlane_b32 s1, v4, 1317; GCN-O0-NEXT: buffer_load_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload318; GCN-O0-NEXT: v_mov_b32_e32 v0, 2319; GCN-O0-NEXT: s_waitcnt vmcnt(0)320; GCN-O0-NEXT: v_add_i32_e64 v1, s[2:3], v1, v0321; GCN-O0-NEXT: v_ashrrev_i32_e64 v3, 31, v1322; GCN-O0-NEXT: ; kill: def $vgpr1 killed $vgpr1 def $vgpr1_vgpr2 killed $exec323; GCN-O0-NEXT: v_mov_b32_e32 v2, v3324; GCN-O0-NEXT: v_lshl_b64 v[1:2], v[1:2], v0325; GCN-O0-NEXT: s_mov_b32 s2, 0xf000326; GCN-O0-NEXT: s_mov_b32 s4, 0327; GCN-O0-NEXT: ; kill: def $sgpr4 killed $sgpr4 def $sgpr4_sgpr5328; GCN-O0-NEXT: s_mov_b32 s5, s2329; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3330; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]331; GCN-O0-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64332; GCN-O0-NEXT: s_branch .LBB1_3333; GCN-O0-NEXT: .LBB1_5: ; %bb.outer.end334; GCN-O0-NEXT: v_mov_b32_e32 v1, 3335; GCN-O0-NEXT: v_mov_b32_e32 v0, 0336; GCN-O0-NEXT: s_mov_b32 m0, -1337; GCN-O0-NEXT: ds_write_b32 v0, v1338; GCN-O0-NEXT: s_endpgm339bb:340 %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()341 %tmp1 = icmp ugt i32 %tmp, 1342 br i1 %tmp1, label %bb.outer.then, label %bb.outer.end343 344bb.outer.then: ; preds = %bb345 %tmp4 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp346 store i32 0, ptr addrspace(1) %tmp4, align 4347 %tmp5 = icmp eq i32 %tmp, 2348 br i1 %tmp5, label %bb.inner.end, label %bb.inner.then349 350bb.inner.then: ; preds = %bb.outer.then351 %tmp7 = add i32 %tmp, 1352 %tmp8 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp7353 store i32 1, ptr addrspace(1) %tmp8, align 4354 br label %bb.inner.end355 356bb.inner.end: ; preds = %bb.inner.then, %bb.outer.then357 %tmp9 = add i32 %tmp, 2358 %tmp10 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp9359 store i32 2, ptr addrspace(1) %tmp10, align 4360 br label %bb.outer.end361 362bb.outer.end: ; preds = %bb.inner.then, %bb363 store i32 3, ptr addrspace(3) null364 ret void365}366 367define amdgpu_kernel void @nested_if_if_else(ptr addrspace(1) nocapture %arg) {368; GCN-LABEL: nested_if_if_else:369; GCN: ; %bb.0: ; %bb370; GCN-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9371; GCN-NEXT: v_lshlrev_b32_e32 v1, 2, v0372; GCN-NEXT: v_mov_b32_e32 v2, 0373; GCN-NEXT: s_mov_b32 s3, 0xf000374; GCN-NEXT: s_mov_b32 s2, 0375; GCN-NEXT: v_cmp_lt_u32_e32 vcc, 1, v0376; GCN-NEXT: s_waitcnt lgkmcnt(0)377; GCN-NEXT: buffer_store_dword v2, v[1:2], s[0:3], 0 addr64378; GCN-NEXT: s_and_saveexec_b64 s[2:3], vcc379; GCN-NEXT: s_cbranch_execz .LBB2_5380; GCN-NEXT: ; %bb.1: ; %bb.outer.then381; GCN-NEXT: v_mov_b32_e32 v4, s1382; GCN-NEXT: v_add_i32_e32 v3, vcc, s0, v1383; GCN-NEXT: v_addc_u32_e32 v4, vcc, 0, v4, vcc384; GCN-NEXT: v_cmp_ne_u32_e32 vcc, 2, v0385; GCN-NEXT: s_and_saveexec_b64 s[0:1], vcc386; GCN-NEXT: s_xor_b64 s[0:1], exec, s[0:1]387; GCN-NEXT: s_cbranch_execz .LBB2_3388; GCN-NEXT: ; %bb.2: ; %bb.else389; GCN-NEXT: s_mov_b32 s6, 0390; GCN-NEXT: s_mov_b32 s7, 0xf000391; GCN-NEXT: s_mov_b32 s4, s6392; GCN-NEXT: s_mov_b32 s5, s6393; GCN-NEXT: v_mov_b32_e32 v0, 2394; GCN-NEXT: buffer_store_dword v0, v[3:4], s[4:7], 0 addr64 offset:8395; GCN-NEXT: ; implicit-def: $vgpr3_vgpr4396; GCN-NEXT: .LBB2_3: ; %Flow397; GCN-NEXT: s_andn2_saveexec_b64 s[0:1], s[0:1]398; GCN-NEXT: s_cbranch_execz .LBB2_5399; GCN-NEXT: ; %bb.4: ; %bb.then400; GCN-NEXT: s_mov_b32 s6, 0401; GCN-NEXT: s_mov_b32 s7, 0xf000402; GCN-NEXT: s_mov_b32 s4, s6403; GCN-NEXT: s_mov_b32 s5, s6404; GCN-NEXT: s_waitcnt expcnt(0)405; GCN-NEXT: v_mov_b32_e32 v0, 1406; GCN-NEXT: buffer_store_dword v0, v[3:4], s[4:7], 0 addr64 offset:4407; GCN-NEXT: .LBB2_5: ; %bb.outer.end408; GCN-NEXT: s_or_b64 exec, exec, s[2:3]409; GCN-NEXT: s_waitcnt expcnt(0)410; GCN-NEXT: v_mov_b32_e32 v0, 3411; GCN-NEXT: s_mov_b32 m0, -1412; GCN-NEXT: ds_write_b32 v2, v0413; GCN-NEXT: s_endpgm414;415; GCN-O0-LABEL: nested_if_if_else:416; GCN-O0: ; %bb.0: ; %bb417; GCN-O0-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0418; GCN-O0-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1419; GCN-O0-NEXT: s_mov_b32 s14, -1420; GCN-O0-NEXT: s_mov_b32 s15, 0xe8f000421; GCN-O0-NEXT: s_add_u32 s12, s12, s11422; GCN-O0-NEXT: s_addc_u32 s13, s13, 0423; GCN-O0-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9424; GCN-O0-NEXT: s_waitcnt lgkmcnt(0)425; GCN-O0-NEXT: s_mov_b64 s[2:3], s[0:1]426; GCN-O0-NEXT: ; implicit-def: $vgpr4 : SGPR spill to VGPR lane427; GCN-O0-NEXT: v_writelane_b32 v4, s2, 0428; GCN-O0-NEXT: v_writelane_b32 v4, s3, 1429; GCN-O0-NEXT: v_mov_b32_e32 v1, v0430; GCN-O0-NEXT: buffer_store_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Spill431; GCN-O0-NEXT: s_mov_b32 s2, 0xf000432; GCN-O0-NEXT: s_mov_b32 s4, 0433; GCN-O0-NEXT: ; kill: def $sgpr4 killed $sgpr4 def $sgpr4_sgpr5434; GCN-O0-NEXT: s_mov_b32 s5, s2435; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3436; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]437; GCN-O0-NEXT: s_mov_b32 s4, 2438; GCN-O0-NEXT: v_lshlrev_b32_e64 v2, s4, v0439; GCN-O0-NEXT: s_waitcnt expcnt(0)440; GCN-O0-NEXT: v_mov_b32_e32 v1, 0441; GCN-O0-NEXT: ; kill: def $vgpr2 killed $vgpr2 def $vgpr2_vgpr3 killed $exec442; GCN-O0-NEXT: v_mov_b32_e32 v3, v1443; GCN-O0-NEXT: v_mov_b32_e32 v1, 0444; GCN-O0-NEXT: buffer_store_dword v1, v[2:3], s[0:3], 0 addr64445; GCN-O0-NEXT: s_mov_b32 s0, 1446; GCN-O0-NEXT: v_cmp_gt_u32_e64 s[2:3], v0, s0447; GCN-O0-NEXT: s_mov_b64 s[0:1], exec448; GCN-O0-NEXT: v_writelane_b32 v4, s0, 2449; GCN-O0-NEXT: v_writelane_b32 v4, s1, 3450; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1451; GCN-O0-NEXT: buffer_store_dword v4, off, s[12:15], 0 ; 4-byte Folded Spill452; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]453; GCN-O0-NEXT: s_and_b64 s[0:1], s[0:1], s[2:3]454; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]455; GCN-O0-NEXT: s_cbranch_execz .LBB2_6456; GCN-O0-NEXT: ; %bb.1: ; %bb.outer.then457; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1458; GCN-O0-NEXT: s_waitcnt expcnt(0)459; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload460; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]461; GCN-O0-NEXT: buffer_load_dword v0, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload462; GCN-O0-NEXT: s_mov_b32 s0, 2463; GCN-O0-NEXT: s_waitcnt vmcnt(0)464; GCN-O0-NEXT: v_cmp_ne_u32_e64 s[0:1], v0, s0465; GCN-O0-NEXT: s_mov_b64 s[2:3], exec466; GCN-O0-NEXT: s_and_b64 s[0:1], s[2:3], s[0:1]467; GCN-O0-NEXT: s_xor_b64 s[2:3], s[0:1], s[2:3]468; GCN-O0-NEXT: v_writelane_b32 v4, s2, 4469; GCN-O0-NEXT: v_writelane_b32 v4, s3, 5470; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1471; GCN-O0-NEXT: buffer_store_dword v4, off, s[12:15], 0 ; 4-byte Folded Spill472; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]473; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]474; GCN-O0-NEXT: s_cbranch_execz .LBB2_2475; GCN-O0-NEXT: s_branch .LBB2_4476; GCN-O0-NEXT: .LBB2_2: ; %Flow477; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1478; GCN-O0-NEXT: s_waitcnt expcnt(0)479; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload480; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]481; GCN-O0-NEXT: s_waitcnt vmcnt(0)482; GCN-O0-NEXT: v_readlane_b32 s0, v4, 4483; GCN-O0-NEXT: v_readlane_b32 s1, v4, 5484; GCN-O0-NEXT: s_or_saveexec_b64 s[0:1], s[0:1]485; GCN-O0-NEXT: s_and_b64 s[0:1], exec, s[0:1]486; GCN-O0-NEXT: v_writelane_b32 v4, s0, 6487; GCN-O0-NEXT: v_writelane_b32 v4, s1, 7488; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1489; GCN-O0-NEXT: buffer_store_dword v4, off, s[12:15], 0 ; 4-byte Folded Spill490; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]491; GCN-O0-NEXT: s_xor_b64 exec, exec, s[0:1]492; GCN-O0-NEXT: s_cbranch_execz .LBB2_5493; GCN-O0-NEXT: ; %bb.3: ; %bb.then494; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1495; GCN-O0-NEXT: s_waitcnt expcnt(0)496; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload497; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]498; GCN-O0-NEXT: s_waitcnt vmcnt(0)499; GCN-O0-NEXT: v_readlane_b32 s0, v4, 0500; GCN-O0-NEXT: v_readlane_b32 s1, v4, 1501; GCN-O0-NEXT: buffer_load_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload502; GCN-O0-NEXT: v_mov_b32_e32 v0, 1503; GCN-O0-NEXT: s_waitcnt vmcnt(0)504; GCN-O0-NEXT: v_add_i32_e64 v1, s[2:3], v1, v0505; GCN-O0-NEXT: v_ashrrev_i32_e64 v3, 31, v1506; GCN-O0-NEXT: ; kill: def $vgpr1 killed $vgpr1 def $vgpr1_vgpr2 killed $exec507; GCN-O0-NEXT: v_mov_b32_e32 v2, v3508; GCN-O0-NEXT: s_mov_b32 s2, 2509; GCN-O0-NEXT: v_lshl_b64 v[1:2], v[1:2], s2510; GCN-O0-NEXT: s_mov_b32 s2, 0xf000511; GCN-O0-NEXT: s_mov_b32 s4, 0512; GCN-O0-NEXT: ; kill: def $sgpr4 killed $sgpr4 def $sgpr4_sgpr5513; GCN-O0-NEXT: s_mov_b32 s5, s2514; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3515; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]516; GCN-O0-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64517; GCN-O0-NEXT: s_branch .LBB2_5518; GCN-O0-NEXT: .LBB2_4: ; %bb.else519; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1520; GCN-O0-NEXT: s_waitcnt expcnt(0)521; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload522; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]523; GCN-O0-NEXT: s_waitcnt vmcnt(0)524; GCN-O0-NEXT: v_readlane_b32 s0, v4, 0525; GCN-O0-NEXT: v_readlane_b32 s1, v4, 1526; GCN-O0-NEXT: buffer_load_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload527; GCN-O0-NEXT: v_mov_b32_e32 v0, 2528; GCN-O0-NEXT: s_waitcnt vmcnt(0)529; GCN-O0-NEXT: v_add_i32_e64 v1, s[2:3], v1, v0530; GCN-O0-NEXT: v_ashrrev_i32_e64 v3, 31, v1531; GCN-O0-NEXT: ; kill: def $vgpr1 killed $vgpr1 def $vgpr1_vgpr2 killed $exec532; GCN-O0-NEXT: v_mov_b32_e32 v2, v3533; GCN-O0-NEXT: v_lshl_b64 v[1:2], v[1:2], v0534; GCN-O0-NEXT: s_mov_b32 s2, 0xf000535; GCN-O0-NEXT: s_mov_b32 s4, 0536; GCN-O0-NEXT: ; kill: def $sgpr4 killed $sgpr4 def $sgpr4_sgpr5537; GCN-O0-NEXT: s_mov_b32 s5, s2538; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3539; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]540; GCN-O0-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64541; GCN-O0-NEXT: s_branch .LBB2_2542; GCN-O0-NEXT: .LBB2_5: ; %Flow1543; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1544; GCN-O0-NEXT: s_waitcnt expcnt(0)545; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload546; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]547; GCN-O0-NEXT: s_waitcnt vmcnt(0)548; GCN-O0-NEXT: v_readlane_b32 s0, v4, 6549; GCN-O0-NEXT: v_readlane_b32 s1, v4, 7550; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]551; GCN-O0-NEXT: .LBB2_6: ; %bb.outer.end552; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1553; GCN-O0-NEXT: s_waitcnt expcnt(0)554; GCN-O0-NEXT: buffer_load_dword v4, off, s[12:15], 0 ; 4-byte Folded Reload555; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]556; GCN-O0-NEXT: s_waitcnt vmcnt(0)557; GCN-O0-NEXT: v_readlane_b32 s0, v4, 2558; GCN-O0-NEXT: v_readlane_b32 s1, v4, 3559; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]560; GCN-O0-NEXT: v_mov_b32_e32 v1, 3561; GCN-O0-NEXT: v_mov_b32_e32 v0, 0562; GCN-O0-NEXT: s_mov_b32 m0, -1563; GCN-O0-NEXT: ds_write_b32 v0, v1564; GCN-O0-NEXT: s_endpgm565bb:566 %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()567 %tmp1 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp568 store i32 0, ptr addrspace(1) %tmp1, align 4569 %tmp2 = icmp ugt i32 %tmp, 1570 br i1 %tmp2, label %bb.outer.then, label %bb.outer.end571 572bb.outer.then: ; preds = %bb573 %tmp5 = icmp eq i32 %tmp, 2574 br i1 %tmp5, label %bb.then, label %bb.else575 576bb.then: ; preds = %bb.outer.then577 %tmp3 = add i32 %tmp, 1578 %tmp4 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp3579 store i32 1, ptr addrspace(1) %tmp4, align 4580 br label %bb.outer.end581 582bb.else: ; preds = %bb.outer.then583 %tmp7 = add i32 %tmp, 2584 %tmp9 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp7585 store i32 2, ptr addrspace(1) %tmp9, align 4586 br label %bb.outer.end587 588bb.outer.end: ; preds = %bb, %bb.then, %bb.else589 store i32 3, ptr addrspace(3) null590 ret void591}592 593define amdgpu_kernel void @nested_if_else_if(ptr addrspace(1) nocapture %arg) {594; GCN-LABEL: nested_if_else_if:595; GCN: ; %bb.0: ; %bb596; GCN-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9597; GCN-NEXT: v_lshlrev_b32_e32 v3, 2, v0598; GCN-NEXT: v_mov_b32_e32 v4, 0599; GCN-NEXT: s_mov_b32 s3, 0xf000600; GCN-NEXT: s_mov_b32 s2, 0601; GCN-NEXT: s_waitcnt lgkmcnt(0)602; GCN-NEXT: v_mov_b32_e32 v2, s1603; GCN-NEXT: v_add_i32_e32 v1, vcc, s0, v3604; GCN-NEXT: v_addc_u32_e32 v2, vcc, 0, v2, vcc605; GCN-NEXT: v_cmp_gt_u32_e32 vcc, 2, v0606; GCN-NEXT: buffer_store_dword v4, v[3:4], s[0:3], 0 addr64607; GCN-NEXT: s_and_saveexec_b64 s[0:1], vcc608; GCN-NEXT: s_xor_b64 s[4:5], exec, s[0:1]609; GCN-NEXT: s_cbranch_execz .LBB3_4610; GCN-NEXT: ; %bb.1: ; %bb.outer.else611; GCN-NEXT: s_mov_b32 s0, s2612; GCN-NEXT: s_mov_b32 s1, s2613; GCN-NEXT: v_mov_b32_e32 v3, 3614; GCN-NEXT: v_cmp_eq_u32_e32 vcc, 0, v0615; GCN-NEXT: buffer_store_dword v3, v[1:2], s[0:3], 0 addr64 offset:12616; GCN-NEXT: s_and_saveexec_b64 s[0:1], vcc617; GCN-NEXT: s_cbranch_execz .LBB3_3618; GCN-NEXT: ; %bb.2: ; %bb.inner.then2619; GCN-NEXT: s_mov_b32 s10, 0620; GCN-NEXT: s_mov_b32 s11, 0xf000621; GCN-NEXT: s_mov_b32 s8, s10622; GCN-NEXT: s_mov_b32 s9, s10623; GCN-NEXT: v_mov_b32_e32 v0, 4624; GCN-NEXT: buffer_store_dword v0, v[1:2], s[8:11], 0 addr64 offset:16625; GCN-NEXT: .LBB3_3: ; %Flow626; GCN-NEXT: s_or_b64 exec, exec, s[0:1]627; GCN-NEXT: ; implicit-def: $vgpr1_vgpr2628; GCN-NEXT: ; implicit-def: $vgpr0629; GCN-NEXT: .LBB3_4: ; %Flow2630; GCN-NEXT: s_andn2_saveexec_b64 s[4:5], s[4:5]631; GCN-NEXT: s_cbranch_execz .LBB3_8632; GCN-NEXT: ; %bb.5: ; %bb.outer.then633; GCN-NEXT: s_mov_b32 s0, s2634; GCN-NEXT: s_mov_b32 s1, s2635; GCN-NEXT: s_waitcnt expcnt(0)636; GCN-NEXT: v_mov_b32_e32 v3, 1637; GCN-NEXT: v_cmp_eq_u32_e32 vcc, 2, v0638; GCN-NEXT: buffer_store_dword v3, v[1:2], s[0:3], 0 addr64 offset:4639; GCN-NEXT: s_and_saveexec_b64 s[6:7], vcc640; GCN-NEXT: s_cbranch_execz .LBB3_7641; GCN-NEXT: ; %bb.6: ; %bb.inner.then642; GCN-NEXT: v_mov_b32_e32 v0, 2643; GCN-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64 offset:8644; GCN-NEXT: .LBB3_7: ; %Flow1645; GCN-NEXT: s_or_b64 exec, exec, s[6:7]646; GCN-NEXT: .LBB3_8: ; %bb.outer.end647; GCN-NEXT: s_or_b64 exec, exec, s[4:5]648; GCN-NEXT: s_waitcnt expcnt(0)649; GCN-NEXT: v_mov_b32_e32 v0, 3650; GCN-NEXT: v_mov_b32_e32 v1, 0651; GCN-NEXT: s_mov_b32 m0, -1652; GCN-NEXT: ds_write_b32 v1, v0653; GCN-NEXT: s_endpgm654;655; GCN-O0-LABEL: nested_if_else_if:656; GCN-O0: ; %bb.0: ; %bb657; GCN-O0-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0658; GCN-O0-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1659; GCN-O0-NEXT: s_mov_b32 s14, -1660; GCN-O0-NEXT: s_mov_b32 s15, 0xe8f000661; GCN-O0-NEXT: s_add_u32 s12, s12, s11662; GCN-O0-NEXT: s_addc_u32 s13, s13, 0663; GCN-O0-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x9664; GCN-O0-NEXT: v_mov_b32_e32 v1, v0665; GCN-O0-NEXT: buffer_store_dword v1, off, s[12:15], 0 offset:12 ; 4-byte Folded Spill666; GCN-O0-NEXT: s_mov_b32 s0, 2667; GCN-O0-NEXT: v_lshlrev_b32_e64 v2, s0, v0668; GCN-O0-NEXT: s_waitcnt expcnt(0)669; GCN-O0-NEXT: v_mov_b32_e32 v1, 0670; GCN-O0-NEXT: ; kill: def $vgpr2 killed $vgpr2 def $vgpr2_vgpr3 killed $exec671; GCN-O0-NEXT: v_mov_b32_e32 v3, v1672; GCN-O0-NEXT: s_waitcnt lgkmcnt(0)673; GCN-O0-NEXT: s_mov_b32 s2, s4674; GCN-O0-NEXT: v_mov_b32_e32 v1, v2675; GCN-O0-NEXT: s_mov_b32 s1, s5676; GCN-O0-NEXT: v_mov_b32_e32 v5, v3677; GCN-O0-NEXT: v_add_i32_e64 v4, s[2:3], s2, v1678; GCN-O0-NEXT: v_mov_b32_e32 v1, s1679; GCN-O0-NEXT: v_addc_u32_e64 v1, s[2:3], v1, v5, s[2:3]680; GCN-O0-NEXT: ; kill: def $vgpr4 killed $vgpr4 def $vgpr4_vgpr5 killed $exec681; GCN-O0-NEXT: v_mov_b32_e32 v5, v1682; GCN-O0-NEXT: buffer_store_dword v4, off, s[12:15], 0 offset:4 ; 4-byte Folded Spill683; GCN-O0-NEXT: buffer_store_dword v5, off, s[12:15], 0 offset:8 ; 4-byte Folded Spill684; GCN-O0-NEXT: s_mov_b32 s1, 0xf000685; GCN-O0-NEXT: s_mov_b32 s2, 0686; GCN-O0-NEXT: ; kill: def $sgpr2 killed $sgpr2 def $sgpr2_sgpr3687; GCN-O0-NEXT: s_mov_b32 s3, s1688; GCN-O0-NEXT: ; kill: def $sgpr4_sgpr5 killed $sgpr4_sgpr5 def $sgpr4_sgpr5_sgpr6_sgpr7689; GCN-O0-NEXT: s_mov_b64 s[6:7], s[2:3]690; GCN-O0-NEXT: v_mov_b32_e32 v1, 0691; GCN-O0-NEXT: buffer_store_dword v1, v[2:3], s[4:7], 0 addr64692; GCN-O0-NEXT: v_cmp_lt_u32_e64 s[0:1], v0, s0693; GCN-O0-NEXT: s_mov_b64 s[2:3], exec694; GCN-O0-NEXT: s_and_b64 s[0:1], s[2:3], s[0:1]695; GCN-O0-NEXT: s_xor_b64 s[2:3], s[0:1], s[2:3]696; GCN-O0-NEXT: ; implicit-def: $vgpr6 : SGPR spill to VGPR lane697; GCN-O0-NEXT: v_writelane_b32 v6, s2, 0698; GCN-O0-NEXT: v_writelane_b32 v6, s3, 1699; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1700; GCN-O0-NEXT: buffer_store_dword v6, off, s[12:15], 0 ; 4-byte Folded Spill701; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]702; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]703; GCN-O0-NEXT: s_cbranch_execz .LBB3_1704; GCN-O0-NEXT: s_branch .LBB3_4705; GCN-O0-NEXT: .LBB3_1: ; %Flow2706; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1707; GCN-O0-NEXT: s_waitcnt expcnt(0)708; GCN-O0-NEXT: buffer_load_dword v6, off, s[12:15], 0 ; 4-byte Folded Reload709; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]710; GCN-O0-NEXT: s_waitcnt vmcnt(0)711; GCN-O0-NEXT: v_readlane_b32 s0, v6, 0712; GCN-O0-NEXT: v_readlane_b32 s1, v6, 1713; GCN-O0-NEXT: s_or_saveexec_b64 s[0:1], s[0:1]714; GCN-O0-NEXT: s_and_b64 s[0:1], exec, s[0:1]715; GCN-O0-NEXT: v_writelane_b32 v6, s0, 2716; GCN-O0-NEXT: v_writelane_b32 v6, s1, 3717; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1718; GCN-O0-NEXT: buffer_store_dword v6, off, s[12:15], 0 ; 4-byte Folded Spill719; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]720; GCN-O0-NEXT: s_xor_b64 exec, exec, s[0:1]721; GCN-O0-NEXT: s_cbranch_execz .LBB3_8722; GCN-O0-NEXT: ; %bb.2: ; %bb.outer.then723; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1724; GCN-O0-NEXT: s_waitcnt expcnt(0)725; GCN-O0-NEXT: buffer_load_dword v6, off, s[12:15], 0 ; 4-byte Folded Reload726; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]727; GCN-O0-NEXT: buffer_load_dword v0, off, s[12:15], 0 offset:12 ; 4-byte Folded Reload728; GCN-O0-NEXT: buffer_load_dword v2, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload729; GCN-O0-NEXT: buffer_load_dword v3, off, s[12:15], 0 offset:8 ; 4-byte Folded Reload730; GCN-O0-NEXT: s_mov_b32 s0, 0xf000731; GCN-O0-NEXT: s_mov_b32 s2, 0732; GCN-O0-NEXT: s_mov_b32 s4, s2733; GCN-O0-NEXT: s_mov_b32 s5, s0734; GCN-O0-NEXT: s_mov_b32 s0, s2735; GCN-O0-NEXT: s_mov_b32 s1, s2736; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3737; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]738; GCN-O0-NEXT: v_mov_b32_e32 v1, 1739; GCN-O0-NEXT: s_waitcnt vmcnt(0)740; GCN-O0-NEXT: buffer_store_dword v1, v[2:3], s[0:3], 0 addr64 offset:4741; GCN-O0-NEXT: s_mov_b32 s0, 2742; GCN-O0-NEXT: v_cmp_eq_u32_e64 s[2:3], v0, s0743; GCN-O0-NEXT: s_mov_b64 s[0:1], exec744; GCN-O0-NEXT: v_writelane_b32 v6, s0, 4745; GCN-O0-NEXT: v_writelane_b32 v6, s1, 5746; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1747; GCN-O0-NEXT: buffer_store_dword v6, off, s[12:15], 0 ; 4-byte Folded Spill748; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]749; GCN-O0-NEXT: s_and_b64 s[0:1], s[0:1], s[2:3]750; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]751; GCN-O0-NEXT: s_cbranch_execz .LBB3_7752; GCN-O0-NEXT: ; %bb.3: ; %bb.inner.then753; GCN-O0-NEXT: s_waitcnt expcnt(1)754; GCN-O0-NEXT: buffer_load_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload755; GCN-O0-NEXT: buffer_load_dword v2, off, s[12:15], 0 offset:8 ; 4-byte Folded Reload756; GCN-O0-NEXT: s_mov_b32 s0, 0xf000757; GCN-O0-NEXT: s_mov_b32 s2, 0758; GCN-O0-NEXT: s_mov_b32 s4, s2759; GCN-O0-NEXT: s_mov_b32 s5, s0760; GCN-O0-NEXT: s_mov_b32 s0, s2761; GCN-O0-NEXT: s_mov_b32 s1, s2762; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3763; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]764; GCN-O0-NEXT: v_mov_b32_e32 v0, 2765; GCN-O0-NEXT: s_waitcnt vmcnt(0)766; GCN-O0-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64 offset:8767; GCN-O0-NEXT: s_branch .LBB3_7768; GCN-O0-NEXT: .LBB3_4: ; %bb.outer.else769; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1770; GCN-O0-NEXT: s_waitcnt expcnt(0)771; GCN-O0-NEXT: buffer_load_dword v6, off, s[12:15], 0 ; 4-byte Folded Reload772; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]773; GCN-O0-NEXT: buffer_load_dword v0, off, s[12:15], 0 offset:12 ; 4-byte Folded Reload774; GCN-O0-NEXT: buffer_load_dword v2, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload775; GCN-O0-NEXT: buffer_load_dword v3, off, s[12:15], 0 offset:8 ; 4-byte Folded Reload776; GCN-O0-NEXT: s_mov_b32 s1, 0xf000777; GCN-O0-NEXT: s_mov_b32 s0, 0778; GCN-O0-NEXT: s_mov_b32 s2, s0779; GCN-O0-NEXT: s_mov_b32 s3, s1780; GCN-O0-NEXT: s_mov_b32 s4, s0781; GCN-O0-NEXT: s_mov_b32 s5, s0782; GCN-O0-NEXT: ; kill: def $sgpr4_sgpr5 killed $sgpr4_sgpr5 def $sgpr4_sgpr5_sgpr6_sgpr7783; GCN-O0-NEXT: s_mov_b64 s[6:7], s[2:3]784; GCN-O0-NEXT: v_mov_b32_e32 v1, 3785; GCN-O0-NEXT: s_waitcnt vmcnt(0)786; GCN-O0-NEXT: buffer_store_dword v1, v[2:3], s[4:7], 0 addr64 offset:12787; GCN-O0-NEXT: v_cmp_eq_u32_e64 s[2:3], v0, s0788; GCN-O0-NEXT: s_mov_b64 s[0:1], exec789; GCN-O0-NEXT: v_writelane_b32 v6, s0, 6790; GCN-O0-NEXT: v_writelane_b32 v6, s1, 7791; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1792; GCN-O0-NEXT: buffer_store_dword v6, off, s[12:15], 0 ; 4-byte Folded Spill793; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]794; GCN-O0-NEXT: s_and_b64 s[0:1], s[0:1], s[2:3]795; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]796; GCN-O0-NEXT: s_cbranch_execz .LBB3_6797; GCN-O0-NEXT: ; %bb.5: ; %bb.inner.then2798; GCN-O0-NEXT: s_waitcnt expcnt(1)799; GCN-O0-NEXT: buffer_load_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload800; GCN-O0-NEXT: buffer_load_dword v2, off, s[12:15], 0 offset:8 ; 4-byte Folded Reload801; GCN-O0-NEXT: s_mov_b32 s0, 0xf000802; GCN-O0-NEXT: s_mov_b32 s2, 0803; GCN-O0-NEXT: s_mov_b32 s4, s2804; GCN-O0-NEXT: s_mov_b32 s5, s0805; GCN-O0-NEXT: s_mov_b32 s0, s2806; GCN-O0-NEXT: s_mov_b32 s1, s2807; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3808; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]809; GCN-O0-NEXT: v_mov_b32_e32 v0, 4810; GCN-O0-NEXT: s_waitcnt vmcnt(0)811; GCN-O0-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64 offset:16812; GCN-O0-NEXT: .LBB3_6: ; %Flow813; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1814; GCN-O0-NEXT: s_waitcnt expcnt(0)815; GCN-O0-NEXT: buffer_load_dword v6, off, s[12:15], 0 ; 4-byte Folded Reload816; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]817; GCN-O0-NEXT: s_waitcnt vmcnt(0)818; GCN-O0-NEXT: v_readlane_b32 s0, v6, 6819; GCN-O0-NEXT: v_readlane_b32 s1, v6, 7820; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]821; GCN-O0-NEXT: s_branch .LBB3_1822; GCN-O0-NEXT: .LBB3_7: ; %Flow1823; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1824; GCN-O0-NEXT: s_waitcnt expcnt(0)825; GCN-O0-NEXT: buffer_load_dword v6, off, s[12:15], 0 ; 4-byte Folded Reload826; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]827; GCN-O0-NEXT: s_waitcnt vmcnt(0)828; GCN-O0-NEXT: v_readlane_b32 s0, v6, 4829; GCN-O0-NEXT: v_readlane_b32 s1, v6, 5830; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]831; GCN-O0-NEXT: .LBB3_8: ; %bb.outer.end832; GCN-O0-NEXT: s_or_saveexec_b64 s[8:9], -1833; GCN-O0-NEXT: s_waitcnt expcnt(0)834; GCN-O0-NEXT: buffer_load_dword v6, off, s[12:15], 0 ; 4-byte Folded Reload835; GCN-O0-NEXT: s_mov_b64 exec, s[8:9]836; GCN-O0-NEXT: s_waitcnt vmcnt(0)837; GCN-O0-NEXT: v_readlane_b32 s0, v6, 2838; GCN-O0-NEXT: v_readlane_b32 s1, v6, 3839; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]840; GCN-O0-NEXT: v_mov_b32_e32 v1, 3841; GCN-O0-NEXT: v_mov_b32_e32 v0, 0842; GCN-O0-NEXT: s_mov_b32 m0, -1843; GCN-O0-NEXT: ds_write_b32 v0, v1844; GCN-O0-NEXT: s_endpgm845bb:846 %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()847 %tmp1 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp848 store i32 0, ptr addrspace(1) %tmp1, align 4849 %cc1 = icmp ugt i32 %tmp, 1850 br i1 %cc1, label %bb.outer.then, label %bb.outer.else851 852bb.outer.then:853 %tmp2 = getelementptr inbounds i32, ptr addrspace(1) %tmp1, i32 1854 store i32 1, ptr addrspace(1) %tmp2, align 4855 %cc2 = icmp eq i32 %tmp, 2856 br i1 %cc2, label %bb.inner.then, label %bb.outer.end857 858bb.inner.then:859 %tmp3 = getelementptr inbounds i32, ptr addrspace(1) %tmp1, i32 2860 store i32 2, ptr addrspace(1) %tmp3, align 4861 br label %bb.outer.end862 863bb.outer.else:864 %tmp4 = getelementptr inbounds i32, ptr addrspace(1) %tmp1, i32 3865 store i32 3, ptr addrspace(1) %tmp4, align 4866 %cc3 = icmp eq i32 %tmp, 0 ; avoid being optimized away through the domination867 br i1 %cc3, label %bb.inner.then2, label %bb.outer.end868 869bb.inner.then2:870 %tmp5 = getelementptr inbounds i32, ptr addrspace(1) %tmp1, i32 4871 store i32 4, ptr addrspace(1) %tmp5, align 4872 br label %bb.outer.end873 874bb.outer.end:875 store i32 3, ptr addrspace(3) null876 ret void877}878 879define amdgpu_kernel void @s_endpgm_unsafe_barrier(ptr addrspace(1) nocapture %arg) {880; GCN-LABEL: s_endpgm_unsafe_barrier:881; GCN: ; %bb.0: ; %bb882; GCN-NEXT: v_cmp_lt_u32_e32 vcc, 1, v0883; GCN-NEXT: s_and_saveexec_b64 s[0:1], vcc884; GCN-NEXT: s_cbranch_execz .LBB4_2885; GCN-NEXT: ; %bb.1: ; %bb.then886; GCN-NEXT: s_load_dwordx2 s[4:5], s[4:5], 0x9887; GCN-NEXT: s_mov_b32 s7, 0xf000888; GCN-NEXT: s_mov_b32 s6, 0889; GCN-NEXT: v_lshlrev_b32_e32 v0, 2, v0890; GCN-NEXT: v_mov_b32_e32 v1, 0891; GCN-NEXT: s_waitcnt lgkmcnt(0)892; GCN-NEXT: buffer_store_dword v1, v[0:1], s[4:7], 0 addr64893; GCN-NEXT: .LBB4_2: ; %bb.end894; GCN-NEXT: s_or_b64 exec, exec, s[0:1]895; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0)896; GCN-NEXT: s_barrier897; GCN-NEXT: s_endpgm898;899; GCN-O0-LABEL: s_endpgm_unsafe_barrier:900; GCN-O0: ; %bb.0: ; %bb901; GCN-O0-NEXT: s_mov_b32 s12, SCRATCH_RSRC_DWORD0902; GCN-O0-NEXT: s_mov_b32 s13, SCRATCH_RSRC_DWORD1903; GCN-O0-NEXT: s_mov_b32 s14, -1904; GCN-O0-NEXT: s_mov_b32 s15, 0xe8f000905; GCN-O0-NEXT: s_add_u32 s12, s12, s11906; GCN-O0-NEXT: s_addc_u32 s13, s13, 0907; GCN-O0-NEXT: s_load_dwordx2 s[0:1], s[4:5], 0x9908; GCN-O0-NEXT: ; implicit-def: $vgpr3 : SGPR spill to VGPR lane909; GCN-O0-NEXT: s_waitcnt lgkmcnt(0)910; GCN-O0-NEXT: v_writelane_b32 v3, s0, 0911; GCN-O0-NEXT: v_writelane_b32 v3, s1, 1912; GCN-O0-NEXT: v_mov_b32_e32 v1, v0913; GCN-O0-NEXT: buffer_store_dword v1, off, s[12:15], 0 offset:4 ; 4-byte Folded Spill914; GCN-O0-NEXT: s_mov_b32 s0, 1915; GCN-O0-NEXT: v_cmp_gt_u32_e64 s[2:3], v0, s0916; GCN-O0-NEXT: s_mov_b64 s[0:1], exec917; GCN-O0-NEXT: v_writelane_b32 v3, s0, 2918; GCN-O0-NEXT: v_writelane_b32 v3, s1, 3919; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1920; GCN-O0-NEXT: buffer_store_dword v3, off, s[12:15], 0 ; 4-byte Folded Spill921; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]922; GCN-O0-NEXT: s_and_b64 s[0:1], s[0:1], s[2:3]923; GCN-O0-NEXT: s_mov_b64 exec, s[0:1]924; GCN-O0-NEXT: s_cbranch_execz .LBB4_2925; GCN-O0-NEXT: ; %bb.1: ; %bb.then926; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1927; GCN-O0-NEXT: s_waitcnt expcnt(0)928; GCN-O0-NEXT: buffer_load_dword v3, off, s[12:15], 0 ; 4-byte Folded Reload929; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]930; GCN-O0-NEXT: s_waitcnt vmcnt(0)931; GCN-O0-NEXT: v_readlane_b32 s0, v3, 0932; GCN-O0-NEXT: v_readlane_b32 s1, v3, 1933; GCN-O0-NEXT: buffer_load_dword v0, off, s[12:15], 0 offset:4 ; 4-byte Folded Reload934; GCN-O0-NEXT: s_mov_b32 s2, 0xf000935; GCN-O0-NEXT: s_mov_b32 s4, 0936; GCN-O0-NEXT: ; kill: def $sgpr4 killed $sgpr4 def $sgpr4_sgpr5937; GCN-O0-NEXT: s_mov_b32 s5, s2938; GCN-O0-NEXT: ; kill: def $sgpr0_sgpr1 killed $sgpr0_sgpr1 def $sgpr0_sgpr1_sgpr2_sgpr3939; GCN-O0-NEXT: s_mov_b64 s[2:3], s[4:5]940; GCN-O0-NEXT: s_waitcnt vmcnt(0)941; GCN-O0-NEXT: v_ashrrev_i32_e64 v2, 31, v0942; GCN-O0-NEXT: ; kill: def $vgpr0 killed $vgpr0 def $vgpr0_vgpr1 killed $exec943; GCN-O0-NEXT: v_mov_b32_e32 v1, v2944; GCN-O0-NEXT: s_mov_b32 s4, 2945; GCN-O0-NEXT: v_lshl_b64 v[1:2], v[0:1], s4946; GCN-O0-NEXT: v_mov_b32_e32 v0, 0947; GCN-O0-NEXT: buffer_store_dword v0, v[1:2], s[0:3], 0 addr64948; GCN-O0-NEXT: .LBB4_2: ; %bb.end949; GCN-O0-NEXT: s_or_saveexec_b64 s[6:7], -1950; GCN-O0-NEXT: s_waitcnt expcnt(0)951; GCN-O0-NEXT: buffer_load_dword v3, off, s[12:15], 0 ; 4-byte Folded Reload952; GCN-O0-NEXT: s_mov_b64 exec, s[6:7]953; GCN-O0-NEXT: s_waitcnt vmcnt(0)954; GCN-O0-NEXT: v_readlane_b32 s0, v3, 2955; GCN-O0-NEXT: v_readlane_b32 s1, v3, 3956; GCN-O0-NEXT: s_or_b64 exec, exec, s[0:1]957; GCN-O0-NEXT: s_barrier958; GCN-O0-NEXT: s_endpgm959bb:960 %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()961 %tmp1 = icmp ugt i32 %tmp, 1962 br i1 %tmp1, label %bb.then, label %bb.end963 964bb.then: ; preds = %bb965 %tmp4 = getelementptr inbounds i32, ptr addrspace(1) %arg, i32 %tmp966 store i32 0, ptr addrspace(1) %tmp4, align 4967 br label %bb.end968 969bb.end: ; preds = %bb.then, %bb970 call void @llvm.amdgcn.s.barrier()971 ret void972}973 974define void @scc_liveness(i32 %arg) local_unnamed_addr #0 {975; GCN-LABEL: scc_liveness:976; GCN: ; %bb.0: ; %bb977; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)978; GCN-NEXT: s_movk_i32 s4, 0x207979; GCN-NEXT: v_cmp_gt_i32_e32 vcc, s4, v0980; GCN-NEXT: v_cmp_eq_u32_e64 s[4:5], 0, v0981; GCN-NEXT: s_mov_b64 s[8:9], 0982; GCN-NEXT: v_mov_b32_e32 v1, 0983; GCN-NEXT: s_mov_b64 s[6:7], 0984; GCN-NEXT: s_branch .LBB5_3985; GCN-NEXT: .LBB5_1: ; %Flow986; GCN-NEXT: ; in Loop: Header=BB5_3 Depth=1987; GCN-NEXT: s_or_b64 exec, exec, s[12:13]988; GCN-NEXT: .LBB5_2: ; %bb10989; GCN-NEXT: ; in Loop: Header=BB5_3 Depth=1990; GCN-NEXT: s_or_b64 exec, exec, s[10:11]991; GCN-NEXT: s_and_b64 s[6:7], exec, s[4:5]992; GCN-NEXT: s_or_b64 s[8:9], s[6:7], s[8:9]993; GCN-NEXT: s_mov_b64 s[6:7], 0994; GCN-NEXT: s_andn2_b64 exec, exec, s[8:9]995; GCN-NEXT: s_cbranch_execz .LBB5_7996; GCN-NEXT: .LBB5_3: ; %bb1997; GCN-NEXT: ; =>This Inner Loop Header: Depth=1998; GCN-NEXT: s_and_b64 s[10:11], exec, vcc999; GCN-NEXT: s_or_b64 s[6:7], s[10:11], s[6:7]1000; GCN-NEXT: s_andn2_b64 exec, exec, s[6:7]1001; GCN-NEXT: s_cbranch_execnz .LBB5_31002; GCN-NEXT: ; %bb.4: ; %bb21003; GCN-NEXT: ; in Loop: Header=BB5_3 Depth=11004; GCN-NEXT: s_or_b64 exec, exec, s[6:7]1005; GCN-NEXT: v_mov_b32_e32 v2, v11006; GCN-NEXT: v_mov_b32_e32 v3, v11007; GCN-NEXT: v_mov_b32_e32 v4, v11008; GCN-NEXT: v_mov_b32_e32 v5, v41009; GCN-NEXT: v_mov_b32_e32 v4, v31010; GCN-NEXT: v_mov_b32_e32 v3, v21011; GCN-NEXT: v_mov_b32_e32 v2, v11012; GCN-NEXT: s_and_saveexec_b64 s[10:11], s[4:5]1013; GCN-NEXT: s_cbranch_execz .LBB5_21014; GCN-NEXT: ; %bb.5: ; %bb41015; GCN-NEXT: ; in Loop: Header=BB5_3 Depth=11016; GCN-NEXT: buffer_load_dword v0, v0, s[0:3], 0 offen1017; GCN-NEXT: v_mov_b32_e32 v2, v11018; GCN-NEXT: v_mov_b32_e32 v3, v11019; GCN-NEXT: v_mov_b32_e32 v4, v11020; GCN-NEXT: v_mov_b32_e32 v5, v41021; GCN-NEXT: v_mov_b32_e32 v4, v31022; GCN-NEXT: v_mov_b32_e32 v3, v21023; GCN-NEXT: v_mov_b32_e32 v2, v11024; GCN-NEXT: s_waitcnt vmcnt(0)1025; GCN-NEXT: v_cmp_gt_f32_e64 s[6:7], 0, v01026; GCN-NEXT: s_and_saveexec_b64 s[12:13], s[6:7]1027; GCN-NEXT: s_cbranch_execz .LBB5_11028; GCN-NEXT: ; %bb.6: ; %bb81029; GCN-NEXT: ; in Loop: Header=BB5_3 Depth=11030; GCN-NEXT: v_mov_b32_e32 v5, v31031; GCN-NEXT: v_mov_b32_e32 v4, v21032; GCN-NEXT: v_mov_b32_e32 v3, v11033; GCN-NEXT: v_mov_b32_e32 v2, v01034; GCN-NEXT: s_branch .LBB5_11035; GCN-NEXT: .LBB5_7: ; %bb121036; GCN-NEXT: s_or_b64 exec, exec, s[8:9]1037; GCN-NEXT: buffer_store_dword v5, v0, s[0:3], 0 offen1038; GCN-NEXT: s_waitcnt vmcnt(0)1039; GCN-NEXT: buffer_store_dword v4, v0, s[0:3], 0 offen1040; GCN-NEXT: s_waitcnt vmcnt(0)1041; GCN-NEXT: buffer_store_dword v3, v0, s[0:3], 0 offen1042; GCN-NEXT: s_waitcnt vmcnt(0)1043; GCN-NEXT: buffer_store_dword v2, v0, s[0:3], 0 offen1044; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0)1045; GCN-NEXT: s_setpc_b64 s[30:31]1046;1047; GCN-O0-LABEL: scc_liveness:1048; GCN-O0: ; %bb.0: ; %bb1049; GCN-O0-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)1050; GCN-O0-NEXT: s_xor_saveexec_b64 s[4:5], -11051; GCN-O0-NEXT: buffer_store_dword v7, off, s[0:3], s32 offset:72 ; 4-byte Folded Spill1052; GCN-O0-NEXT: s_mov_b64 exec, s[4:5]1053; GCN-O0-NEXT: buffer_store_dword v0, off, s[0:3], s32 offset:4 ; 4-byte Folded Spill1054; GCN-O0-NEXT: s_mov_b64 s[4:5], 01055; GCN-O0-NEXT: s_mov_b64 s[6:7], s[4:5]1056; GCN-O0-NEXT: ; implicit-def: $vgpr7 : SGPR spill to VGPR lane1057; GCN-O0-NEXT: s_waitcnt expcnt(1)1058; GCN-O0-NEXT: v_writelane_b32 v7, s6, 01059; GCN-O0-NEXT: v_writelane_b32 v7, s7, 11060; GCN-O0-NEXT: v_writelane_b32 v7, s4, 21061; GCN-O0-NEXT: v_writelane_b32 v7, s5, 31062; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11063; GCN-O0-NEXT: buffer_store_dword v7, off, s[0:3], s32 ; 4-byte Folded Spill1064; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1065; GCN-O0-NEXT: .LBB5_1: ; %bb11066; GCN-O0-NEXT: ; =>This Inner Loop Header: Depth=11067; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11068; GCN-O0-NEXT: s_waitcnt expcnt(0)1069; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1070; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1071; GCN-O0-NEXT: s_waitcnt vmcnt(0)1072; GCN-O0-NEXT: v_readlane_b32 s8, v7, 21073; GCN-O0-NEXT: v_readlane_b32 s9, v7, 31074; GCN-O0-NEXT: v_readlane_b32 s6, v7, 01075; GCN-O0-NEXT: v_readlane_b32 s7, v7, 11076; GCN-O0-NEXT: v_writelane_b32 v7, s6, 41077; GCN-O0-NEXT: v_writelane_b32 v7, s7, 51078; GCN-O0-NEXT: buffer_load_dword v0, off, s[0:3], s32 offset:4 ; 4-byte Folded Reload1079; GCN-O0-NEXT: s_mov_b32 s4, 0x2071080; GCN-O0-NEXT: s_waitcnt vmcnt(0)1081; GCN-O0-NEXT: v_cmp_lt_i32_e64 s[4:5], v0, s41082; GCN-O0-NEXT: s_or_b64 s[4:5], s[4:5], s[8:9]1083; GCN-O0-NEXT: v_writelane_b32 v7, s4, 61084; GCN-O0-NEXT: v_writelane_b32 v7, s5, 71085; GCN-O0-NEXT: v_writelane_b32 v7, s6, 01086; GCN-O0-NEXT: v_writelane_b32 v7, s7, 11087; GCN-O0-NEXT: s_mov_b64 s[6:7], s[4:5]1088; GCN-O0-NEXT: v_writelane_b32 v7, s6, 21089; GCN-O0-NEXT: v_writelane_b32 v7, s7, 31090; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11091; GCN-O0-NEXT: buffer_store_dword v7, off, s[0:3], s32 ; 4-byte Folded Spill1092; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1093; GCN-O0-NEXT: s_andn2_b64 exec, exec, s[4:5]1094; GCN-O0-NEXT: s_cbranch_execnz .LBB5_11095; GCN-O0-NEXT: ; %bb.2: ; %bb21096; GCN-O0-NEXT: ; in Loop: Header=BB5_1 Depth=11097; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11098; GCN-O0-NEXT: s_waitcnt expcnt(0)1099; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1100; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1101; GCN-O0-NEXT: s_waitcnt vmcnt(0)1102; GCN-O0-NEXT: v_readlane_b32 s4, v7, 61103; GCN-O0-NEXT: v_readlane_b32 s5, v7, 71104; GCN-O0-NEXT: s_or_b64 exec, exec, s[4:5]1105; GCN-O0-NEXT: buffer_load_dword v0, off, s[0:3], s32 offset:4 ; 4-byte Folded Reload1106; GCN-O0-NEXT: s_mov_b32 s6, 01107; GCN-O0-NEXT: s_waitcnt vmcnt(0)1108; GCN-O0-NEXT: v_cmp_ne_u32_e64 s[4:5], v0, s61109; GCN-O0-NEXT: v_cmp_eq_u32_e64 s[6:7], v0, s61110; GCN-O0-NEXT: v_writelane_b32 v7, s4, 81111; GCN-O0-NEXT: v_writelane_b32 v7, s5, 91112; GCN-O0-NEXT: s_mov_b32 s4, 01113; GCN-O0-NEXT: v_mov_b32_e32 v0, s41114; GCN-O0-NEXT: v_mov_b32_e32 v6, s41115; GCN-O0-NEXT: v_mov_b32_e32 v5, s41116; GCN-O0-NEXT: v_mov_b32_e32 v4, s41117; GCN-O0-NEXT: ; kill: def $vgpr0 killed $vgpr0 def $vgpr0_vgpr1_vgpr2_vgpr3 killed $exec1118; GCN-O0-NEXT: v_mov_b32_e32 v1, v61119; GCN-O0-NEXT: v_mov_b32_e32 v2, v51120; GCN-O0-NEXT: v_mov_b32_e32 v3, v41121; GCN-O0-NEXT: buffer_store_dword v0, off, s[0:3], s32 offset:8 ; 4-byte Folded Spill1122; GCN-O0-NEXT: buffer_store_dword v1, off, s[0:3], s32 offset:12 ; 4-byte Folded Spill1123; GCN-O0-NEXT: buffer_store_dword v2, off, s[0:3], s32 offset:16 ; 4-byte Folded Spill1124; GCN-O0-NEXT: buffer_store_dword v3, off, s[0:3], s32 offset:20 ; 4-byte Folded Spill1125; GCN-O0-NEXT: s_mov_b64 s[4:5], exec1126; GCN-O0-NEXT: v_writelane_b32 v7, s4, 101127; GCN-O0-NEXT: v_writelane_b32 v7, s5, 111128; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11129; GCN-O0-NEXT: buffer_store_dword v7, off, s[0:3], s32 ; 4-byte Folded Spill1130; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1131; GCN-O0-NEXT: s_and_b64 s[4:5], s[4:5], s[6:7]1132; GCN-O0-NEXT: s_mov_b64 exec, s[4:5]1133; GCN-O0-NEXT: s_cbranch_execz .LBB5_51134; GCN-O0-NEXT: ; %bb.3: ; %bb41135; GCN-O0-NEXT: ; in Loop: Header=BB5_1 Depth=11136; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11137; GCN-O0-NEXT: s_waitcnt expcnt(0)1138; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1139; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1140; GCN-O0-NEXT: ; implicit-def: $sgpr41141; GCN-O0-NEXT: v_mov_b32_e32 v0, s41142; GCN-O0-NEXT: buffer_load_dword v0, v0, s[0:3], 0 offen1143; GCN-O0-NEXT: s_mov_b32 s4, 01144; GCN-O0-NEXT: s_waitcnt vmcnt(0)1145; GCN-O0-NEXT: v_cmp_lt_f32_e64 s[6:7], v0, s41146; GCN-O0-NEXT: v_mov_b32_e32 v0, s41147; GCN-O0-NEXT: v_mov_b32_e32 v6, s41148; GCN-O0-NEXT: v_mov_b32_e32 v5, s41149; GCN-O0-NEXT: v_mov_b32_e32 v4, s41150; GCN-O0-NEXT: ; kill: def $vgpr0 killed $vgpr0 def $vgpr0_vgpr1_vgpr2_vgpr3 killed $exec1151; GCN-O0-NEXT: v_mov_b32_e32 v1, v61152; GCN-O0-NEXT: v_mov_b32_e32 v2, v51153; GCN-O0-NEXT: v_mov_b32_e32 v3, v41154; GCN-O0-NEXT: buffer_store_dword v0, off, s[0:3], s32 offset:24 ; 4-byte Folded Spill1155; GCN-O0-NEXT: buffer_store_dword v1, off, s[0:3], s32 offset:28 ; 4-byte Folded Spill1156; GCN-O0-NEXT: buffer_store_dword v2, off, s[0:3], s32 offset:32 ; 4-byte Folded Spill1157; GCN-O0-NEXT: buffer_store_dword v3, off, s[0:3], s32 offset:36 ; 4-byte Folded Spill1158; GCN-O0-NEXT: s_mov_b64 s[4:5], exec1159; GCN-O0-NEXT: v_writelane_b32 v7, s4, 121160; GCN-O0-NEXT: v_writelane_b32 v7, s5, 131161; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11162; GCN-O0-NEXT: buffer_store_dword v7, off, s[0:3], s32 ; 4-byte Folded Spill1163; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1164; GCN-O0-NEXT: s_and_b64 s[4:5], s[4:5], s[6:7]1165; GCN-O0-NEXT: s_mov_b64 exec, s[4:5]1166; GCN-O0-NEXT: s_cbranch_execz .LBB5_61167; GCN-O0-NEXT: ; %bb.4: ; %bb81168; GCN-O0-NEXT: ; in Loop: Header=BB5_1 Depth=11169; GCN-O0-NEXT: s_mov_b32 s10, 01170; GCN-O0-NEXT: ; implicit-def: $sgpr41171; GCN-O0-NEXT: ; implicit-def: $sgpr51172; GCN-O0-NEXT: ; implicit-def: $sgpr91173; GCN-O0-NEXT: ; implicit-def: $sgpr51174; GCN-O0-NEXT: ; implicit-def: $sgpr81175; GCN-O0-NEXT: ; implicit-def: $sgpr51176; GCN-O0-NEXT: ; kill: def $sgpr4 killed $sgpr4 def $sgpr4_sgpr5_sgpr6_sgpr71177; GCN-O0-NEXT: s_mov_b32 s5, s101178; GCN-O0-NEXT: s_mov_b32 s6, s91179; GCN-O0-NEXT: s_mov_b32 s7, s81180; GCN-O0-NEXT: s_waitcnt expcnt(1)1181; GCN-O0-NEXT: v_mov_b32_e32 v0, s41182; GCN-O0-NEXT: v_mov_b32_e32 v1, s51183; GCN-O0-NEXT: v_mov_b32_e32 v2, s61184; GCN-O0-NEXT: v_mov_b32_e32 v3, s71185; GCN-O0-NEXT: buffer_store_dword v0, off, s[0:3], s32 offset:24 ; 4-byte Folded Spill1186; GCN-O0-NEXT: buffer_store_dword v1, off, s[0:3], s32 offset:28 ; 4-byte Folded Spill1187; GCN-O0-NEXT: buffer_store_dword v2, off, s[0:3], s32 offset:32 ; 4-byte Folded Spill1188; GCN-O0-NEXT: buffer_store_dword v3, off, s[0:3], s32 offset:36 ; 4-byte Folded Spill1189; GCN-O0-NEXT: s_branch .LBB5_61190; GCN-O0-NEXT: .LBB5_5: ; %Flow21191; GCN-O0-NEXT: ; in Loop: Header=BB5_1 Depth=11192; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11193; GCN-O0-NEXT: s_waitcnt expcnt(0)1194; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1195; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1196; GCN-O0-NEXT: s_waitcnt vmcnt(0)1197; GCN-O0-NEXT: v_readlane_b32 s4, v7, 101198; GCN-O0-NEXT: v_readlane_b32 s5, v7, 111199; GCN-O0-NEXT: s_or_b64 exec, exec, s[4:5]1200; GCN-O0-NEXT: buffer_load_dword v0, off, s[0:3], s32 offset:8 ; 4-byte Folded Reload1201; GCN-O0-NEXT: buffer_load_dword v1, off, s[0:3], s32 offset:12 ; 4-byte Folded Reload1202; GCN-O0-NEXT: buffer_load_dword v2, off, s[0:3], s32 offset:16 ; 4-byte Folded Reload1203; GCN-O0-NEXT: buffer_load_dword v3, off, s[0:3], s32 offset:20 ; 4-byte Folded Reload1204; GCN-O0-NEXT: s_waitcnt vmcnt(3)1205; GCN-O0-NEXT: buffer_store_dword v0, off, s[0:3], s32 offset:40 ; 4-byte Folded Spill1206; GCN-O0-NEXT: s_waitcnt vmcnt(3)1207; GCN-O0-NEXT: buffer_store_dword v1, off, s[0:3], s32 offset:44 ; 4-byte Folded Spill1208; GCN-O0-NEXT: s_waitcnt vmcnt(3)1209; GCN-O0-NEXT: buffer_store_dword v2, off, s[0:3], s32 offset:48 ; 4-byte Folded Spill1210; GCN-O0-NEXT: s_waitcnt vmcnt(3)1211; GCN-O0-NEXT: buffer_store_dword v3, off, s[0:3], s32 offset:52 ; 4-byte Folded Spill1212; GCN-O0-NEXT: s_branch .LBB5_71213; GCN-O0-NEXT: .LBB5_6: ; %Flow1214; GCN-O0-NEXT: ; in Loop: Header=BB5_1 Depth=11215; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11216; GCN-O0-NEXT: s_waitcnt expcnt(0)1217; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1218; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1219; GCN-O0-NEXT: s_waitcnt vmcnt(0)1220; GCN-O0-NEXT: v_readlane_b32 s4, v7, 121221; GCN-O0-NEXT: v_readlane_b32 s5, v7, 131222; GCN-O0-NEXT: s_or_b64 exec, exec, s[4:5]1223; GCN-O0-NEXT: buffer_load_dword v0, off, s[0:3], s32 offset:24 ; 4-byte Folded Reload1224; GCN-O0-NEXT: buffer_load_dword v1, off, s[0:3], s32 offset:28 ; 4-byte Folded Reload1225; GCN-O0-NEXT: buffer_load_dword v2, off, s[0:3], s32 offset:32 ; 4-byte Folded Reload1226; GCN-O0-NEXT: buffer_load_dword v3, off, s[0:3], s32 offset:36 ; 4-byte Folded Reload1227; GCN-O0-NEXT: s_waitcnt vmcnt(3)1228; GCN-O0-NEXT: buffer_store_dword v0, off, s[0:3], s32 offset:8 ; 4-byte Folded Spill1229; GCN-O0-NEXT: s_waitcnt vmcnt(3)1230; GCN-O0-NEXT: buffer_store_dword v1, off, s[0:3], s32 offset:12 ; 4-byte Folded Spill1231; GCN-O0-NEXT: s_waitcnt vmcnt(3)1232; GCN-O0-NEXT: buffer_store_dword v2, off, s[0:3], s32 offset:16 ; 4-byte Folded Spill1233; GCN-O0-NEXT: s_waitcnt vmcnt(3)1234; GCN-O0-NEXT: buffer_store_dword v3, off, s[0:3], s32 offset:20 ; 4-byte Folded Spill1235; GCN-O0-NEXT: s_branch .LBB5_51236; GCN-O0-NEXT: .LBB5_7: ; %bb101237; GCN-O0-NEXT: ; in Loop: Header=BB5_1 Depth=11238; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11239; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1240; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1241; GCN-O0-NEXT: s_waitcnt vmcnt(0)1242; GCN-O0-NEXT: v_readlane_b32 s6, v7, 81243; GCN-O0-NEXT: v_readlane_b32 s7, v7, 91244; GCN-O0-NEXT: s_mov_b64 s[4:5], -11245; GCN-O0-NEXT: v_writelane_b32 v7, s4, 141246; GCN-O0-NEXT: v_writelane_b32 v7, s5, 151247; GCN-O0-NEXT: s_mov_b64 s[4:5], exec1248; GCN-O0-NEXT: v_writelane_b32 v7, s4, 161249; GCN-O0-NEXT: v_writelane_b32 v7, s5, 171250; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11251; GCN-O0-NEXT: buffer_store_dword v7, off, s[0:3], s32 ; 4-byte Folded Spill1252; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1253; GCN-O0-NEXT: s_and_b64 s[4:5], s[4:5], s[6:7]1254; GCN-O0-NEXT: s_mov_b64 exec, s[4:5]1255; GCN-O0-NEXT: s_cbranch_execz .LBB5_91256; GCN-O0-NEXT: ; %bb.8: ; %Flow11257; GCN-O0-NEXT: ; in Loop: Header=BB5_1 Depth=11258; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11259; GCN-O0-NEXT: s_waitcnt expcnt(0)1260; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1261; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1262; GCN-O0-NEXT: s_mov_b64 s[4:5], 01263; GCN-O0-NEXT: s_xor_b64 s[4:5], exec, -11264; GCN-O0-NEXT: s_waitcnt vmcnt(0)1265; GCN-O0-NEXT: v_writelane_b32 v7, s4, 141266; GCN-O0-NEXT: v_writelane_b32 v7, s5, 151267; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11268; GCN-O0-NEXT: buffer_store_dword v7, off, s[0:3], s32 ; 4-byte Folded Spill1269; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1270; GCN-O0-NEXT: .LBB5_9: ; %Flow31271; GCN-O0-NEXT: ; in Loop: Header=BB5_1 Depth=11272; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11273; GCN-O0-NEXT: s_waitcnt expcnt(0)1274; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1275; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1276; GCN-O0-NEXT: s_waitcnt vmcnt(0)1277; GCN-O0-NEXT: v_readlane_b32 s8, v7, 161278; GCN-O0-NEXT: v_readlane_b32 s9, v7, 171279; GCN-O0-NEXT: s_or_b64 exec, exec, s[8:9]1280; GCN-O0-NEXT: v_readlane_b32 s6, v7, 41281; GCN-O0-NEXT: v_readlane_b32 s7, v7, 51282; GCN-O0-NEXT: v_readlane_b32 s4, v7, 141283; GCN-O0-NEXT: v_readlane_b32 s5, v7, 151284; GCN-O0-NEXT: buffer_load_dword v0, off, s[0:3], s32 offset:40 ; 4-byte Folded Reload1285; GCN-O0-NEXT: buffer_load_dword v1, off, s[0:3], s32 offset:44 ; 4-byte Folded Reload1286; GCN-O0-NEXT: buffer_load_dword v2, off, s[0:3], s32 offset:48 ; 4-byte Folded Reload1287; GCN-O0-NEXT: buffer_load_dword v3, off, s[0:3], s32 offset:52 ; 4-byte Folded Reload1288; GCN-O0-NEXT: s_and_b64 s[4:5], exec, s[4:5]1289; GCN-O0-NEXT: s_or_b64 s[4:5], s[4:5], s[6:7]1290; GCN-O0-NEXT: s_mov_b64 s[6:7], 01291; GCN-O0-NEXT: s_mov_b64 s[8:9], s[4:5]1292; GCN-O0-NEXT: v_writelane_b32 v7, s8, 01293; GCN-O0-NEXT: v_writelane_b32 v7, s9, 11294; GCN-O0-NEXT: v_writelane_b32 v7, s6, 21295; GCN-O0-NEXT: v_writelane_b32 v7, s7, 31296; GCN-O0-NEXT: s_mov_b64 s[6:7], s[4:5]1297; GCN-O0-NEXT: v_writelane_b32 v7, s6, 181298; GCN-O0-NEXT: v_writelane_b32 v7, s7, 191299; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11300; GCN-O0-NEXT: buffer_store_dword v7, off, s[0:3], s32 ; 4-byte Folded Spill1301; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1302; GCN-O0-NEXT: s_waitcnt vmcnt(4)1303; GCN-O0-NEXT: buffer_store_dword v0, off, s[0:3], s32 offset:56 ; 4-byte Folded Spill1304; GCN-O0-NEXT: s_waitcnt vmcnt(4)1305; GCN-O0-NEXT: buffer_store_dword v1, off, s[0:3], s32 offset:60 ; 4-byte Folded Spill1306; GCN-O0-NEXT: s_waitcnt vmcnt(4)1307; GCN-O0-NEXT: buffer_store_dword v2, off, s[0:3], s32 offset:64 ; 4-byte Folded Spill1308; GCN-O0-NEXT: s_waitcnt vmcnt(4)1309; GCN-O0-NEXT: buffer_store_dword v3, off, s[0:3], s32 offset:68 ; 4-byte Folded Spill1310; GCN-O0-NEXT: s_andn2_b64 exec, exec, s[4:5]1311; GCN-O0-NEXT: s_cbranch_execnz .LBB5_11312; GCN-O0-NEXT: ; %bb.10: ; %bb121313; GCN-O0-NEXT: s_or_saveexec_b64 s[14:15], -11314; GCN-O0-NEXT: s_waitcnt expcnt(4)1315; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 ; 4-byte Folded Reload1316; GCN-O0-NEXT: s_mov_b64 exec, s[14:15]1317; GCN-O0-NEXT: s_waitcnt vmcnt(0)1318; GCN-O0-NEXT: v_readlane_b32 s4, v7, 181319; GCN-O0-NEXT: v_readlane_b32 s5, v7, 191320; GCN-O0-NEXT: s_or_b64 exec, exec, s[4:5]1321; GCN-O0-NEXT: ; %bb.11: ; %bb121322; GCN-O0-NEXT: s_waitcnt expcnt(3)1323; GCN-O0-NEXT: buffer_load_dword v0, off, s[0:3], s32 offset:56 ; 4-byte Folded Reload1324; GCN-O0-NEXT: s_waitcnt expcnt(2)1325; GCN-O0-NEXT: buffer_load_dword v1, off, s[0:3], s32 offset:60 ; 4-byte Folded Reload1326; GCN-O0-NEXT: s_waitcnt expcnt(1)1327; GCN-O0-NEXT: buffer_load_dword v2, off, s[0:3], s32 offset:64 ; 4-byte Folded Reload1328; GCN-O0-NEXT: s_waitcnt expcnt(0)1329; GCN-O0-NEXT: buffer_load_dword v3, off, s[0:3], s32 offset:68 ; 4-byte Folded Reload1330; GCN-O0-NEXT: s_waitcnt vmcnt(0)1331; GCN-O0-NEXT: v_mov_b32_e32 v4, v31332; GCN-O0-NEXT: ; implicit-def: $sgpr41333; GCN-O0-NEXT: v_mov_b32_e32 v5, s41334; GCN-O0-NEXT: buffer_store_dword v4, v5, s[0:3], 0 offen1335; GCN-O0-NEXT: s_waitcnt vmcnt(0) expcnt(0)1336; GCN-O0-NEXT: v_mov_b32_e32 v4, v21337; GCN-O0-NEXT: ; implicit-def: $sgpr41338; GCN-O0-NEXT: v_mov_b32_e32 v5, s41339; GCN-O0-NEXT: buffer_store_dword v4, v5, s[0:3], 0 offen1340; GCN-O0-NEXT: s_waitcnt vmcnt(0) expcnt(0)1341; GCN-O0-NEXT: v_mov_b32_e32 v4, v11342; GCN-O0-NEXT: ; implicit-def: $sgpr41343; GCN-O0-NEXT: v_mov_b32_e32 v5, s41344; GCN-O0-NEXT: buffer_store_dword v4, v5, s[0:3], 0 offen1345; GCN-O0-NEXT: s_waitcnt vmcnt(0)1346; GCN-O0-NEXT: ; kill: def $vgpr0 killed $vgpr0 killed $vgpr0_vgpr1_vgpr2_vgpr3 killed $exec1347; GCN-O0-NEXT: ; implicit-def: $sgpr41348; GCN-O0-NEXT: v_mov_b32_e32 v1, s41349; GCN-O0-NEXT: buffer_store_dword v0, v1, s[0:3], 0 offen1350; GCN-O0-NEXT: s_waitcnt vmcnt(0)1351; GCN-O0-NEXT: s_xor_saveexec_b64 s[4:5], -11352; GCN-O0-NEXT: buffer_load_dword v7, off, s[0:3], s32 offset:72 ; 4-byte Folded Reload1353; GCN-O0-NEXT: s_mov_b64 exec, s[4:5]1354; GCN-O0-NEXT: s_waitcnt vmcnt(0) expcnt(0)1355; GCN-O0-NEXT: s_setpc_b64 s[30:31]1356bb:1357 br label %bb11358 1359bb1: ; preds = %Flow1, %bb1, %bb1360 %tmp = icmp slt i32 %arg, 5191361 br i1 %tmp, label %bb2, label %bb11362 1363bb2: ; preds = %bb11364 %tmp3 = icmp eq i32 %arg, 01365 br i1 %tmp3, label %bb4, label %bb101366 1367bb4: ; preds = %bb21368 %tmp6 = load float, ptr addrspace(5) poison1369 %tmp7 = fcmp olt float %tmp6, 0.01370 br i1 %tmp7, label %bb8, label %Flow1371 1372bb8: ; preds = %bb41373 %tmp9 = insertelement <4 x float> poison, float 0.0, i32 11374 br label %Flow1375 1376Flow: ; preds = %bb8, %bb41377 %tmp8 = phi <4 x float> [ %tmp9, %bb8 ], [ zeroinitializer, %bb4 ]1378 br label %bb101379 1380bb10: ; preds = %Flow, %bb21381 %tmp11 = phi <4 x float> [ zeroinitializer, %bb2 ], [ %tmp8, %Flow ]1382 br i1 %tmp3, label %bb12, label %Flow11383 1384Flow1: ; preds = %bb101385 br label %bb11386 1387bb12: ; preds = %bb101388 store volatile <4 x float> %tmp11, ptr addrspace(5) poison, align 161389 ret void1390}1391 1392declare i32 @llvm.amdgcn.workitem.id.x() #01393declare void @llvm.amdgcn.s.barrier() #11394 1395attributes #0 = { nounwind readnone speculatable }1396attributes #1 = { nounwind convergent }1397attributes #2 = { nounwind }1398 1399