File: cgdata-no-merge-attached-call-garget.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (37 lines) | stat: -rw-r--r-- 1,307 bytes parent folder | download | duplicates (6)
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
27
28
29
30
31
32
33
34
35
36
37
; This test verifies that two similar functions, f1 and f2, are not merged
; when their attached call targets differ, since these targets cannot be parameterized.

; RUN: llc -mtriple=arm64-apple-darwin -enable-global-merge-func=true < %s | FileCheck %s

; CHECK-NOT: _f1.Tgm
; CHECK-NOT: _f2.Tgm

target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-darwin"

define i64 @f1(ptr %0) {
  %2 = call ptr @g1(ptr %0, i32 0) minsize [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
  tail call void (...) @llvm.objc.clang.arc.noop.use(ptr %2)
  %3 = call i64 @g2(ptr %2)
  tail call void @objc_release(ptr %2)
  %4 = tail call i64 @g3(i64 %3)
  ret i64 %4
}

define i64 @f2(ptr %0) {
  %2 = call ptr @g1(ptr %0, i32 0) minsize [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
  tail call void (...) @llvm.objc.clang.arc.noop.use(ptr %2)
  %3 = call i64 @g2(ptr %2)
  tail call void @objc_release(ptr %2)
  %4 = tail call i64 @g3(i64 %3)
  ret i64 %4
}

declare ptr @g1(ptr, i32)
declare i64 @g2(ptr)
declare i64 @g3(i64)

declare void @llvm.objc.clang.arc.noop.use(...)
declare ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue(ptr)
declare ptr @llvm.objc.retainAutoreleasedReturnValue(ptr)
declare void @objc_release(ptr)