File tree Expand file tree Collapse file tree 7 files changed +19
-19
lines changed
llvm/test/Transforms/SampleProfile Expand file tree Collapse file tree 7 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 1
- ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze -branch-prob | FileCheck %s
2
- ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze - branch-prob | FileCheck %s
1
+ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
2
+ ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/branch.prof | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
3
3
4
4
; Original C++ code for this test case:
5
5
;
30
30
31
31
; Function Attrs: uwtable
32
32
define i32 @main (i32 %argc , i8** %argv ) #0 !dbg !6 {
33
- ; CHECK: Printing analysis 'Branch Probability Analysis' for function 'main':
33
+ ; CHECK: Printing analysis {{.*}} for function 'main':
34
34
35
35
entry:
36
36
%retval = alloca i32 , align 4
Original file line number Diff line number Diff line change 1
- ; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob | FileCheck %s
2
- ; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/calls.prof | opt -analyze - branch-prob | FileCheck %s
1
+ ; RUN: opt < %s -instcombine -sample-profile -sample-profile-file=%S/Inputs/calls.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
2
+ ; RUN: opt < %s -passes="function(instcombine),sample-profile" -sample-profile-file=%S/Inputs/calls.prof | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
3
3
4
4
; Original C++ test case
5
5
;
Original file line number Diff line number Diff line change 1
- ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze -branch-prob | FileCheck %s
2
- ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze - branch-prob | FileCheck %s
1
+ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
2
+ ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/discriminator.prof | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
3
3
4
4
; Original code
5
5
;
23
23
; but the then branch (line 3.1) is only executed 5 times.
24
24
25
25
define i32 @foo (i32 %i ) #0 !dbg !4 {
26
- ; CHECK: Printing analysis 'Branch Probability Analysis' for function 'foo':
26
+ ; CHECK: Printing analysis {{.*}} for function 'foo':
27
27
entry:
28
28
%i.addr = alloca i32 , align 4
29
29
%x = alloca i32 , align 4
Original file line number Diff line number Diff line change 2
2
; formats. This checks that we produce the same profile annotations regardless
3
3
; of the profile format.
4
4
;
5
- ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze -branch-prob | FileCheck %s
6
- ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze -branch-prob | FileCheck %s
5
+ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
6
+ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
7
7
8
- ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -analyze - branch-prob | FileCheck %s
9
- ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -analyze - branch-prob | FileCheck %s
8
+ ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.prof | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
9
+ ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/fnptr.binprof | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
10
10
11
11
; CHECK: edge for.body3 -> if.then probability is 0x1a56a56a / 0x80000000 = 20.58%
12
12
; CHECK: edge for.body3 -> if.else probability is 0x65a95a96 / 0x80000000 = 79.42%
Original file line number Diff line number Diff line change 1
- ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze -branch-prob | FileCheck %s
2
- ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze - branch-prob | FileCheck %s
1
+ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
2
+ ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/offset.prof | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
3
3
4
4
; Original C++ code for this test case:
5
5
;
Original file line number Diff line number Diff line change 1
- ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze -branch-prob | FileCheck %s
2
- ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze - branch-prob | FileCheck %s
1
+ ; RUN: opt < %s -sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -analyze -branch-prob -enable-new-pm=0 | FileCheck %s
2
+ ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/propagate.prof | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
3
3
4
4
; Original C++ code for this test case:
5
5
;
Original file line number Diff line number Diff line change 1
- ; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/remap.prof -sample-profile-remapping-file=%S/Inputs/remap.map | opt -analyze - branch-prob | FileCheck %s
1
+ ; RUN: opt %s -passes=sample-profile -sample-profile-file=%S/Inputs/remap.prof -sample-profile-remapping-file=%S/Inputs/remap.map | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
2
2
;
3
3
; Check whether profile remapping work with loading profile on demand used by extbinary format profile.
4
4
; RUN: llvm-profdata merge -sample -extbinary %S/Inputs/remap.prof -o %t.extbinary.afdo
5
- ; RUN: opt %s -passes=sample-profile -sample-profile-file=%t.extbinary.afdo -sample-profile-remapping-file=%S/Inputs/remap.map | opt -analyze - branch-prob | FileCheck %s
5
+ ; RUN: opt %s -passes=sample-profile -sample-profile-file=%t.extbinary.afdo -sample-profile-remapping-file=%S/Inputs/remap.map | opt -passes='print< branch-prob>' -disable-output 2>&1 | FileCheck %s
6
6
;
7
7
; Reduced from branch.ll
8
8
9
9
declare i1 @foo ()
10
10
11
11
define void @_ZN3foo3barERKN1M1XINS_6detail3quxEEE () #0 !dbg !2 {
12
- ; CHECK: Printing analysis 'Branch Probability Analysis' for function '_ZN3foo3barERKN1M1XINS_6detail3quxEEE':
12
+ ; CHECK: Printing analysis {{.*}} for function '_ZN3foo3barERKN1M1XINS_6detail3quxEEE':
13
13
14
14
entry:
15
15
%cmp = call i1 @foo (), !dbg !6
You can’t perform that action at this time.
0 commit comments