Matt Arsenault ed1ee9a9bf
AtomicExpand: Stop using report_fatal_error (#147300)
Emit a context error and delete the instruction. This
allows removing the AMDGPU hack where some atomic libcalls
are falsely added. NVPTX also later copied the same hack,
so remove it there too.

For now just emit the generic error, which is not good. It's
missing any useful context information (despite taking the instruction).
It's also confusing in the failed atomicrmw case, since it's reporting
failure at the intermediate failed cmpxchg instead of the original
atomicrmw.
2025-07-09 15:28:10 +09:00

14 lines
533 B
LLVM

; RUN: not opt -disable-output -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -passes=atomic-expand %s 2>&1 | FileCheck --implicit-check-not=error %s
; CHECK: error: unsupported atomic load
define i32 @atomic_load_global_align1(ptr addrspace(1) %ptr) {
%val = load atomic i32, ptr addrspace(1) %ptr seq_cst, align 1
ret i32 %val
}
; FIXME: 2nd error not emitted in next function
define void @atomic_store_global_align1(ptr addrspace(1) %ptr, i32 %val) {
store atomic i32 %val, ptr addrspace(1) %ptr monotonic, align 1
ret void
}