1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX8 %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
4 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
6 # GFX6/7 selection should fail.
7 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -disable-gisel-legality-check -o - %s | FileCheck -check-prefix=GFX6 %s
8 # RUN: llc -march=amdgcn -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -disable-gisel-legality-check -o - %s | FileCheck -check-prefix=GFX6 %s
11 name: atomicrmw_fadd_s32_region
14 tracksRegLiveness: true
17 liveins: $vgpr0, $vgpr1
19 ; GFX8-LABEL: name: atomicrmw_fadd_s32_region
20 ; GFX8: liveins: $vgpr0, $vgpr1
22 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
23 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
24 ; GFX8-NEXT: $m0 = S_MOV_B32 -1
25 ; GFX8-NEXT: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 0, 1, implicit $m0, implicit $exec :: (load store seq_cst (s32), addrspace 2)
26 ; GFX8-NEXT: $vgpr0 = COPY [[DS_ADD_RTN_F32_]]
27 ; GFX9-LABEL: name: atomicrmw_fadd_s32_region
28 ; GFX9: liveins: $vgpr0, $vgpr1
30 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
31 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
32 ; GFX9-NEXT: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 0, 1, implicit $m0, implicit $exec :: (load store seq_cst (s32), addrspace 2)
33 ; GFX9-NEXT: $vgpr0 = COPY [[DS_ADD_RTN_F32_]]
34 ; GFX6-LABEL: name: atomicrmw_fadd_s32_region
35 ; GFX6: liveins: $vgpr0, $vgpr1
37 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p2) = COPY $vgpr0
38 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
39 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
40 ; GFX6-NEXT: [[ATOMICRMW_FADD:%[0-9]+]]:vgpr_32(s32) = G_ATOMICRMW_FADD [[COPY]](p2), [[COPY1]] :: (load store seq_cst (s32), addrspace 2)
41 ; GFX6-NEXT: $vgpr0 = COPY [[ATOMICRMW_FADD]](s32)
42 %0:vgpr(p2) = COPY $vgpr0
43 %1:vgpr(s32) = COPY $vgpr1
44 %2:vgpr(s32) = G_ATOMICRMW_FADD %0(p2), %1 :: (load store seq_cst (s32), addrspace 2)
50 name: atomicrmw_fadd_s32_region_noret
53 tracksRegLiveness: true
56 liveins: $vgpr0, $vgpr1
58 ; GFX8-LABEL: name: atomicrmw_fadd_s32_region_noret
59 ; GFX8: liveins: $vgpr0, $vgpr1
61 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
62 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
63 ; GFX8-NEXT: $m0 = S_MOV_B32 -1
64 ; GFX8-NEXT: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 0, 1, implicit $m0, implicit $exec :: (load store seq_cst (s32), addrspace 2)
65 ; GFX9-LABEL: name: atomicrmw_fadd_s32_region_noret
66 ; GFX9: liveins: $vgpr0, $vgpr1
68 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
69 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
70 ; GFX9-NEXT: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 0, 1, implicit $m0, implicit $exec :: (load store seq_cst (s32), addrspace 2)
71 ; GFX6-LABEL: name: atomicrmw_fadd_s32_region_noret
72 ; GFX6: liveins: $vgpr0, $vgpr1
74 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p2) = COPY $vgpr0
75 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
76 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
77 ; GFX6-NEXT: [[ATOMICRMW_FADD:%[0-9]+]]:vgpr(s32) = G_ATOMICRMW_FADD [[COPY]](p2), [[COPY1]] :: (load store seq_cst (s32), addrspace 2)
78 %0:vgpr(p2) = COPY $vgpr0
79 %1:vgpr(s32) = COPY $vgpr1
80 %2:vgpr(s32) = G_ATOMICRMW_FADD %0(p2), %1 :: (load store seq_cst (s32), addrspace 2)
85 name: atomicrmw_fadd_s32_region_gep4
88 tracksRegLiveness: true
91 liveins: $vgpr0, $vgpr1
93 ; GFX8-LABEL: name: atomicrmw_fadd_s32_region_gep4
94 ; GFX8: liveins: $vgpr0, $vgpr1
96 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
97 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
98 ; GFX8-NEXT: $m0 = S_MOV_B32 -1
99 ; GFX8-NEXT: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 4, 1, implicit $m0, implicit $exec :: (load store seq_cst (s32), addrspace 2)
100 ; GFX8-NEXT: $vgpr0 = COPY [[DS_ADD_RTN_F32_]]
101 ; GFX9-LABEL: name: atomicrmw_fadd_s32_region_gep4
102 ; GFX9: liveins: $vgpr0, $vgpr1
104 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
105 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
106 ; GFX9-NEXT: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 4, 1, implicit $m0, implicit $exec :: (load store seq_cst (s32), addrspace 2)
107 ; GFX9-NEXT: $vgpr0 = COPY [[DS_ADD_RTN_F32_]]
108 ; GFX6-LABEL: name: atomicrmw_fadd_s32_region_gep4
109 ; GFX6: liveins: $vgpr0, $vgpr1
111 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vgpr(p2) = COPY $vgpr0
112 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
113 ; GFX6-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 4
114 ; GFX6-NEXT: [[PTR_ADD:%[0-9]+]]:vgpr(p2) = G_PTR_ADD [[COPY]], [[C]](s32)
115 ; GFX6-NEXT: $m0 = S_MOV_B32 -1
116 ; GFX6-NEXT: [[ATOMICRMW_FADD:%[0-9]+]]:vgpr_32(s32) = G_ATOMICRMW_FADD [[PTR_ADD]](p2), [[COPY1]] :: (load store seq_cst (s32), addrspace 2)
117 ; GFX6-NEXT: $vgpr0 = COPY [[ATOMICRMW_FADD]](s32)
118 %0:vgpr(p2) = COPY $vgpr0
119 %1:vgpr(s32) = COPY $vgpr1
120 %2:vgpr(s32) = G_CONSTANT i32 4
121 %3:vgpr(p2) = G_PTR_ADD %0, %2
122 %4:vgpr(s32) = G_ATOMICRMW_FADD %3(p2), %1 :: (load store seq_cst (s32), addrspace 2)