File: mcount.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,245,044 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,666; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (35 lines) | stat: -rw-r--r-- 1,200 bytes parent folder | download | duplicates (3)
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
; Test proper insertion of mcount instrumentation
;
; RUN: llc < %s -mtriple=s390x-linux-gnu -verify-machineinstrs -o - | FileCheck %s
;
; CHECK: # %bb.0:
; CHECK-NEXT: stg %r14, 8(%r15)
; CHECK-NEXT: brasl %r14, mcount@PLT
; CHECK-NEXT: lg %r14, 8(%r15)
define dso_local signext i32 @fib(i32 noundef signext %n) #0 {
entry:
  %n.addr = alloca i32, align 4
  store i32 %n, ptr %n.addr, align 4
  %0 = load i32, ptr %n.addr, align 4
  %cmp = icmp sle i32 %0, 1
  br i1 %cmp, label %cond.true, label %cond.false

cond.true:                                        ; preds = %entry
  br label %cond.end

cond.false:                                       ; preds = %entry
  %1 = load i32, ptr %n.addr, align 4
  %sub = sub nsw i32 %1, 1
  %call = call signext i32 @fib(i32 noundef signext %sub)
  %2 = load i32, ptr %n.addr, align 4
  %sub1 = sub nsw i32 %2, 2
  %call2 = call signext i32 @fib(i32 noundef signext %sub1)
  %add = add nsw i32 %call, %call2
  br label %cond.end

cond.end:                                         ; preds = %cond.false, %cond.true
  %cond = phi i32 [ 1, %cond.true ], [ %add, %cond.false ]
  ret i32 %cond
}

attributes #0 = { "instrument-function-entry-inlined"="mcount" }