brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · f776c22 Raw
56 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=si-insert-waitcnts %s -o - | FileCheck -check-prefix=GCN %s3# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -passes=si-insert-waitcnts %s -o - | FileCheck -check-prefix=GCN %s4 5# $sgpr30_sgpr31 will hold the return address. We need a waitcnt before SI_CALL so6# that the return address is not clobbered in the callee by the outstanding load.7 8--- |9  define amdgpu_kernel void @call_waw_waitcnt() #0 {10    %1 = call i32 @func()11    ret void12  }13 14  declare hidden i32 @func() #015 16  attributes #0 = { nounwind }17...18 19---20name:            call_waw_waitcnt21tracksRegLiveness: true22body:             |23  bb.0:24    liveins: $sgpr4_sgpr5, $sgpr7, $sgpr0_sgpr1_sgpr2_sgpr325 26    ; GCN-LABEL: name: call_waw_waitcnt27    ; GCN: liveins: $sgpr4_sgpr5, $sgpr7, $sgpr0_sgpr1_sgpr2_sgpr328    ; GCN-NEXT: {{  $}}29    ; GCN-NEXT: S_WAITCNT 030    ; GCN-NEXT: $sgpr30_sgpr31 = S_LOAD_DWORDX2_IMM $sgpr4_sgpr5, 0, 031    ; GCN-NEXT: $sgpr33 = S_MOV_B32 killed $sgpr732    ; GCN-NEXT: $flat_scr_lo = S_ADD_U32 killed $sgpr4, $sgpr33, implicit-def $scc33    ; GCN-NEXT: $flat_scr_hi = S_ADDC_U32 killed $sgpr5, 0, implicit-def $scc, implicit killed $scc34    ; GCN-NEXT: BUNDLE implicit-def $sgpr4_sgpr5, implicit-def $sgpr4, implicit-def $sgpr5, implicit-def $scc {35    ; GCN-NEXT:   $sgpr4_sgpr5 = S_GETPC_B6436    ; GCN-NEXT:   $sgpr4 = S_ADD_U32 internal $sgpr4, target-flags(amdgpu-rel32-lo) @func + 4, implicit-def $scc37    ; GCN-NEXT:   $sgpr5 = S_ADDC_U32 internal $sgpr5, target-flags(amdgpu-rel32-hi) @func + 4, implicit-def $scc, implicit internal $scc38    ; GCN-NEXT: }39    ; GCN-NEXT: $sgpr32 = S_MOV_B32 $sgpr3340    ; GCN-NEXT: S_WAITCNT 4927941    ; GCN-NEXT: dead $sgpr30_sgpr31 = SI_CALL killed renamable $sgpr4_sgpr5, @func, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit-def dead $vgpr042    ; GCN-NEXT: S_ENDPGM 043    $sgpr30_sgpr31 = S_LOAD_DWORDX2_IMM $sgpr4_sgpr5, 0, 044    $sgpr33 = S_MOV_B32 killed $sgpr745    $flat_scr_lo = S_ADD_U32 killed $sgpr4, $sgpr33, implicit-def $scc46    $flat_scr_hi = S_ADDC_U32 killed $sgpr5, 0, implicit-def $scc, implicit killed $scc47    BUNDLE implicit-def $sgpr4_sgpr5, implicit-def $sgpr4, implicit-def $sgpr5, implicit-def $scc {48      $sgpr4_sgpr5 = S_GETPC_B6449      $sgpr4 = S_ADD_U32 internal $sgpr4, target-flags(amdgpu-rel32-lo) @func + 4, implicit-def $scc50      $sgpr5 = S_ADDC_U32 internal $sgpr5, target-flags(amdgpu-rel32-hi) @func + 4, implicit-def $scc, implicit internal $scc51    }52    $sgpr32 = S_MOV_B32 $sgpr3353    dead $sgpr30_sgpr31 = SI_CALL killed renamable $sgpr4_sgpr5, @func, csr_amdgpu, implicit $sgpr0_sgpr1_sgpr2_sgpr3, implicit-def dead $vgpr054    S_ENDPGM 055...56