File: suppl-profile.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,388 kB
  • sloc: cpp: 7,438,767; ansic: 1,393,871; asm: 1,012,926; python: 241,728; f90: 86,635; objc: 75,411; 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 (49 lines) | stat: -rw-r--r-- 1,647 bytes parent folder | download | duplicates (19)
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
38
39
40
41
42
43
44
45
46
47
48
49
; Supplement instr profile suppl-profile.proftext with sample profile
; sample-profile.proftext.
; For hot functions:
; RUN: llvm-profdata merge -instr -suppl-min-size-threshold=0 \
; RUN:   -supplement-instr-with-sample=%p/Inputs/sample-profile-hot.proftext \
; RUN:   %S/Inputs/suppl-profile.proftext -o %t.profdata
; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S | FileCheck %s --check-prefix=HOT
; For warm functions:
; RUN: llvm-profdata merge -instr -suppl-min-size-threshold=0 \
; RUN:   -supplement-instr-with-sample=%p/Inputs/sample-profile-warm.proftext \
; RUN:   %S/Inputs/suppl-profile.proftext -o %t1.profdata
; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t1.profdata -S | FileCheck %s --check-prefix=WARM

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Check test_simple_for has proper hot/cold attribute and no profile counts.
; HOT: @test_simple_for(i32 %n)
; HOT-SAME: #[[ATTRIBTE:[0-9]*]]
; HOT-NOT: !prof !{{.*}}
; HOT-SAME: {
; HOT: attributes #[[ATTRIBTE]] = { hot }
; WARM: @test_simple_for(i32 %n)
; WARM-NOT: #{{.*}}
; WARM-NOT: !prof !{{.*}}
; WARM-SAME: {
define i32 @test_simple_for(i32 %n) #0 {
entry:
  br label %for.cond

for.cond:
  %i = phi i32 [ 0, %entry ], [ %inc1, %for.inc ]
  %sum = phi i32 [ 1, %entry ], [ %inc, %for.inc ]
  %cmp = icmp slt i32 %i, %n
  br i1 %cmp, label %for.body, label %for.end

for.body:
  %inc = add nsw i32 %sum, 1
  br label %for.inc

for.inc:
  %inc1 = add nsw i32 %i, 1
  br label %for.cond

for.end:
  ret i32 %sum
}

attributes #0 = { cold }