| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3 |
| ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1100 -< %s | FileCheck -check-prefix=GFX11-PAL-SDAG %s |
| ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1100 -< %s | FileCheck -check-prefix=GFX11-PAL-GISEL %s |
| ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1250 < %s | FileCheck -check-prefix=GFX1250-PAL %s |
| ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdpal -mcpu=gfx1250 < %s | FileCheck -check-prefix=GFX1250-PAL %s |
| ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -< %s | FileCheck -check-prefix=GFX11-HSA %s |
| ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 -< %s | FileCheck -check-prefix=GFX11-HSA %s |
| ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck -check-prefix=GFX1250-HSA %s |
| ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck -check-prefix=GFX1250-HSA %s |
| |
| define amdgpu_kernel void @caller_internal() { |
| ; GFX11-PAL-SDAG-LABEL: caller_internal: |
| ; GFX11-PAL-SDAG: ; %bb.0: |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s1, internal_func@abs32@hi |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s0, internal_func@abs32@lo |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s32, 0 |
| ; GFX11-PAL-SDAG-NEXT: s_swappc_b64 s[30:31], s[0:1] |
| ; GFX11-PAL-SDAG-NEXT: s_endpgm |
| ; |
| ; GFX11-PAL-GISEL-LABEL: caller_internal: |
| ; GFX11-PAL-GISEL: ; %bb.0: |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s0, internal_func@abs32@lo |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s1, internal_func@abs32@hi |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s32, 0 |
| ; GFX11-PAL-GISEL-NEXT: s_swappc_b64 s[30:31], s[0:1] |
| ; GFX11-PAL-GISEL-NEXT: s_endpgm |
| ; |
| ; GFX1250-PAL-LABEL: caller_internal: |
| ; GFX1250-PAL: ; %bb.0: |
| ; GFX1250-PAL-NEXT: s_mov_b64 s[0:1], internal_func@abs64 |
| ; GFX1250-PAL-NEXT: s_mov_b32 s32, 0 |
| ; GFX1250-PAL-NEXT: s_swap_pc_i64 s[30:31], s[0:1] |
| ; GFX1250-PAL-NEXT: s_endpgm |
| ; |
| ; GFX11-HSA-LABEL: caller_internal: |
| ; GFX11-HSA: ; %bb.0: |
| ; GFX11-HSA-NEXT: s_getpc_b64 s[0:1] |
| ; GFX11-HSA-NEXT: s_add_u32 s0, s0, internal_func@gotpcrel32@lo+4 |
| ; GFX11-HSA-NEXT: s_addc_u32 s1, s1, internal_func@gotpcrel32@hi+12 |
| ; GFX11-HSA-NEXT: s_mov_b32 s32, 0 |
| ; GFX11-HSA-NEXT: s_load_b64 s[0:1], s[0:1], 0x0 |
| ; GFX11-HSA-NEXT: s_waitcnt lgkmcnt(0) |
| ; GFX11-HSA-NEXT: s_swappc_b64 s[30:31], s[0:1] |
| ; GFX11-HSA-NEXT: s_endpgm |
| ; |
| ; GFX1250-HSA-LABEL: caller_internal: |
| ; GFX1250-HSA: ; %bb.0: |
| ; GFX1250-HSA-NEXT: s_get_pc_i64 s[0:1] |
| ; GFX1250-HSA-NEXT: s_add_nc_u64 s[0:1], s[0:1], internal_func@gotpcrel+4 |
| ; GFX1250-HSA-NEXT: s_mov_b32 s32, 0 |
| ; GFX1250-HSA-NEXT: s_load_b64 s[0:1], s[0:1], 0x0 |
| ; GFX1250-HSA-NEXT: s_wait_kmcnt 0x0 |
| ; GFX1250-HSA-NEXT: s_swap_pc_i64 s[30:31], s[0:1] |
| ; GFX1250-HSA-NEXT: s_endpgm |
| call amdgpu_gfx void @internal_func() |
| ret void |
| } |
| |
| define amdgpu_kernel void @caller_exterinal() { |
| ; GFX11-PAL-SDAG-LABEL: caller_exterinal: |
| ; GFX11-PAL-SDAG: ; %bb.0: |
| ; GFX11-PAL-SDAG-NEXT: v_mov_b32_e32 v31, v0 |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s12, s13 |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b64 s[10:11], s[6:7] |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b64 s[8:9], s[4:5] |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s17, external_func@abs32@hi |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s16, external_func@abs32@lo |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b64 s[4:5], s[0:1] |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b64 s[6:7], s[2:3] |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s13, s14 |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s14, s15 |
| ; GFX11-PAL-SDAG-NEXT: s_mov_b32 s32, 0 |
| ; GFX11-PAL-SDAG-NEXT: s_swappc_b64 s[30:31], s[16:17] |
| ; GFX11-PAL-SDAG-NEXT: s_endpgm |
| ; |
| ; GFX11-PAL-GISEL-LABEL: caller_exterinal: |
| ; GFX11-PAL-GISEL: ; %bb.0: |
| ; GFX11-PAL-GISEL-NEXT: v_mov_b32_e32 v31, v0 |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s12, s13 |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b64 s[10:11], s[6:7] |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b64 s[8:9], s[4:5] |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s16, external_func@abs32@lo |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s17, external_func@abs32@hi |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b64 s[4:5], s[0:1] |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b64 s[6:7], s[2:3] |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s13, s14 |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s14, s15 |
| ; GFX11-PAL-GISEL-NEXT: s_mov_b32 s32, 0 |
| ; GFX11-PAL-GISEL-NEXT: s_swappc_b64 s[30:31], s[16:17] |
| ; GFX11-PAL-GISEL-NEXT: s_endpgm |
| ; |
| ; GFX1250-PAL-LABEL: caller_exterinal: |
| ; GFX1250-PAL: ; %bb.0: |
| ; GFX1250-PAL-NEXT: v_mov_b32_e32 v31, v0 |
| ; GFX1250-PAL-NEXT: s_mov_b64 s[10:11], s[6:7] |
| ; GFX1250-PAL-NEXT: s_mov_b64 s[8:9], s[4:5] |
| ; GFX1250-PAL-NEXT: s_mov_b64 s[12:13], external_func@abs64 |
| ; GFX1250-PAL-NEXT: s_mov_b64 s[4:5], s[0:1] |
| ; GFX1250-PAL-NEXT: s_mov_b64 s[6:7], s[2:3] |
| ; GFX1250-PAL-NEXT: s_mov_b32 s32, 0 |
| ; GFX1250-PAL-NEXT: s_swap_pc_i64 s[30:31], s[12:13] |
| ; GFX1250-PAL-NEXT: s_endpgm |
| ; |
| ; GFX11-HSA-LABEL: caller_exterinal: |
| ; GFX11-HSA: ; %bb.0: |
| ; GFX11-HSA-NEXT: v_mov_b32_e32 v31, v0 |
| ; GFX11-HSA-NEXT: s_mov_b32 s12, s13 |
| ; GFX11-HSA-NEXT: s_mov_b64 s[10:11], s[6:7] |
| ; GFX11-HSA-NEXT: s_mov_b64 s[8:9], s[4:5] |
| ; GFX11-HSA-NEXT: s_getpc_b64 s[16:17] |
| ; GFX11-HSA-NEXT: s_add_u32 s16, s16, external_func@rel32@lo+4 |
| ; GFX11-HSA-NEXT: s_addc_u32 s17, s17, external_func@rel32@hi+12 |
| ; GFX11-HSA-NEXT: s_mov_b64 s[4:5], s[0:1] |
| ; GFX11-HSA-NEXT: s_mov_b64 s[6:7], s[2:3] |
| ; GFX11-HSA-NEXT: s_mov_b32 s13, s14 |
| ; GFX11-HSA-NEXT: s_mov_b32 s14, s15 |
| ; GFX11-HSA-NEXT: s_mov_b32 s32, 0 |
| ; GFX11-HSA-NEXT: s_swappc_b64 s[30:31], s[16:17] |
| ; GFX11-HSA-NEXT: s_endpgm |
| ; |
| ; GFX1250-HSA-LABEL: caller_exterinal: |
| ; GFX1250-HSA: ; %bb.0: |
| ; GFX1250-HSA-NEXT: v_mov_b32_e32 v31, v0 |
| ; GFX1250-HSA-NEXT: s_mov_b64 s[10:11], s[6:7] |
| ; GFX1250-HSA-NEXT: s_mov_b64 s[8:9], s[4:5] |
| ; GFX1250-HSA-NEXT: s_get_pc_i64 s[12:13] |
| ; GFX1250-HSA-NEXT: s_add_nc_u64 s[12:13], s[12:13], external_func@rel64+4 |
| ; GFX1250-HSA-NEXT: s_mov_b64 s[4:5], s[0:1] |
| ; GFX1250-HSA-NEXT: s_mov_b64 s[6:7], s[2:3] |
| ; GFX1250-HSA-NEXT: s_mov_b32 s32, 0 |
| ; GFX1250-HSA-NEXT: s_swap_pc_i64 s[30:31], s[12:13] |
| ; GFX1250-HSA-NEXT: s_endpgm |
| call void @external_func() |
| ret void |
| } |
| |
| declare amdgpu_gfx void @internal_func() |
| declare hidden void @external_func() |