|
| 1 | +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py |
| 2 | +# RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass=postra-machine-sink -mattr=-wavefrontsize32,+wavefrontsize64 -o - %s | FileCheck -check-prefixes=GFX10 %s |
| 3 | + |
| 4 | +# Ensure that PostRA Machine Sink does not sink instructions |
| 5 | +# past block prologues which would overwrite their uses. |
| 6 | + |
| 7 | +--- |
| 8 | +name: _amdgpu_ps_main |
| 9 | +alignment: 1 |
| 10 | +tracksRegLiveness: true |
| 11 | +registers: [] |
| 12 | +liveins: |
| 13 | + - { reg: '$sgpr4', virtual-reg: '' } |
| 14 | +body: | |
| 15 | + ; GFX10-LABEL: name: _amdgpu_ps_main |
| 16 | + ; GFX10: bb.0: |
| 17 | + ; GFX10-NEXT: successors: %bb.1(0x80000000) |
| 18 | + ; GFX10-NEXT: liveins: $sgpr4 |
| 19 | + ; GFX10-NEXT: {{ $}} |
| 20 | + ; GFX10-NEXT: renamable $vgpr5 = IMPLICIT_DEF |
| 21 | + ; GFX10-NEXT: renamable $sgpr0_sgpr1 = nofpexcept V_CMP_NGT_F32_e64 0, 0, 0, $vgpr5, 0, implicit $mode, implicit $exec |
| 22 | + ; GFX10-NEXT: S_BRANCH %bb.1 |
| 23 | + ; GFX10-NEXT: {{ $}} |
| 24 | + ; GFX10-NEXT: bb.1: |
| 25 | + ; GFX10-NEXT: successors: %bb.2(0x40000000), %bb.3(0x40000000) |
| 26 | + ; GFX10-NEXT: liveins: $sgpr4:0x0000000000000003, $sgpr6, $sgpr0_sgpr1 |
| 27 | + ; GFX10-NEXT: {{ $}} |
| 28 | + ; GFX10-NEXT: $sgpr4_sgpr5 = S_AND_SAVEEXEC_B64 $sgpr0_sgpr1, implicit-def $exec, implicit-def $scc, implicit $exec |
| 29 | + ; GFX10-NEXT: renamable $sgpr9 = COPY $sgpr4 |
| 30 | + ; GFX10-NEXT: renamable $sgpr14_sgpr15 = S_XOR_B64 $exec, killed renamable $sgpr4_sgpr5, implicit-def dead $scc |
| 31 | + ; GFX10-NEXT: S_CBRANCH_EXECZ %bb.3, implicit $exec |
| 32 | + ; GFX10-NEXT: S_BRANCH %bb.2 |
| 33 | + ; GFX10-NEXT: {{ $}} |
| 34 | + ; GFX10-NEXT: bb.2: |
| 35 | + ; GFX10-NEXT: successors: %bb.3(0x80000000) |
| 36 | + ; GFX10-NEXT: liveins: $sgpr6 |
| 37 | + ; GFX10-NEXT: {{ $}} |
| 38 | + ; GFX10-NEXT: $m0 = COPY killed renamable $sgpr6 |
| 39 | + ; GFX10-NEXT: S_BRANCH %bb.3 |
| 40 | + ; GFX10-NEXT: {{ $}} |
| 41 | + ; GFX10-NEXT: bb.3: |
| 42 | + ; GFX10-NEXT: S_ENDPGM 0 |
| 43 | + bb.0: |
| 44 | + successors: %bb.1(0x80000000) |
| 45 | + liveins: $sgpr4 |
| 46 | +
|
| 47 | + renamable $sgpr9 = COPY $sgpr4 |
| 48 | + renamable $vgpr5 = IMPLICIT_DEF |
| 49 | + renamable $sgpr0_sgpr1 = nofpexcept V_CMP_NGT_F32_e64 0, 0, 0, $vgpr5, 0, implicit $mode, implicit $exec |
| 50 | + S_BRANCH %bb.1 |
| 51 | +
|
| 52 | + bb.1: |
| 53 | + successors: %bb.2(0x40000000), %bb.8(0x40000000) |
| 54 | + liveins: $sgpr6, $sgpr9, $sgpr0_sgpr1 |
| 55 | +
|
| 56 | + $sgpr4_sgpr5 = S_AND_SAVEEXEC_B64 $sgpr0_sgpr1, implicit-def $exec, implicit-def $scc, implicit $exec |
| 57 | + renamable $sgpr14_sgpr15 = S_XOR_B64 $exec, killed renamable $sgpr4_sgpr5, implicit-def dead $scc |
| 58 | + S_CBRANCH_EXECZ %bb.8, implicit $exec |
| 59 | + S_BRANCH %bb.2 |
| 60 | +
|
| 61 | + bb.2: |
| 62 | + successors: %bb.8(0x40000000) |
| 63 | + liveins: $sgpr6 |
| 64 | +
|
| 65 | + $m0 = COPY killed renamable $sgpr6 |
| 66 | + S_BRANCH %bb.8 |
| 67 | +
|
| 68 | + bb.8: |
| 69 | +
|
| 70 | + S_ENDPGM 0 |
| 71 | +
|
| 72 | +... |
0 commit comments