117 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck %s -check-prefix=GFX93; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 < %s | FileCheck %s -check-prefix=GFX124 5; We have an indirect call with a known set of callees, which are6; known to not need any special inputs. The ABI still needs to use the7; register8 9; FIXME: Passing real values for workitem ID, and 0s that can be undef10 11define amdgpu_kernel void @indirect_call_known_no_special_inputs() {12; GFX9-LABEL: indirect_call_known_no_special_inputs:13; GFX9: ; %bb.0: ; %bb14; GFX9-NEXT: s_add_u32 flat_scratch_lo, s12, s1715; GFX9-NEXT: s_addc_u32 flat_scratch_hi, s13, 016; GFX9-NEXT: s_add_u32 s0, s0, s1717; GFX9-NEXT: s_addc_u32 s1, s1, 018; GFX9-NEXT: s_mov_b32 s13, s1519; GFX9-NEXT: s_mov_b32 s12, s1420; GFX9-NEXT: s_mov_b64 s[14:15], 021; GFX9-NEXT: s_load_dword s17, s[14:15], 0x022; GFX9-NEXT: s_getpc_b64 s[14:15]23; GFX9-NEXT: s_add_u32 s14, s14, wobble@gotpcrel32@lo+424; GFX9-NEXT: s_addc_u32 s15, s15, wobble@gotpcrel32@hi+1225; GFX9-NEXT: s_getpc_b64 s[18:19]26; GFX9-NEXT: s_add_u32 s18, s18, snork@gotpcrel32@lo+427; GFX9-NEXT: s_addc_u32 s19, s19, snork@gotpcrel32@hi+1228; GFX9-NEXT: s_load_dwordx2 s[20:21], s[18:19], 0x029; GFX9-NEXT: s_load_dwordx2 s[22:23], s[14:15], 0x030; GFX9-NEXT: v_lshlrev_b32_e32 v2, 20, v231; GFX9-NEXT: s_waitcnt lgkmcnt(0)32; GFX9-NEXT: s_and_b32 s14, 1, s1733; GFX9-NEXT: s_cmp_eq_u32 s14, 134; GFX9-NEXT: v_lshlrev_b32_e32 v1, 10, v135; GFX9-NEXT: s_cselect_b32 s19, s23, s2136; GFX9-NEXT: s_cselect_b32 s18, s22, s2037; GFX9-NEXT: v_or3_b32 v31, v0, v1, v238; GFX9-NEXT: s_mov_b32 s14, s1639; GFX9-NEXT: v_mov_b32_e32 v1, 040; GFX9-NEXT: v_mov_b32_e32 v4, 041; GFX9-NEXT: s_mov_b32 s32, 042; GFX9-NEXT: s_swappc_b64 s[30:31], s[18:19]43; GFX9-NEXT: s_endpgm44;45; GFX12-LABEL: indirect_call_known_no_special_inputs:46; GFX12: ; %bb.0: ; %bb47; GFX12-NEXT: s_mov_b64 s[10:11], s[6:7]48; GFX12-NEXT: s_getpc_b64 s[6:7]49; GFX12-NEXT: s_sext_i32_i16 s7, s750; GFX12-NEXT: s_add_co_u32 s6, s6, snork@gotpcrel32@lo+851; GFX12-NEXT: s_add_co_ci_u32 s7, s7, snork@gotpcrel32@hi+1652; GFX12-NEXT: s_mov_b64 s[8:9], s[4:5]53; GFX12-NEXT: s_mov_b64 s[4:5], 054; GFX12-NEXT: s_getpc_b64 s[12:13]55; GFX12-NEXT: s_sext_i32_i16 s13, s1356; GFX12-NEXT: s_add_co_u32 s12, s12, wobble@gotpcrel32@lo+857; GFX12-NEXT: s_add_co_ci_u32 s13, s13, wobble@gotpcrel32@hi+1658; GFX12-NEXT: s_load_u8 s14, s[4:5], 0x059; GFX12-NEXT: s_load_b64 s[4:5], s[6:7], 0x060; GFX12-NEXT: s_load_b64 s[6:7], s[12:13], 0x061; GFX12-NEXT: v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v4, 062; GFX12-NEXT: v_mov_b32_e32 v31, v063; GFX12-NEXT: s_mov_b32 s32, 064; GFX12-NEXT: s_wait_kmcnt 0x065; GFX12-NEXT: s_and_b32 s12, 1, s1466; GFX12-NEXT: s_delay_alu instid0(SALU_CYCLE_1)67; GFX12-NEXT: s_cmp_eq_u32 s12, 168; GFX12-NEXT: s_cselect_b32 s13, s7, s569; GFX12-NEXT: s_cselect_b32 s12, s6, s470; GFX12-NEXT: s_mov_b64 s[4:5], s[0:1]71; GFX12-NEXT: s_mov_b64 s[6:7], s[2:3]72; GFX12-NEXT: s_swappc_b64 s[30:31], s[12:13]73; GFX12-NEXT: s_endpgm74 75bb:76 %cond = load i1, ptr addrspace(4) null77 %tmp = select i1 %cond, ptr @wobble, ptr @snork78 call void %tmp(ptr poison, i32 poison, ptr poison)79 ret void80}81 82define void @wobble() {83; GFX9-LABEL: wobble:84; GFX9: ; %bb.0: ; %bb85; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)86; GFX9-NEXT: s_setpc_b64 s[30:31]87;88; GFX12-LABEL: wobble:89; GFX12: ; %bb.0: ; %bb90; GFX12-NEXT: s_wait_loadcnt_dscnt 0x091; GFX12-NEXT: s_wait_expcnt 0x092; GFX12-NEXT: s_wait_samplecnt 0x093; GFX12-NEXT: s_wait_bvhcnt 0x094; GFX12-NEXT: s_wait_kmcnt 0x095; GFX12-NEXT: s_setpc_b64 s[30:31]96bb:97 ret void98}99 100define void @snork() {101; GFX9-LABEL: snork:102; GFX9: ; %bb.0: ; %bb103; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)104; GFX9-NEXT: s_setpc_b64 s[30:31]105;106; GFX12-LABEL: snork:107; GFX12: ; %bb.0: ; %bb108; GFX12-NEXT: s_wait_loadcnt_dscnt 0x0109; GFX12-NEXT: s_wait_expcnt 0x0110; GFX12-NEXT: s_wait_samplecnt 0x0111; GFX12-NEXT: s_wait_bvhcnt 0x0112; GFX12-NEXT: s_wait_kmcnt 0x0113; GFX12-NEXT: s_setpc_b64 s[30:31]114bb:115 ret void116}117