[llvm] b379ab4 - [AMDGPU] Add VOP rematerialization test. NFC.
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 9 12:16:17 PDT 2021
Author: Stanislav Mekhanoshin
Date: 2021-07-09T12:16:08-07:00
New Revision: b379ab41937fe6b6e0969b8ebf0e51731ab6fb2a
URL: https://github.com/llvm/llvm-project/commit/b379ab41937fe6b6e0969b8ebf0e51731ab6fb2a
DIFF: https://github.com/llvm/llvm-project/commit/b379ab41937fe6b6e0969b8ebf0e51731ab6fb2a.diff
LOG: [AMDGPU] Add VOP rematerialization test. NFC.
Added:
llvm/test/CodeGen/AMDGPU/remat-vop.mir
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AMDGPU/remat-vop.mir b/llvm/test/CodeGen/AMDGPU/remat-vop.mir
new file mode 100644
index 000000000000..458964ea84cb
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/remat-vop.mir
@@ -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
+...
More information about the llvm-commits
mailing list