Files
clang-p2996/llvm/test/Bitcode/upgrade-arc-attachedcall-bundle.ll
Ahmed Bougacha 362b4066f0 [ObjCARC] Drop nullary clang.arc.attachedcall bundles in autoupgrade.
In certain use-cases, these can be emitted by old compilers, but the
operand is now always required.  These are only used for optimizations,
so it's safe to drop them if they happen to have the now-invalid format.
The semantically-required call is already a separate instruction.

Differential Revision: https://reviews.llvm.org/D123811
2022-05-20 15:27:29 -07:00

24 lines
781 B
LLVM

; Test that nullary clang.arc.attachedcall operand bundles are "upgraded".
; RUN: llvm-dis %s.bc -o - | FileCheck %s
; RUN: verify-uselistorder %s.bc
define i8* @invalid() {
; CHECK-LABEL: define i8* @invalid() {
; CHECK-NEXT: %tmp0 = call i8* @foo(){{$}}
; CHECK-NEXT: ret i8* %tmp0
%tmp0 = call i8* @foo() [ "clang.arc.attachedcall"() ]
ret i8* %tmp0
}
define i8* @valid() {
; CHECK-LABEL: define i8* @valid() {
; CHECK-NEXT: %tmp0 = call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
; CHECK-NEXT: ret i8* %tmp0
%tmp0 = call i8* @foo() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
ret i8* %tmp0
}
declare i8* @foo()
declare i8* @llvm.objc.retainAutoreleasedReturnValue(i8*)