70 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2; RUN: llc -global-isel=0 -stop-after=finalize-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -o - %s | FileCheck -check-prefix=SDAG -enable-var-scope %s3; RUN: llc -global-isel=1 -stop-after=finalize-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -o - %s | FileCheck -check-prefix=GISEL -enable-var-scope %s4 5; Test that we don't explode on calls from shaders to functions with the C calling convention.6 7define amdgpu_ps void @amdgpu_ps_call_default_cc() {8 ; SDAG-LABEL: name: amdgpu_ps_call_default_cc9 ; SDAG: bb.0.main_body:10 ; SDAG-NEXT: S_ENDPGM 011 ;12 ; GISEL-LABEL: name: amdgpu_ps_call_default_cc13 ; GISEL: bb.1.main_body:14 ; GISEL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $scc, implicit-def $sgpr32, implicit $sgpr3215 ; GISEL-NEXT: [[DEF:%[0-9]+]]:sreg_64 = IMPLICIT_DEF16 ; GISEL-NEXT: [[DEF1:%[0-9]+]]:sreg_64 = IMPLICIT_DEF17 ; GISEL-NEXT: [[DEF2:%[0-9]+]]:sreg_32 = IMPLICIT_DEF18 ; GISEL-NEXT: [[COPY:%[0-9]+]]:sgpr_128 = COPY $sgpr96_sgpr97_sgpr98_sgpr9919 ; GISEL-NEXT: $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY]]20 ; GISEL-NEXT: $sgpr4_sgpr5 = COPY [[DEF]]21 ; GISEL-NEXT: $sgpr6_sgpr7 = COPY [[DEF]]22 ; GISEL-NEXT: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO 023 ; GISEL-NEXT: $sgpr8_sgpr9 = COPY [[S_MOV_B]]24 ; GISEL-NEXT: $sgpr10_sgpr11 = COPY [[DEF1]]25 ; GISEL-NEXT: $sgpr12 = COPY [[DEF2]]26 ; GISEL-NEXT: $sgpr13 = COPY [[DEF2]]27 ; GISEL-NEXT: $sgpr14 = COPY [[DEF2]]28 ; GISEL-NEXT: $sgpr15 = COPY [[DEF2]]29 ; GISEL-NEXT: $vgpr31 = COPY [[DEF2]]30 ; GISEL-NEXT: [[S_MOV_B1:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO 031 ; GISEL-NEXT: $sgpr30_sgpr31 = noconvergent SI_CALL [[S_MOV_B1]], 0, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $sgpr15, implicit $vgpr3132 ; GISEL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $scc, implicit-def $sgpr32, implicit $sgpr3233 ; GISEL-NEXT: S_ENDPGM 034main_body:35 call void null()36 ret void37}38 39define amdgpu_gfx void @amdgpu_gfx_call_default_cc() {40 ; SDAG-LABEL: name: amdgpu_gfx_call_default_cc41 ; SDAG: bb.0.main_body:42 ; SDAG-NEXT: SI_RETURN43 ;44 ; GISEL-LABEL: name: amdgpu_gfx_call_default_cc45 ; GISEL: bb.1.main_body:46 ; GISEL-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $scc, implicit-def $sgpr32, implicit $sgpr3247 ; GISEL-NEXT: [[DEF:%[0-9]+]]:sreg_64 = IMPLICIT_DEF48 ; GISEL-NEXT: [[DEF1:%[0-9]+]]:sreg_64 = IMPLICIT_DEF49 ; GISEL-NEXT: [[DEF2:%[0-9]+]]:sreg_32 = IMPLICIT_DEF50 ; GISEL-NEXT: [[COPY:%[0-9]+]]:sgpr_128 = COPY $sgpr0_sgpr1_sgpr2_sgpr351 ; GISEL-NEXT: $sgpr0_sgpr1_sgpr2_sgpr3 = COPY [[COPY]]52 ; GISEL-NEXT: $sgpr4_sgpr5 = COPY [[DEF]]53 ; GISEL-NEXT: $sgpr6_sgpr7 = COPY [[DEF]]54 ; GISEL-NEXT: [[S_MOV_B:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO 055 ; GISEL-NEXT: $sgpr8_sgpr9 = COPY [[S_MOV_B]]56 ; GISEL-NEXT: $sgpr10_sgpr11 = COPY [[DEF1]]57 ; GISEL-NEXT: $sgpr12 = COPY [[DEF2]]58 ; GISEL-NEXT: $sgpr13 = COPY [[DEF2]]59 ; GISEL-NEXT: $sgpr14 = COPY [[DEF2]]60 ; GISEL-NEXT: $sgpr15 = COPY [[DEF2]]61 ; GISEL-NEXT: $vgpr31 = COPY [[DEF2]]62 ; GISEL-NEXT: [[S_MOV_B1:%[0-9]+]]:sreg_64 = S_MOV_B64_IMM_PSEUDO 063 ; GISEL-NEXT: $sgpr30_sgpr31 = noconvergent SI_CALL [[S_MOV_B1]], 0, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit $sgpr4_sgpr5, implicit $sgpr6_sgpr7, implicit $sgpr8_sgpr9, implicit $sgpr10_sgpr11, implicit $sgpr12, implicit $sgpr13, implicit $sgpr14, implicit $sgpr15, implicit $vgpr3164 ; GISEL-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $scc, implicit-def $sgpr32, implicit $sgpr3265 ; GISEL-NEXT: SI_RETURN66main_body:67 call void null()68 ret void69}70