mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
AMDGPU: Fix incorrect selection of buffer atomic fadd
There were additional standalone patterns for these nodes which were missing the subtarget predicate.
This commit is contained in:
parent
f452018857
commit
0ca2dfd8e3
@ -1422,8 +1422,10 @@ multiclass BufferAtomicPatterns_NO_RTN<SDPatternOperator name, ValueType vt,
|
||||
>;
|
||||
}
|
||||
|
||||
let SubtargetPredicate = HasAtomicFaddInsts in {
|
||||
defm : BufferAtomicPatterns_NO_RTN<SIbuffer_atomic_fadd, f32, "BUFFER_ATOMIC_ADD_F32">;
|
||||
defm : BufferAtomicPatterns_NO_RTN<SIbuffer_atomic_pk_fadd, v2f16, "BUFFER_ATOMIC_PK_ADD_F16">;
|
||||
}
|
||||
|
||||
def : GCNPat<
|
||||
(SIbuffer_atomic_cmpswap
|
||||
|
19
test/CodeGen/AMDGPU/fail-select-buffer-atomic-fadd.ll
Normal file
19
test/CodeGen/AMDGPU/fail-select-buffer-atomic-fadd.ll
Normal file
@ -0,0 +1,19 @@
|
||||
; RUN: not --crash llc -march=amdgcn -mcpu=tahiti -o /dev/null %s 2>&1 | FileCheck -check-prefix=FAIL %s
|
||||
; RUN: not --crash llc -march=amdgcn -mcpu=hawaii -o /dev/null %s 2>&1 | FileCheck -check-prefix=FAIL %s
|
||||
; RUN: not --crash llc -march=amdgcn -mcpu=fiji -o /dev/null %s 2>&1 | FileCheck -check-prefix=FAIL %s
|
||||
; RUN: not --crash llc -march=amdgcn -mcpu=gfx900 -o /dev/null %s 2>&1 | FileCheck -check-prefix=FAIL %s
|
||||
; RUN: not --crash llc -march=amdgcn -mcpu=gfx1010 -o /dev/null %s 2>&1 | FileCheck -check-prefix=FAIL %s
|
||||
|
||||
; Make sure selection of these intrinsics fails on targets that do not
|
||||
; have the instruction available.
|
||||
; FIXME: Should also really make sure the v2f16 version fails.
|
||||
|
||||
; FAIL: LLVM ERROR: Cannot select: {{.+}}: ch = BUFFER_ATOMIC_FADD
|
||||
define amdgpu_cs void @atomic_fadd(<4 x i32> inreg %arg0) {
|
||||
call void @llvm.amdgcn.buffer.atomic.fadd.f32(float 1.0, <4 x i32> %arg0, i32 0, i32 112, i1 false)
|
||||
ret void
|
||||
}
|
||||
|
||||
declare void @llvm.amdgcn.buffer.atomic.fadd.f32(float, <4 x i32>, i32, i32, i1 immarg) #0
|
||||
|
||||
attributes #0 = { nounwind }
|
Loading…
x
Reference in New Issue
Block a user