CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
50 lines
1.6 KiB
LLVM
50 lines
1.6 KiB
LLVM
; RUN: opt -passes=objc-arc -S < %s | FileCheck %s
|
|
|
|
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
|
|
|
declare ptr @llvm.objc.retain(ptr)
|
|
declare void @llvm.objc.release(ptr)
|
|
|
|
; Retain must not sink past atomicrmw.
|
|
define void @test_atomicrmw(ptr %obj, ptr %atomic_slot) {
|
|
; CHECK-LABEL: @test_atomicrmw
|
|
; CHECK: call ptr @llvm.objc.retain
|
|
; CHECK: atomicrmw
|
|
entry:
|
|
%obj_as_int = ptrtoint ptr %obj to i64
|
|
%retained = call ptr @llvm.objc.retain(ptr %obj)
|
|
%old_value = atomicrmw xchg ptr %atomic_slot, i64 %obj_as_int monotonic, align 8
|
|
%old_obj = inttoptr i64 %old_value to ptr
|
|
call void @llvm.objc.release(ptr %old_obj)
|
|
call void @llvm.objc.release(ptr %obj)
|
|
ret void
|
|
}
|
|
|
|
; Retain must not sink past cmpxchg.
|
|
define void @test_cmpxchg(ptr %obj, ptr %atomic_slot, i64 %expected) {
|
|
; CHECK-LABEL: @test_cmpxchg
|
|
; CHECK: call ptr @llvm.objc.retain
|
|
; CHECK: cmpxchg
|
|
entry:
|
|
%obj_as_int = ptrtoint ptr %obj to i64
|
|
%retained = call ptr @llvm.objc.retain(ptr %obj)
|
|
%res = cmpxchg ptr %atomic_slot, i64 %expected, i64 %obj_as_int monotonic monotonic, align 8
|
|
%old_int = extractvalue { i64, i1 } %res, 0
|
|
%old_obj = inttoptr i64 %old_int to ptr
|
|
call void @llvm.objc.release(ptr %old_obj)
|
|
call void @llvm.objc.release(ptr %obj)
|
|
ret void
|
|
}
|
|
|
|
; Retain must not sink past an atomic store.
|
|
define void @test_atomic_store(ptr %obj, ptr %slot) {
|
|
; CHECK-LABEL: @test_atomic_store
|
|
; CHECK: call ptr @llvm.objc.retain
|
|
; CHECK: store atomic
|
|
entry:
|
|
%retained = call ptr @llvm.objc.retain(ptr %obj)
|
|
store atomic ptr %obj, ptr %slot monotonic, align 8
|
|
call void @llvm.objc.release(ptr %obj)
|
|
ret void
|
|
}
|