1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+enable-flat-scratch -run-pass=si-fold-operands -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s
5 name: test_fold_fi_scratch_load_vgpr
7 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
10 ; GCN-LABEL: name: test_fold_fi_scratch_load_vgpr
11 ; GCN: [[SCRATCH_LOAD_DWORD_SADDR:%[0-9]+]]:vgpr_32 = SCRATCH_LOAD_DWORD_SADDR %stack.0, 4, 0, implicit $exec, implicit $flat_scr :: (load (s32) from %stack.0, addrspace 5)
12 ; GCN-NEXT: S_ENDPGM 0
13 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
14 %1:vgpr_32 = SCRATCH_LOAD_DWORD %0:vgpr_32, 4, 0, implicit $exec, implicit $flat_scr :: (load (s32) from %stack.0, addrspace 5)
20 name: test_fold_fi_scratch_load_sgpr
22 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
25 ; GCN-LABEL: name: test_fold_fi_scratch_load_sgpr
26 ; GCN: [[SCRATCH_LOAD_DWORD_SADDR:%[0-9]+]]:vgpr_32 = SCRATCH_LOAD_DWORD_SADDR %stack.0, 4, 0, implicit $exec, implicit $flat_scr :: (load (s32) from %stack.0, addrspace 5)
27 ; GCN-NEXT: S_ENDPGM 0
28 %0:sgpr_32 = S_MOV_B32 %stack.0
29 %1:vgpr_32 = SCRATCH_LOAD_DWORD_SADDR %0:sgpr_32, 4, 0, implicit $exec, implicit $flat_scr :: (load (s32) from %stack.0, addrspace 5)
35 name: test_fold_fi_scratch_store_vgpr
37 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
40 ; GCN-LABEL: name: test_fold_fi_scratch_store_vgpr
41 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
42 ; GCN-NEXT: SCRATCH_STORE_DWORD_SADDR [[DEF]], %stack.0, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5)
43 ; GCN-NEXT: S_ENDPGM 0
44 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
45 %1:vgpr_32 = IMPLICIT_DEF
46 SCRATCH_STORE_DWORD %1:vgpr_32, %0:vgpr_32, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5)
52 name: test_no_fold_fi_scratch_store_vgpr
54 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
57 ; GCN-LABEL: name: test_no_fold_fi_scratch_store_vgpr
58 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
59 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
60 ; GCN-NEXT: SCRATCH_STORE_DWORD [[V_MOV_B32_e32_]], [[DEF]], 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5)
61 ; GCN-NEXT: S_ENDPGM 0
62 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
63 %1:vgpr_32 = IMPLICIT_DEF
64 SCRATCH_STORE_DWORD %0:vgpr_32, %1:vgpr_32, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5)
70 name: test_fold_fi_scratch_store_sgpr
72 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
75 ; GCN-LABEL: name: test_fold_fi_scratch_store_sgpr
76 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
77 ; GCN-NEXT: SCRATCH_STORE_DWORD_SADDR [[DEF]], %stack.0, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5)
78 ; GCN-NEXT: S_ENDPGM 0
79 %0:sgpr_32 = S_MOV_B32 %stack.0
80 %1:vgpr_32 = IMPLICIT_DEF
81 SCRATCH_STORE_DWORD_SADDR %1:vgpr_32, %0:sgpr_32, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5)