File: opt-max-ptr-states.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (26 lines) | stat: -rw-r--r-- 890 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
; RUN: opt -passes=objc-arc -S < %s | FileCheck -check-prefix=ENABLE -check-prefix=CHECK %s
; RUN: opt -passes=objc-arc -arc-opt-max-ptr-states=1 -S < %s | FileCheck -check-prefix=DISABLE -check-prefix=CHECK %s

@g0 = common global ptr null, align 8

; CHECK: call ptr @llvm.objc.retain
; ENABLE-NOT: call ptr @llvm.objc.retain
; DISABLE: call ptr @llvm.objc.retain
; CHECK: call void @llvm.objc.release
; ENABLE-NOT: call void @llvm.objc.release
; DISABLE: call void @llvm.objc.release

define void @foo0(ptr %a) {
  %1 = tail call ptr @llvm.objc.retain(ptr %a)
  %2 = tail call ptr @llvm.objc.retain(ptr %a)
  %3 = load ptr, ptr @g0, align 8
  store ptr %a, ptr @g0, align 8
  tail call void @llvm.objc.release(ptr %3)
  tail call void @llvm.objc.release(ptr %a), !clang.imprecise_release !0
  ret void
}

declare ptr @llvm.objc.retain(ptr)
declare void @llvm.objc.release(ptr)

!0 = !{}