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
42 lines
1.2 KiB
LLVM
42 lines
1.2 KiB
LLVM
; RUN: opt -passes=objc-arc-contract -S < %s | FileCheck %s
|
|
|
|
declare ptr @llvm.objc.autoreleaseReturnValue(ptr)
|
|
declare ptr @foo1()
|
|
|
|
; Check that ARC contraction replaces the function return with the value
|
|
; returned by @llvm.objc.autoreleaseReturnValue.
|
|
|
|
; CHECK-LABEL: define ptr @autoreleaseRVTailCall(
|
|
; CHECK: %[[V0:[0-9]+]] = tail call ptr @llvm.objc.autoreleaseReturnValue(
|
|
; CHECK: ret ptr %[[V0]]
|
|
|
|
define ptr @autoreleaseRVTailCall() {
|
|
%1 = call ptr @foo1()
|
|
%2 = tail call ptr @llvm.objc.autoreleaseReturnValue(ptr %1)
|
|
ret ptr %1
|
|
}
|
|
|
|
declare ptr @foo2(i32);
|
|
|
|
; CHECK-LABEL: define ptr @autoreleaseRVTailCallPhi(
|
|
; CHECK: %[[PHIVAL:.*]] = phi ptr [ %{{.*}}, %bb1 ], [ %{{.*}}, %bb2 ]
|
|
; CHECK: %[[RETVAL:.*]] = phi ptr [ %{{.*}}, %bb1 ], [ %{{.*}}, %bb2 ]
|
|
; CHECK: %[[V4:.*]] = tail call ptr @llvm.objc.autoreleaseReturnValue(ptr %[[PHIVAL]])
|
|
; CHECK: ret ptr %[[V4]]
|
|
|
|
define ptr @autoreleaseRVTailCallPhi(i1 %cond) {
|
|
entry:
|
|
br i1 %cond, label %bb1, label %bb2
|
|
bb1:
|
|
%v0 = call ptr @foo2(i32 1)
|
|
br label %bb3
|
|
bb2:
|
|
%v2 = call ptr @foo2(i32 2)
|
|
br label %bb3
|
|
bb3:
|
|
%phival = phi ptr [ %v0, %bb1 ], [ %v2, %bb2 ]
|
|
%retval = phi ptr [ %v0, %bb1 ], [ %v2, %bb2 ]
|
|
%v4 = tail call ptr @llvm.objc.autoreleaseReturnValue(ptr %phival)
|
|
ret ptr %retval
|
|
}
|