xref: /llvm-project/llvm/test/CodeGen/X86/load-sample-profile.ll (revision 65ef4d43577dc39ea3eb003a0237e91665788a9c)
1; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -debug-pass=Structure -enable-fs-discriminator=true -improved-fs-discriminator=true 2>&1 | FileCheck %s --check-prefix=NOPROFILE
2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -debug-pass=Structure -fs-profile-file=%S/Inputs/fsloader-mfs.afdo -enable-fs-discriminator=true -improved-fs-discriminator=true 2>&1 | FileCheck %s --check-prefix=PROFILE-NOMFS
3; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -debug-pass=Structure -fs-profile-file=%S/Inputs/fsloader-mfs.afdo -split-machine-functions -enable-fs-discriminator=true -improved-fs-discriminator=true 2>&1 | FileCheck %s --check-prefix=PROFILE-MFS
4
5;; No profile is specified, no load passes.
6; NOPROFILE: Add FS discriminators in MIR
7; NO-NOPROFILE: SampleFDO loader in MIR
8; NOPROFILE: Add FS discriminators in MIR
9; NO-NOPROFILE: SampleFDO loader in MIR
10; NOPROFILE: Add FS discriminators in MIR
11; NO-NOPROFILE: SampleFDO loader in MIR
12
13;; Profile is specified, so we have first 2 load passes.
14; PROFILE-NOMFS: Add FS discriminators in MIR
15; PROFILE-NOMFS: SampleFDO loader in MIR
16; PROFILE-NOMFS: Add FS discriminators in MIR
17; PROFILE-NOMFS: SampleFDO loader in MIR
18; PROFILE-NOMFS: Add FS discriminators in MIR
19;; But mfs is not specified, so no "SampleFDO loader should be created"
20; NO-PROFILE-NOMFS: SampleFDO loader in MIR
21
22;; Profile is specified with mfs, so we have 3 load passes.
23; PROFILE-MFS: Add FS discriminators in MIR
24; PROFILE-MFS: SampleFDO loader in MIR
25; PROFILE-MFS: Add FS discriminators in MIR
26; PROFILE-MFS: SampleFDO loader in MIR
27; PROFILE-MFS: Add FS discriminators in MIR
28; PROFILE-MFS: SampleFDO loader in MIR
29; PROFILE-MFS: Machine Function Splitter Transformation
30
31define void @foo4(i1 zeroext %0, i1 zeroext %1) nounwind {
32  br i1 %0, label %3, label %7
33
343:
35  %4 = call i32 @bar()
36  br label %7
37
385:
39  %6 = call i32 @baz()
40  br label %7
41
427:
43  br i1 %1, label %8, label %10
44
458:
46  %9 = call i32 @bam()
47  br label %12
48
4910:
50  %11 = call i32 @baz()
51  br label %12
52
5312:
54  %13 = tail call i32 @qux()
55  ret void
56}
57
58declare i32 @bar()
59declare i32 @baz()
60declare i32 @bam()
61declare i32 @qux()
62