forked from OSchip/llvm-project
AMDGPU/GlobalISel: Lower G_ATOMIC_CMPXCHG_WITH_SUCCESS
llvm-svn: 373839
This commit is contained in:
parent
a5b9c75674
commit
bcd6b1d209
|
@ -837,6 +837,9 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
|
|||
getActionDefinitionsBuilder(G_ATOMICRMW_FADD)
|
||||
.legalFor({{S32, LocalPtr}});
|
||||
|
||||
getActionDefinitionsBuilder(G_ATOMIC_CMPXCHG_WITH_SUCCESS)
|
||||
.lower();
|
||||
|
||||
// TODO: Pointer types, any 32-bit or 64-bit vector
|
||||
getActionDefinitionsBuilder(G_SELECT)
|
||||
.legalForCartesianProduct({S32, S64, S16, V2S32, V2S16, V4S16,
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
||||
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=hawaii -O0 -run-pass=legalizer %s -o - | FileCheck %s
|
||||
|
||||
---
|
||||
name: test_atomic_cmpxchg_with_success_s32_global
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0_vgpr1, $vgpr2, $vgpr3
|
||||
|
||||
; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s32_global
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr3
|
||||
; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s32) = G_ATOMIC_CMPXCHG [[COPY]](p1), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 1)
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s32), [[COPY1]]
|
||||
; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s32), implicit [[ICMP]](s1)
|
||||
%0:_(p1) = COPY $vgpr0_vgpr1
|
||||
%1:_(s32) = COPY $vgpr2
|
||||
%2:_(s32) = COPY $vgpr3
|
||||
%3:_(s32), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 1)
|
||||
S_ENDPGM 0, implicit %3, implicit %4
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_atomic_cmpxchg_with_success_s32_flat
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0_vgpr1, $vgpr2, $vgpr3
|
||||
|
||||
; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s32_flat
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr3
|
||||
; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s32) = G_ATOMIC_CMPXCHG [[COPY]](p0), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 4)
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s32), [[COPY1]]
|
||||
; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s32), implicit [[ICMP]](s1)
|
||||
%0:_(p0) = COPY $vgpr0_vgpr1
|
||||
%1:_(s32) = COPY $vgpr2
|
||||
%2:_(s32) = COPY $vgpr3
|
||||
%3:_(s32), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 0)
|
||||
S_ENDPGM 0, implicit %3, implicit %4
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_atomic_cmpxchg_with_success_s32_local
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1, $vgpr2
|
||||
|
||||
; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s32_local
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
|
||||
; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s32) = G_ATOMIC_CMPXCHG [[COPY]](p3), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 3)
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s32), [[COPY1]]
|
||||
; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s32), implicit [[ICMP]](s1)
|
||||
%0:_(p3) = COPY $vgpr0
|
||||
%1:_(s32) = COPY $vgpr1
|
||||
%2:_(s32) = COPY $vgpr2
|
||||
%3:_(s32), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 3)
|
||||
S_ENDPGM 0, implicit %3, implicit %4
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_atomic_cmpxchg_with_success_s64_global
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5
|
||||
|
||||
; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s64_global
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr4_vgpr5
|
||||
; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s64) = G_ATOMIC_CMPXCHG [[COPY]](p1), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 8, addrspace 1)
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s64), [[COPY1]]
|
||||
; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s64), implicit [[ICMP]](s1)
|
||||
%0:_(p1) = COPY $vgpr0_vgpr1
|
||||
%1:_(s64) = COPY $vgpr2_vgpr3
|
||||
%2:_(s64) = COPY $vgpr4_vgpr5
|
||||
%3:_(s64), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 8, addrspace 1)
|
||||
S_ENDPGM 0, implicit %3, implicit %4
|
||||
|
||||
...
|
||||
|
||||
---
|
||||
name: test_atomic_cmpxchg_with_success_s64_local
|
||||
body: |
|
||||
bb.0:
|
||||
liveins: $vgpr0, $vgpr1_vgpr2, $vgpr3_vgpr4
|
||||
|
||||
; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s64_local
|
||||
; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
|
||||
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr1_vgpr2
|
||||
; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr3_vgpr4
|
||||
; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s64) = G_ATOMIC_CMPXCHG [[COPY]](p3), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 8, addrspace 3)
|
||||
; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s64), [[COPY1]]
|
||||
; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s64), implicit [[ICMP]](s1)
|
||||
%0:_(p3) = COPY $vgpr0
|
||||
%1:_(s64) = COPY $vgpr1_vgpr2
|
||||
%2:_(s64) = COPY $vgpr3_vgpr4
|
||||
%3:_(s64), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 8, addrspace 3)
|
||||
S_ENDPGM 0, implicit %3, implicit %4
|
||||
|
||||
...
|
Loading…
Reference in New Issue