1 ; RUN: opt -S -aa-pipeline=basic-aa,objc-arc-aa -passes=gvn < %s | FileCheck %s
3 @x = common global ptr null, align 8
5 declare ptr @llvm.objc.retain(ptr)
6 declare i32 @llvm.objc.sync.enter(ptr)
7 declare i32 @llvm.objc.sync.exit(ptr)
9 ; GVN should be able to eliminate this redundant load, with ARC-specific
12 ; CHECK: define ptr @test0(i32 %n)
14 ; CHECK-NEXT: %s = load ptr, ptr @x
18 define ptr @test0(i32 %n) nounwind {
21 %0 = tail call ptr @llvm.objc.retain(ptr %s) nounwind
26 ; GVN should not be able to eliminate this redundant load, with ARC-specific
29 ; CHECK-LABEL: define ptr @test1(
34 define ptr @test1(i32 %n) nounwind {
37 %0 = call i32 @llvm.objc.sync.enter(ptr %s)
39 %1 = call i32 @llvm.objc.sync.exit(ptr %s)