1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[AMDGPU] Add VOP rematerialization test. NFC.

This commit is contained in:
Stanislav Mekhanoshin 2021-07-09 12:08:45 -07:00
parent c66ba11a1e
commit a921ab174a

View File

@ -0,0 +1,125 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -verify-machineinstrs --stress-regalloc=2 -start-before=greedy -stop-after=virtregrewriter -o - %s | FileCheck -check-prefix=GCN %s
---
name: test_remat_v_mov_b32_e32
tracksRegLiveness: true
body: |
bb.0:
; GCN-LABEL: name: test_remat_v_mov_b32_e32
; GCN: renamable $vgpr0 = V_MOV_B32_e32 1, implicit $exec
; GCN: renamable $vgpr1 = V_MOV_B32_e32 2, implicit $exec
; GCN: S_NOP 0, implicit killed renamable $vgpr0
; GCN: S_NOP 0, implicit killed renamable $vgpr1
; GCN: renamable $vgpr0 = V_MOV_B32_e32 3, implicit $exec
; GCN: S_NOP 0, implicit killed renamable $vgpr0
; GCN: S_ENDPGM 0
%0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec
%1:vgpr_32 = V_MOV_B32_e32 2, implicit $exec
%2:vgpr_32 = V_MOV_B32_e32 3, implicit $exec
S_NOP 0, implicit %0
S_NOP 0, implicit %1
S_NOP 0, implicit %2
S_ENDPGM 0
...
---
name: test_no_remat_v_mov_b32_e32_impuse
tracksRegLiveness: true
machineFunctionInfo:
stackPtrOffsetReg: $sgpr32
body: |
bb.0:
; GCN-LABEL: name: test_no_remat_v_mov_b32_e32_impuse
; GCN: $m0 = IMPLICIT_DEF
; GCN: renamable $vgpr0 = V_MOV_B32_e32 1, implicit $exec, implicit $m0
; GCN: SI_SPILL_V32_SAVE killed $vgpr0, %stack.1, $sgpr32, 0, implicit $exec :: (store (s32) into %stack.1, addrspace 5)
; GCN: renamable $vgpr1 = V_MOV_B32_e32 2, implicit $exec, implicit $m0
; GCN: renamable $vgpr0 = V_MOV_B32_e32 3, implicit $exec, implicit $m0
; GCN: SI_SPILL_V32_SAVE killed $vgpr0, %stack.0, $sgpr32, 0, implicit $exec :: (store (s32) into %stack.0, addrspace 5)
; GCN: renamable $vgpr0 = SI_SPILL_V32_RESTORE %stack.1, $sgpr32, 0, implicit $exec :: (load (s32) from %stack.1, addrspace 5)
; GCN: S_NOP 0, implicit killed renamable $vgpr0
; GCN: S_NOP 0, implicit killed renamable $vgpr1
; GCN: renamable $vgpr0 = SI_SPILL_V32_RESTORE %stack.0, $sgpr32, 0, implicit $exec :: (load (s32) from %stack.0, addrspace 5)
; GCN: S_NOP 0, implicit killed renamable $vgpr0
; GCN: S_ENDPGM 0
$m0 = IMPLICIT_DEF
%0:vgpr_32 = V_MOV_B32_e32 1, implicit $exec, implicit $m0
%1:vgpr_32 = V_MOV_B32_e32 2, implicit $exec, implicit $m0
%2:vgpr_32 = V_MOV_B32_e32 3, implicit $exec, implicit $m0
S_NOP 0, implicit %0
S_NOP 0, implicit %1
S_NOP 0, implicit %2
S_ENDPGM 0
...
---
name: test_remat_v_mov_b32_e64
tracksRegLiveness: true
body: |
bb.0:
; GCN-LABEL: name: test_remat_v_mov_b32_e64
; GCN: renamable $vgpr0 = V_MOV_B32_e64 1, implicit $exec
; GCN: renamable $vgpr1 = V_MOV_B32_e64 2, implicit $exec
; GCN: S_NOP 0, implicit killed renamable $vgpr0
; GCN: S_NOP 0, implicit killed renamable $vgpr1
; GCN: renamable $vgpr0 = V_MOV_B32_e64 3, implicit $exec
; GCN: S_NOP 0, implicit killed renamable $vgpr0
; GCN: S_ENDPGM 0
%0:vgpr_32 = V_MOV_B32_e64 1, implicit $exec
%1:vgpr_32 = V_MOV_B32_e64 2, implicit $exec
%2:vgpr_32 = V_MOV_B32_e64 3, implicit $exec
S_NOP 0, implicit %0
S_NOP 0, implicit %1
S_NOP 0, implicit %2
S_ENDPGM 0
...
---
name: test_remat_v_accvgpr_write_b32
tracksRegLiveness: true
body: |
bb.0:
; GCN-LABEL: name: test_remat_v_accvgpr_write_b32
; GCN: renamable $agpr0 = V_ACCVGPR_WRITE_B32_e64 1, implicit $exec
; GCN: renamable $agpr1 = V_ACCVGPR_WRITE_B32_e64 2, implicit $exec
; GCN: S_NOP 0, implicit killed renamable $agpr0
; GCN: S_NOP 0, implicit killed renamable $agpr1
; GCN: renamable $agpr0 = V_ACCVGPR_WRITE_B32_e64 3, implicit $exec
; GCN: S_NOP 0, implicit killed renamable $agpr0
; GCN: S_ENDPGM 0
%0:agpr_32 = V_ACCVGPR_WRITE_B32_e64 1, implicit $exec
%1:agpr_32 = V_ACCVGPR_WRITE_B32_e64 2, implicit $exec
%2:agpr_32 = V_ACCVGPR_WRITE_B32_e64 3, implicit $exec
S_NOP 0, implicit %0
S_NOP 0, implicit %1
S_NOP 0, implicit %2
S_ENDPGM 0
...
# FIXME: V_MOV_B64_PSEUDO is not rematerializable
---
name: test_remat_v_mov_b64_pseudo
tracksRegLiveness: true
machineFunctionInfo:
stackPtrOffsetReg: $sgpr32
body: |
bb.0:
; GCN-LABEL: name: test_remat_v_mov_b64_pseudo
; GCN: renamable $vgpr0_vgpr1 = V_MOV_B64_PSEUDO 1, implicit $exec
; GCN: SI_SPILL_V64_SAVE killed $vgpr0_vgpr1, %stack.1, $sgpr32, 0, implicit $exec :: (store (s64) into %stack.1, align 4, addrspace 5)
; GCN: renamable $vgpr0_vgpr1 = V_MOV_B64_PSEUDO 2, implicit $exec
; GCN: SI_SPILL_V64_SAVE killed $vgpr0_vgpr1, %stack.0, $sgpr32, 0, implicit $exec :: (store (s64) into %stack.0, align 4, addrspace 5)
; GCN: renamable $vgpr0_vgpr1 = V_MOV_B64_PSEUDO 3, implicit $exec
; GCN: SI_SPILL_V64_SAVE killed $vgpr0_vgpr1, %stack.2, $sgpr32, 0, implicit $exec :: (store (s64) into %stack.2, align 4, addrspace 5)
; GCN: renamable $vgpr0_vgpr1 = SI_SPILL_V64_RESTORE %stack.1, $sgpr32, 0, implicit $exec :: (load (s64) from %stack.1, align 4, addrspace 5)
; GCN: S_NOP 0, implicit killed renamable $vgpr0_vgpr1
; GCN: renamable $vgpr0_vgpr1 = SI_SPILL_V64_RESTORE %stack.0, $sgpr32, 0, implicit $exec :: (load (s64) from %stack.0, align 4, addrspace 5)
; GCN: S_NOP 0, implicit killed renamable $vgpr0_vgpr1
; GCN: renamable $vgpr0_vgpr1 = SI_SPILL_V64_RESTORE %stack.2, $sgpr32, 0, implicit $exec :: (load (s64) from %stack.2, align 4, addrspace 5)
; GCN: S_NOP 0, implicit killed renamable $vgpr0_vgpr1
; GCN: S_ENDPGM 0
%0:vreg_64 = V_MOV_B64_PSEUDO 1, implicit $exec
%1:vreg_64 = V_MOV_B64_PSEUDO 2, implicit $exec
%2:vreg_64 = V_MOV_B64_PSEUDO 3, implicit $exec
S_NOP 0, implicit %0
S_NOP 0, implicit %1
S_NOP 0, implicit %2
S_ENDPGM 0
...