@@ -9,14 +9,15 @@ target triple = "amdgcn-amd-amdhsa"
9
9
define amdgpu_kernel void @use_private_to_flat_addrspacecast (ptr addrspace (5 ) %ptr ) {
10
10
; GFX1250-SDAG-LABEL: use_private_to_flat_addrspacecast:
11
11
; GFX1250-SDAG: ; %bb.0:
12
- ; GFX1250-SDAG-NEXT: s_load_b32 s0 , s[4:5], 0x24
12
+ ; GFX1250-SDAG-NEXT: s_load_b32 s2 , s[4:5], 0x24
13
13
; GFX1250-SDAG-NEXT: v_mbcnt_lo_u32_b32 v0, -1, 0
14
+ ; GFX1250-SDAG-NEXT: s_mov_b64 s[0:1], src_flat_scratch_base_lo
14
15
; GFX1250-SDAG-NEXT: s_wait_kmcnt 0x0
15
16
; GFX1250-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
16
- ; GFX1250-SDAG-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_lshlrev_b32 v1, 20, v0
17
- ; GFX1250-SDAG-NEXT: s_cmp_lg_u32 s0 , -1
17
+ ; GFX1250-SDAG-NEXT: v_dual_mov_b32 v0, s2 :: v_dual_lshlrev_b32 v1, 20, v0
18
+ ; GFX1250-SDAG-NEXT: s_cmp_lg_u32 s2 , -1
18
19
; GFX1250-SDAG-NEXT: s_cselect_b32 vcc_lo, -1, 0
19
- ; GFX1250-SDAG-NEXT: v_add_nc_u64_e32 v[0:1], src_flat_scratch_base_lo , v[0:1]
20
+ ; GFX1250-SDAG-NEXT: v_add_nc_u64_e32 v[0:1], s[0:1] , v[0:1]
20
21
; GFX1250-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_2)
21
22
; GFX1250-SDAG-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_cndmask_b32 v1, 0, v1
22
23
; GFX1250-SDAG-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc_lo
@@ -26,20 +27,20 @@ define amdgpu_kernel void @use_private_to_flat_addrspacecast(ptr addrspace(5) %p
26
27
;
27
28
; GFX1250-GISEL-LABEL: use_private_to_flat_addrspacecast:
28
29
; GFX1250-GISEL: ; %bb.0:
29
- ; GFX1250-GISEL-NEXT: s_load_b32 s0 , s[4:5], 0x24
30
- ; GFX1250-GISEL-NEXT: v_mov_b64_e32 v [0:1], src_flat_scratch_base_lo
30
+ ; GFX1250-GISEL-NEXT: s_load_b32 s2 , s[4:5], 0x24
31
+ ; GFX1250-GISEL-NEXT: s_mov_b64 s [0:1], src_flat_scratch_base_lo
31
32
; GFX1250-GISEL-NEXT: v_mbcnt_lo_u32_b32 v2, -1, 0
33
+ ; GFX1250-GISEL-NEXT: v_mov_b64_e32 v[0:1], s[0:1]
32
34
; GFX1250-GISEL-NEXT: s_wait_kmcnt 0x0
33
- ; GFX1250-GISEL-NEXT: s_cmp_lg_u32 s0 , -1
34
- ; GFX1250-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2 ) | instskip(NEXT ) | instid1(VALU_DEP_2 )
35
- ; GFX1250-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, s0 , v0
35
+ ; GFX1250-GISEL-NEXT: s_cmp_lg_u32 s2 , -1
36
+ ; GFX1250-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1 ) | instskip(SKIP_2 ) | instid1(SALU_CYCLE_1 )
37
+ ; GFX1250-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, s2 , v0
36
38
; GFX1250-GISEL-NEXT: v_lshlrev_b32_e32 v2, 20, v2
37
- ; GFX1250-GISEL-NEXT: s_cselect_b32 s1 , 1, 0
38
- ; GFX1250-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) | instskip(NEXT) | instid1(VALU_DEP_1)
39
- ; GFX1250-GISEL-NEXT: s_and_b32 s1, 1, s1
39
+ ; GFX1250-GISEL-NEXT: s_cselect_b32 s0 , 1, 0
40
+ ; GFX1250-GISEL-NEXT: s_and_b32 s0, 1, s0
41
+ ; GFX1250-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_1) | instid1(VALU_DEP_2)
40
42
; GFX1250-GISEL-NEXT: v_add_co_ci_u32_e64 v1, null, v2, v1, vcc_lo
41
- ; GFX1250-GISEL-NEXT: v_cmp_ne_u32_e64 vcc_lo, 0, s1
42
- ; GFX1250-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2)
43
+ ; GFX1250-GISEL-NEXT: v_cmp_ne_u32_e64 vcc_lo, 0, s0
43
44
; GFX1250-GISEL-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_cndmask_b32 v1, 0, v1
44
45
; GFX1250-GISEL-NEXT: v_cndmask_b32_e32 v0, 0, v0, vcc_lo
45
46
; GFX1250-GISEL-NEXT: flat_store_b32 v[0:1], v2 scope:SCOPE_SYS
@@ -55,24 +56,27 @@ define amdgpu_kernel void @use_private_to_flat_addrspacecast_nonnull(ptr addrspa
55
56
; GFX1250-SDAG: ; %bb.0:
56
57
; GFX1250-SDAG-NEXT: s_load_b32 s0, s[4:5], 0x24
57
58
; GFX1250-SDAG-NEXT: v_mbcnt_lo_u32_b32 v0, -1, 0
58
- ; GFX1250-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instskip(SKIP_2) | instid1(VALU_DEP_1)
59
+ ; GFX1250-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1)
59
60
; GFX1250-SDAG-NEXT: v_dual_mov_b32 v2, 0 :: v_dual_lshlrev_b32 v1, 20, v0
60
61
; GFX1250-SDAG-NEXT: s_wait_kmcnt 0x0
61
62
; GFX1250-SDAG-NEXT: v_mov_b32_e32 v0, s0
62
- ; GFX1250-SDAG-NEXT: v_add_nc_u64_e32 v[0:1], src_flat_scratch_base_lo, v[0:1]
63
+ ; GFX1250-SDAG-NEXT: s_mov_b64 s[0:1], src_flat_scratch_base_lo
64
+ ; GFX1250-SDAG-NEXT: s_delay_alu instid0(VALU_DEP_1) | instid1(SALU_CYCLE_1)
65
+ ; GFX1250-SDAG-NEXT: v_add_nc_u64_e32 v[0:1], s[0:1], v[0:1]
63
66
; GFX1250-SDAG-NEXT: flat_store_b32 v[0:1], v2 scope:SCOPE_SYS
64
67
; GFX1250-SDAG-NEXT: s_wait_storecnt 0x0
65
68
; GFX1250-SDAG-NEXT: s_endpgm
66
69
;
67
70
; GFX1250-GISEL-LABEL: use_private_to_flat_addrspacecast_nonnull:
68
71
; GFX1250-GISEL: ; %bb.0:
69
- ; GFX1250-GISEL-NEXT: s_load_b32 s0, s[4:5], 0x24
72
+ ; GFX1250-GISEL-NEXT: s_load_b32 s2, s[4:5], 0x24
73
+ ; GFX1250-GISEL-NEXT: s_mov_b64 s[0:1], src_flat_scratch_base_lo
70
74
; GFX1250-GISEL-NEXT: v_mbcnt_lo_u32_b32 v2, -1, 0
71
- ; GFX1250-GISEL-NEXT: v_mov_b64_e32 v[0:1], src_flat_scratch_base_lo
75
+ ; GFX1250-GISEL-NEXT: v_mov_b64_e32 v[0:1], s[0:1]
72
76
; GFX1250-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_2) | instskip(SKIP_1) | instid1(VALU_DEP_2)
73
77
; GFX1250-GISEL-NEXT: v_dual_mov_b32 v3, 0 :: v_dual_lshlrev_b32 v2, 20, v2
74
78
; GFX1250-GISEL-NEXT: s_wait_kmcnt 0x0
75
- ; GFX1250-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, s0 , v0
79
+ ; GFX1250-GISEL-NEXT: v_add_co_u32 v0, vcc_lo, s2 , v0
76
80
; GFX1250-GISEL-NEXT: s_delay_alu instid0(VALU_DEP_1)
77
81
; GFX1250-GISEL-NEXT: v_add_co_ci_u32_e64 v1, null, v2, v1, vcc_lo
78
82
; GFX1250-GISEL-NEXT: flat_store_b32 v[0:1], v3 scope:SCOPE_SYS
@@ -87,9 +91,10 @@ define amdgpu_kernel void @use_flat_to_private_addrspacecast(ptr %ptr) {
87
91
; GFX1250-LABEL: use_flat_to_private_addrspacecast:
88
92
; GFX1250: ; %bb.0:
89
93
; GFX1250-NEXT: s_load_b64 s[0:1], s[4:5], 0x24
94
+ ; GFX1250-NEXT: s_mov_b32 s2, src_flat_scratch_base_lo
90
95
; GFX1250-NEXT: v_mov_b32_e32 v0, 0
91
96
; GFX1250-NEXT: s_wait_kmcnt 0x0
92
- ; GFX1250-NEXT: s_sub_co_i32 s2, s0, src_flat_scratch_base_lo
97
+ ; GFX1250-NEXT: s_sub_co_i32 s2, s0, s2
93
98
; GFX1250-NEXT: s_cmp_lg_u64 s[0:1], 0
94
99
; GFX1250-NEXT: s_cselect_b32 s0, s2, -1
95
100
; GFX1250-NEXT: scratch_store_b32 off, v0, s0 scope:SCOPE_SYS
@@ -105,8 +110,9 @@ define amdgpu_kernel void @use_flat_to_private_addrspacecast_nonnull(ptr %ptr) {
105
110
; GFX1250-SDAG: ; %bb.0:
106
111
; GFX1250-SDAG-NEXT: s_load_b32 s0, s[4:5], 0x24
107
112
; GFX1250-SDAG-NEXT: v_mov_b32_e32 v0, 0
113
+ ; GFX1250-SDAG-NEXT: s_mov_b32 s1, src_flat_scratch_base_lo
108
114
; GFX1250-SDAG-NEXT: s_wait_kmcnt 0x0
109
- ; GFX1250-SDAG-NEXT: s_sub_co_i32 s0, s0, src_flat_scratch_base_lo
115
+ ; GFX1250-SDAG-NEXT: s_sub_co_i32 s0, s0, s1
110
116
; GFX1250-SDAG-NEXT: scratch_store_b32 off, v0, s0 scope:SCOPE_SYS
111
117
; GFX1250-SDAG-NEXT: s_wait_storecnt 0x0
112
118
; GFX1250-SDAG-NEXT: s_endpgm
@@ -116,7 +122,9 @@ define amdgpu_kernel void @use_flat_to_private_addrspacecast_nonnull(ptr %ptr) {
116
122
; GFX1250-GISEL-NEXT: s_load_b64 s[0:1], s[4:5], 0x24
117
123
; GFX1250-GISEL-NEXT: v_mov_b32_e32 v0, 0
118
124
; GFX1250-GISEL-NEXT: s_wait_kmcnt 0x0
119
- ; GFX1250-GISEL-NEXT: s_sub_co_i32 s0, s0, src_flat_scratch_base_lo
125
+ ; GFX1250-GISEL-NEXT: s_mov_b32 s1, src_flat_scratch_base_lo
126
+ ; GFX1250-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1)
127
+ ; GFX1250-GISEL-NEXT: s_sub_co_i32 s0, s0, s1
120
128
; GFX1250-GISEL-NEXT: scratch_store_b32 off, v0, s0 scope:SCOPE_SYS
121
129
; GFX1250-GISEL-NEXT: s_wait_storecnt 0x0
122
130
; GFX1250-GISEL-NEXT: s_endpgm
0 commit comments