1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX6 %s
3 # RUN: llc -march=amdgcn -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7 %s
4 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7 %s
5 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
6 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
10 name: atomicrmw_fadd_s32_local
13 tracksRegLiveness: true
16 liveins: $vgpr0, $vgpr1
18 ; GFX6-LABEL: name: atomicrmw_fadd_s32_local
19 ; GFX6: liveins: $vgpr0, $vgpr1
20 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
21 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
22 ; GFX6: $m0 = S_MOV_B32 -1
23 ; GFX6: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 0, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
24 ; GFX6: $vgpr0 = COPY [[DS_ADD_RTN_F32_]]
25 ; GFX7-LABEL: name: atomicrmw_fadd_s32_local
26 ; GFX7: liveins: $vgpr0, $vgpr1
27 ; GFX7: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
28 ; GFX7: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
29 ; GFX7: $m0 = S_MOV_B32 -1
30 ; GFX7: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 0, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
31 ; GFX7: $vgpr0 = COPY [[DS_ADD_RTN_F32_]]
32 ; GFX9-LABEL: name: atomicrmw_fadd_s32_local
33 ; GFX9: liveins: $vgpr0, $vgpr1
34 ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
35 ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
36 ; GFX9: [[DS_ADD_RTN_F32_gfx9_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32_gfx9 [[COPY]], [[COPY1]], 0, 0, implicit $exec :: (load store seq_cst 4, addrspace 3)
37 ; GFX9: $vgpr0 = COPY [[DS_ADD_RTN_F32_gfx9_]]
38 %0:vgpr(p3) = COPY $vgpr0
39 %1:vgpr(s32) = COPY $vgpr1
40 %2:vgpr(s32) = G_ATOMICRMW_FADD %0(p3), %1 :: (load store seq_cst 4, addrspace 3)
46 name: atomicrmw_fadd_s32_local_noret
49 tracksRegLiveness: true
52 liveins: $vgpr0, $vgpr1
54 ; GFX6-LABEL: name: atomicrmw_fadd_s32_local_noret
55 ; GFX6: liveins: $vgpr0, $vgpr1
56 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
57 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
58 ; GFX6: $m0 = S_MOV_B32 -1
59 ; GFX6: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 0, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
60 ; GFX7-LABEL: name: atomicrmw_fadd_s32_local_noret
61 ; GFX7: liveins: $vgpr0, $vgpr1
62 ; GFX7: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
63 ; GFX7: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
64 ; GFX7: $m0 = S_MOV_B32 -1
65 ; GFX7: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 0, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
66 ; GFX9-LABEL: name: atomicrmw_fadd_s32_local_noret
67 ; GFX9: liveins: $vgpr0, $vgpr1
68 ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
69 ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
70 ; GFX9: [[DS_ADD_RTN_F32_gfx9_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32_gfx9 [[COPY]], [[COPY1]], 0, 0, implicit $exec :: (load store seq_cst 4, addrspace 3)
71 %0:vgpr(p3) = COPY $vgpr0
72 %1:vgpr(s32) = COPY $vgpr1
73 %2:vgpr(s32) = G_ATOMICRMW_FADD %0(p3), %1 :: (load store seq_cst 4, addrspace 3)
78 name: atomicrmw_fadd_s32_local_gep4
81 tracksRegLiveness: true
84 liveins: $vgpr0, $vgpr1
86 ; GFX6-LABEL: name: atomicrmw_fadd_s32_local_gep4
87 ; GFX6: liveins: $vgpr0, $vgpr1
88 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
89 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
90 ; GFX6: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 4, implicit $exec
91 ; GFX6: %3:vgpr_32, dead %5:sreg_64_xexec = V_ADD_I32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
92 ; GFX6: $m0 = S_MOV_B32 -1
93 ; GFX6: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 %3, [[COPY1]], 0, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
94 ; GFX6: $vgpr0 = COPY [[DS_ADD_RTN_F32_]]
95 ; GFX7-LABEL: name: atomicrmw_fadd_s32_local_gep4
96 ; GFX7: liveins: $vgpr0, $vgpr1
97 ; GFX7: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
98 ; GFX7: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
99 ; GFX7: $m0 = S_MOV_B32 -1
100 ; GFX7: [[DS_ADD_RTN_F32_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32 [[COPY]], [[COPY1]], 4, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
101 ; GFX7: $vgpr0 = COPY [[DS_ADD_RTN_F32_]]
102 ; GFX9-LABEL: name: atomicrmw_fadd_s32_local_gep4
103 ; GFX9: liveins: $vgpr0, $vgpr1
104 ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
105 ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
106 ; GFX9: [[DS_ADD_RTN_F32_gfx9_:%[0-9]+]]:vgpr_32 = DS_ADD_RTN_F32_gfx9 [[COPY]], [[COPY1]], 4, 0, implicit $exec :: (load store seq_cst 4, addrspace 3)
107 ; GFX9: $vgpr0 = COPY [[DS_ADD_RTN_F32_gfx9_]]
108 %0:vgpr(p3) = COPY $vgpr0
109 %1:vgpr(s32) = COPY $vgpr1
110 %2:vgpr(s32) = G_CONSTANT i32 4
111 %3:vgpr(p3) = G_GEP %0, %2
112 %4:vgpr(s32) = G_ATOMICRMW_FADD %3(p3), %1 :: (load store seq_cst 4, addrspace 3)