Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=amdgcn-amd- -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck --check-prefixes=GCN,GFX8,GFX89 %s |
| 2 | ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck --check-prefixes=GCN,GFX8,GFX89 %s |
Ron Lieberman | f48e43b | 2018-11-30 18:29:17 +0000 | [diff] [blame] | 3 | ; RUN: llc -mtriple=amdgcn-amd- -mcpu=gfx900 -verify-machineinstrs -amdgpu-enable-global-sgpr-addr < %s | FileCheck --check-prefixes=GCN,GFX9,GFX89 %s |
| 4 | ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs -amdgpu-enable-global-sgpr-addr < %s | FileCheck --check-prefixes=GCN,GFX9,GFX89 %s |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 5 | |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 6 | declare i32 @llvm.amdgcn.workitem.id.x() |
| 7 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 8 | ; GCN-LABEL: {{^}}system_unordered: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 9 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 10 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 11 | define amdgpu_kernel void @system_unordered( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 12 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 13 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 14 | store atomic i32 %in, i32* %out unordered, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 15 | ret void |
| 16 | } |
| 17 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 18 | ; GCN-LABEL: {{^}}system_monotonic: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 19 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 20 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 21 | define amdgpu_kernel void @system_monotonic( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 22 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 23 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 24 | store atomic i32 %in, i32* %out monotonic, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 25 | ret void |
| 26 | } |
| 27 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 28 | ; GCN-LABEL: {{^}}system_release: |
| 29 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 30 | ; GCN-NEXT: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 31 | define amdgpu_kernel void @system_release( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 32 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 33 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 34 | store atomic i32 %in, i32* %out release, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 35 | ret void |
| 36 | } |
| 37 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 38 | ; GCN-LABEL: {{^}}system_seq_cst: |
| 39 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 40 | ; GCN-NEXT: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 41 | define amdgpu_kernel void @system_seq_cst( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 42 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 43 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 44 | store atomic i32 %in, i32* %out seq_cst, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 45 | ret void |
| 46 | } |
| 47 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 48 | ; GCN-LABEL: {{^}}singlethread_unordered: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 49 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 50 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 51 | define amdgpu_kernel void @singlethread_unordered( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 52 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 53 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 54 | store atomic i32 %in, i32* %out syncscope("singlethread") unordered, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 55 | ret void |
| 56 | } |
| 57 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 58 | ; GCN-LABEL: {{^}}singlethread_monotonic: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 59 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 60 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 61 | define amdgpu_kernel void @singlethread_monotonic( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 62 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 63 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 64 | store atomic i32 %in, i32* %out syncscope("singlethread") monotonic, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 65 | ret void |
| 66 | } |
| 67 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 68 | ; GCN-LABEL: {{^}}singlethread_release: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 69 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 70 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 71 | define amdgpu_kernel void @singlethread_release( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 72 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 73 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 74 | store atomic i32 %in, i32* %out syncscope("singlethread") release, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 75 | ret void |
| 76 | } |
| 77 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 78 | ; GCN-LABEL: {{^}}singlethread_seq_cst: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 79 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 80 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 81 | define amdgpu_kernel void @singlethread_seq_cst( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 82 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 83 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 84 | store atomic i32 %in, i32* %out syncscope("singlethread") seq_cst, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 85 | ret void |
| 86 | } |
| 87 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 88 | ; GCN-LABEL: {{^}}agent_unordered: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 89 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 90 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 91 | define amdgpu_kernel void @agent_unordered( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 92 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 93 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 94 | store atomic i32 %in, i32* %out syncscope("agent") unordered, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 95 | ret void |
| 96 | } |
| 97 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 98 | ; GCN-LABEL: {{^}}agent_monotonic: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 99 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 100 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 101 | define amdgpu_kernel void @agent_monotonic( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 102 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 103 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 104 | store atomic i32 %in, i32* %out syncscope("agent") monotonic, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 105 | ret void |
| 106 | } |
| 107 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 108 | ; GCN-LABEL: {{^}}agent_release: |
| 109 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 110 | ; GCN-NEXT: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 111 | define amdgpu_kernel void @agent_release( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 112 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 113 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 114 | store atomic i32 %in, i32* %out syncscope("agent") release, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 115 | ret void |
| 116 | } |
| 117 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 118 | ; GCN-LABEL: {{^}}agent_seq_cst: |
| 119 | ; GCN: s_waitcnt vmcnt(0){{$}} |
| 120 | ; GCN-NEXT: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 121 | define amdgpu_kernel void @agent_seq_cst( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 122 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 123 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 124 | store atomic i32 %in, i32* %out syncscope("agent") seq_cst, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 125 | ret void |
| 126 | } |
| 127 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 128 | ; GCN-LABEL: {{^}}workgroup_unordered: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 129 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 130 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 131 | define amdgpu_kernel void @workgroup_unordered( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 132 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 133 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 134 | store atomic i32 %in, i32* %out syncscope("workgroup") unordered, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 135 | ret void |
| 136 | } |
| 137 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 138 | ; GCN-LABEL: {{^}}workgroup_monotonic: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 139 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 140 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 141 | define amdgpu_kernel void @workgroup_monotonic( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 142 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 143 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 144 | store atomic i32 %in, i32* %out syncscope("workgroup") monotonic, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 145 | ret void |
| 146 | } |
| 147 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 148 | ; GCN-LABEL: {{^}}workgroup_release: |
| 149 | ; GFX89-NOT: s_waitcnt vmcnt(0){{$}} |
| 150 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 151 | define amdgpu_kernel void @workgroup_release( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 152 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 153 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 154 | store atomic i32 %in, i32* %out syncscope("workgroup") release, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 155 | ret void |
| 156 | } |
| 157 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 158 | ; GCN-LABEL: {{^}}workgroup_seq_cst: |
| 159 | ; GFX89-NOT: s_waitcnt vmcnt(0){{$}} |
| 160 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 161 | define amdgpu_kernel void @workgroup_seq_cst( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 162 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 163 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 164 | store atomic i32 %in, i32* %out syncscope("workgroup") seq_cst, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 165 | ret void |
| 166 | } |
| 167 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 168 | ; GCN-LABEL: {{^}}wavefront_unordered: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 169 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 170 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 171 | define amdgpu_kernel void @wavefront_unordered( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 172 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 173 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 174 | store atomic i32 %in, i32* %out syncscope("wavefront") unordered, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 175 | ret void |
| 176 | } |
| 177 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 178 | ; GCN-LABEL: {{^}}wavefront_monotonic: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 179 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 180 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 181 | define amdgpu_kernel void @wavefront_monotonic( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 182 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 183 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 184 | store atomic i32 %in, i32* %out syncscope("wavefront") monotonic, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 185 | ret void |
| 186 | } |
| 187 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 188 | ; GCN-LABEL: {{^}}wavefront_release: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 189 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 190 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 191 | define amdgpu_kernel void @wavefront_release( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 192 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 193 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 194 | store atomic i32 %in, i32* %out syncscope("wavefront") release, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 195 | ret void |
| 196 | } |
| 197 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 198 | ; GCN-LABEL: {{^}}wavefront_seq_cst: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 199 | ; GCN-NOT: s_waitcnt vmcnt(0){{$}} |
| 200 | ; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}} |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 201 | define amdgpu_kernel void @wavefront_seq_cst( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 202 | i32 %in, i32* %out) { |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 203 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 204 | store atomic i32 %in, i32* %out syncscope("wavefront") seq_cst, align 4 |
Konstantin Zhuravlyov | e9a5a77 | 2017-07-21 21:19:23 +0000 | [diff] [blame] | 205 | ret void |
| 206 | } |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 207 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 208 | ; GCN-LABEL: {{^}}nontemporal_private_0: |
| 209 | ; GFX89: buffer_store_dword v{{[0-9]+}}, v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}], s{{[0-9]+}} offen glc slc{{$}} |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 210 | define amdgpu_kernel void @nontemporal_private_0( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 211 | i32* %in, i32 addrspace(5)* %out) { |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 212 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 213 | %val = load i32, i32* %in, align 4 |
| 214 | store i32 %val, i32 addrspace(5)* %out, !nontemporal !0 |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 215 | ret void |
| 216 | } |
| 217 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 218 | ; GCN-LABEL: {{^}}nontemporal_private_1: |
| 219 | ; GFX89: buffer_store_dword v{{[0-9]+}}, v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}], s{{[0-9]+}} offen glc slc{{$}} |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 220 | define amdgpu_kernel void @nontemporal_private_1( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 221 | i32* %in, i32 addrspace(5)* %out) { |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 222 | entry: |
| 223 | %tid = call i32 @llvm.amdgcn.workitem.id.x() |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 224 | %val = load i32, i32* %in, align 4 |
| 225 | %out.gep = getelementptr inbounds i32, i32 addrspace(5)* %out, i32 %tid |
| 226 | store i32 %val, i32 addrspace(5)* %out.gep, !nontemporal !0 |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 227 | ret void |
| 228 | } |
| 229 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 230 | ; GCN-LABEL: {{^}}nontemporal_global_0: |
| 231 | ; GFX8: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} glc slc{{$}} |
| 232 | ; GFX9: global_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}}, off glc slc{{$}} |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 233 | define amdgpu_kernel void @nontemporal_global_0( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 234 | i32* %in, i32 addrspace(1)* %out) { |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 235 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 236 | %val = load i32, i32* %in, align 4 |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 237 | store i32 %val, i32 addrspace(1)* %out, !nontemporal !0 |
| 238 | ret void |
| 239 | } |
| 240 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 241 | ; GCN-LABEL: {{^}}nontemporal_global_1: |
| 242 | ; GFX8: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} glc slc{{$}} |
Ron Lieberman | cac749a | 2018-11-16 01:13:34 +0000 | [diff] [blame] | 243 | ; GFX9: global_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}] glc slc{{$}} |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 244 | define amdgpu_kernel void @nontemporal_global_1( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 245 | i32* %in, i32 addrspace(1)* %out) { |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 246 | entry: |
| 247 | %tid = call i32 @llvm.amdgcn.workitem.id.x() |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 248 | %val = load i32, i32* %in, align 4 |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 249 | %out.gep = getelementptr inbounds i32, i32 addrspace(1)* %out, i32 %tid |
| 250 | store i32 %val, i32 addrspace(1)* %out.gep, !nontemporal !0 |
| 251 | ret void |
| 252 | } |
| 253 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 254 | ; GCN-LABEL: {{^}}nontemporal_local_0: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 255 | ; GCN: ds_write_b32 v{{[0-9]+}}, v{{[0-9]+}}{{$}} |
| 256 | define amdgpu_kernel void @nontemporal_local_0( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 257 | i32* %in, i32 addrspace(3)* %out) { |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 258 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 259 | %val = load i32, i32* %in, align 4 |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 260 | store i32 %val, i32 addrspace(3)* %out, !nontemporal !0 |
| 261 | ret void |
| 262 | } |
| 263 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 264 | ; GCN-LABEL: {{^}}nontemporal_local_1: |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 265 | ; GCN: ds_write_b32 v{{[0-9]+}}, v{{[0-9]+}}{{$}} |
| 266 | define amdgpu_kernel void @nontemporal_local_1( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 267 | i32* %in, i32 addrspace(3)* %out) { |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 268 | entry: |
| 269 | %tid = call i32 @llvm.amdgcn.workitem.id.x() |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 270 | %val = load i32, i32* %in, align 4 |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 271 | %out.gep = getelementptr inbounds i32, i32 addrspace(3)* %out, i32 %tid |
| 272 | store i32 %val, i32 addrspace(3)* %out.gep, !nontemporal !0 |
| 273 | ret void |
| 274 | } |
| 275 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 276 | ; GCN-LABEL: {{^}}nontemporal_flat_0: |
| 277 | ; GFX89: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} glc slc{{$}} |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 278 | define amdgpu_kernel void @nontemporal_flat_0( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 279 | i32* %in, i32* %out) { |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 280 | entry: |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 281 | %val = load i32, i32* %in, align 4 |
| 282 | store i32 %val, i32* %out, !nontemporal !0 |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 283 | ret void |
| 284 | } |
| 285 | |
Stanislav Mekhanoshin | 127dbdb | 2018-02-13 20:03:32 +0000 | [diff] [blame] | 286 | ; GCN-LABEL: {{^}}nontemporal_flat_1: |
| 287 | ; GFX89: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} glc slc{{$}} |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 288 | define amdgpu_kernel void @nontemporal_flat_1( |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 289 | i32* %in, i32* %out) { |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 290 | entry: |
| 291 | %tid = call i32 @llvm.amdgcn.workitem.id.x() |
Yaxun Liu | 2a22c5d | 2018-02-02 16:07:16 +0000 | [diff] [blame] | 292 | %val = load i32, i32* %in, align 4 |
| 293 | %out.gep = getelementptr inbounds i32, i32* %out, i32 %tid |
| 294 | store i32 %val, i32* %out.gep, !nontemporal !0 |
Konstantin Zhuravlyov | cff1155 | 2017-10-25 17:04:46 +0000 | [diff] [blame] | 295 | ret void |
| 296 | } |
| 297 | |
| 298 | !0 = !{i32 1} |