comparison llvm/test/CodeGen/AMDGPU/flat-scratch-fold-fi.mir @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 5f17cb93ff66
children
comparison
equal deleted inserted replaced
232:70dce7da266c 236:c4bab56944e8
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -amdgpu-enable-flat-scratch -run-pass=si-fold-operands -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s 2 # RUN: llc -march=amdgcn -mcpu=gfx900 -mattr=+enable-flat-scratch -run-pass=si-fold-operands -verify-machineinstrs -o - %s | FileCheck -check-prefix=GCN %s
3 3
4 --- 4 ---
5 name: test_fold_fi_scratch_load_vgpr 5 name: test_fold_fi_scratch_load_vgpr
6 stack: 6 stack:
7 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 } 7 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
8 body: | 8 body: |
9 bb.0.entry: 9 bb.0.entry:
10 ; GCN-LABEL: name: test_fold_fi_scratch_load_vgpr 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) 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: S_ENDPGM 0 12 ; GCN-NEXT: S_ENDPGM 0
13 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec 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) 14 %1:vgpr_32 = SCRATCH_LOAD_DWORD %0:vgpr_32, 4, 0, implicit $exec, implicit $flat_scr :: (load (s32) from %stack.0, addrspace 5)
15 S_ENDPGM 0 15 S_ENDPGM 0
16 16
17 ... 17 ...
22 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 } 22 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
23 body: | 23 body: |
24 bb.0.entry: 24 bb.0.entry:
25 ; GCN-LABEL: name: test_fold_fi_scratch_load_sgpr 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) 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: S_ENDPGM 0 27 ; GCN-NEXT: S_ENDPGM 0
28 %0:sgpr_32 = S_MOV_B32 %stack.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) 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)
30 S_ENDPGM 0 30 S_ENDPGM 0
31 31
32 ... 32 ...
37 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 } 37 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
38 body: | 38 body: |
39 bb.0.entry: 39 bb.0.entry:
40 ; GCN-LABEL: name: test_fold_fi_scratch_store_vgpr 40 ; GCN-LABEL: name: test_fold_fi_scratch_store_vgpr
41 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF 41 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
42 ; GCN: SCRATCH_STORE_DWORD_SADDR [[DEF]], %stack.0, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5) 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: S_ENDPGM 0 43 ; GCN-NEXT: S_ENDPGM 0
44 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec 44 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
45 %1:vgpr_32 = IMPLICIT_DEF 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) 46 SCRATCH_STORE_DWORD %1:vgpr_32, %0:vgpr_32, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5)
47 S_ENDPGM 0 47 S_ENDPGM 0
48 48
54 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 } 54 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
55 body: | 55 body: |
56 bb.0.entry: 56 bb.0.entry:
57 ; GCN-LABEL: name: test_no_fold_fi_scratch_store_vgpr 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 58 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
59 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF 59 ; GCN-NEXT: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
60 ; GCN: SCRATCH_STORE_DWORD [[V_MOV_B32_e32_]], [[DEF]], 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5) 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: S_ENDPGM 0 61 ; GCN-NEXT: S_ENDPGM 0
62 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec 62 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
63 %1:vgpr_32 = IMPLICIT_DEF 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) 64 SCRATCH_STORE_DWORD %0:vgpr_32, %1:vgpr_32, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5)
65 S_ENDPGM 0 65 S_ENDPGM 0
66 66
72 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 } 72 - { id: 0, name: '', type: spill-slot, offset: 0, size: 4, alignment: 4 }
73 body: | 73 body: |
74 bb.0.entry: 74 bb.0.entry:
75 ; GCN-LABEL: name: test_fold_fi_scratch_store_sgpr 75 ; GCN-LABEL: name: test_fold_fi_scratch_store_sgpr
76 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF 76 ; GCN: [[DEF:%[0-9]+]]:vgpr_32 = IMPLICIT_DEF
77 ; GCN: SCRATCH_STORE_DWORD_SADDR [[DEF]], %stack.0, 4, 0, implicit $exec, implicit $flat_scr :: (store (s32) into %stack.0, addrspace 5) 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: S_ENDPGM 0 78 ; GCN-NEXT: S_ENDPGM 0
79 %0:sgpr_32 = S_MOV_B32 %stack.0 79 %0:sgpr_32 = S_MOV_B32 %stack.0
80 %1:vgpr_32 = IMPLICIT_DEF 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) 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)
82 S_ENDPGM 0 82 S_ENDPGM 0
83 83