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
47 lines
1.6 KiB
LLVM
47 lines
1.6 KiB
LLVM
; RUN: opt -S -passes=objc-arc < %s | FileCheck %s
|
|
; rdar://11434915
|
|
|
|
; Delete the weak calls and replace them with just the net retain.
|
|
|
|
; CHECK: define void @test0(ptr %p) {
|
|
; CHECK-NEXT: call ptr @llvm.objc.retain(ptr %p)
|
|
; CHECK-NEXT: ret void
|
|
|
|
define void @test0(ptr %p) {
|
|
%weakBlock = alloca ptr, align 8
|
|
%tmp7 = call ptr @llvm.objc.initWeak(ptr %weakBlock, ptr %p) nounwind
|
|
%tmp26 = call ptr @llvm.objc.loadWeakRetained(ptr %weakBlock) nounwind
|
|
call void @llvm.objc.destroyWeak(ptr %weakBlock) nounwind
|
|
ret void
|
|
}
|
|
|
|
; CHECK: define ptr @test1(ptr %p) {
|
|
; CHECK-NEXT: call ptr @llvm.objc.retain(ptr %p)
|
|
; CHECK-NEXT: ret ptr %p
|
|
|
|
define ptr @test1(ptr %p) {
|
|
%weakBlock = alloca ptr, align 8
|
|
%tmp7 = call ptr @llvm.objc.initWeak(ptr %weakBlock, ptr %p) nounwind
|
|
%tmp26 = call ptr @llvm.objc.loadWeakRetained(ptr %weakBlock) nounwind
|
|
call void @llvm.objc.destroyWeak(ptr %weakBlock) nounwind
|
|
ret ptr %tmp26
|
|
}
|
|
|
|
; CHECK: define ptr @test2(ptr %p, ptr %q) {
|
|
; CHECK-NEXT: call ptr @llvm.objc.retain(ptr %q)
|
|
; CHECK-NEXT: ret ptr %q
|
|
|
|
define ptr @test2(ptr %p, ptr %q) {
|
|
%weakBlock = alloca ptr, align 8
|
|
%tmp7 = call ptr @llvm.objc.initWeak(ptr %weakBlock, ptr %p) nounwind
|
|
%tmp19 = call ptr @llvm.objc.storeWeak(ptr %weakBlock, ptr %q) nounwind
|
|
%tmp26 = call ptr @llvm.objc.loadWeakRetained(ptr %weakBlock) nounwind
|
|
call void @llvm.objc.destroyWeak(ptr %weakBlock) nounwind
|
|
ret ptr %tmp26
|
|
}
|
|
|
|
declare ptr @llvm.objc.initWeak(ptr, ptr)
|
|
declare void @llvm.objc.destroyWeak(ptr)
|
|
declare ptr @llvm.objc.loadWeakRetained(ptr)
|
|
declare ptr @llvm.objc.storeWeak(ptr %weakBlock, ptr %q)
|