1 ; Supplement instr profile suppl-profile.proftext with sample profile
2 ; sample-profile.proftext.
4 ; RUN: llvm-profdata merge -instr -suppl-min-size-threshold=0 \
5 ; RUN: -supplement-instr-with-sample=%p/Inputs/sample-profile-hot.proftext \
6 ; RUN: %S/Inputs/suppl-profile.proftext -o %t.profdata
7 ; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S | FileCheck %s --check-prefix=HOT
9 ; RUN: llvm-profdata merge -instr -suppl-min-size-threshold=0 \
10 ; RUN: -supplement-instr-with-sample=%p/Inputs/sample-profile-warm.proftext \
11 ; RUN: %S/Inputs/suppl-profile.proftext -o %t1.profdata
12 ; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t1.profdata -S | FileCheck %s --check-prefix=WARM
14 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
15 target triple = "x86_64-unknown-linux-gnu"
17 ; Check test_simple_for has proper hot/cold attribute and no profile counts.
18 ; HOT: @test_simple_for(i32 %n)
19 ; HOT-SAME: #[[ATTRIBTE:[0-9]*]]
20 ; HOT-NOT: !prof !{{.*}}
22 ; HOT: attributes #[[ATTRIBTE]] = { hot }
23 ; WARM: @test_simple_for(i32 %n)
25 ; WARM-NOT: !prof !{{.*}}
27 define i32 @test_simple_for(i32 %n) #0 {
32 %i = phi i32 [ 0, %entry ], [ %inc1, %for.inc ]
33 %sum = phi i32 [ 1, %entry ], [ %inc, %for.inc ]
34 %cmp = icmp slt i32 %i, %n
35 br i1 %cmp, label %for.body, label %for.end
38 %inc = add nsw i32 %sum, 1
42 %inc1 = add nsw i32 %i, 1
49 attributes #0 = { cold }