[SampleFDO] Flow Sensitive Sample FDO (FSAFDO) profile loader
authorRong Xu <xur@google.com>
Wed, 18 Aug 2021 23:59:02 +0000 (16:59 -0700)
committerRong Xu <xur@google.com>
Thu, 19 Aug 2021 01:37:35 +0000 (18:37 -0700)
commit5fdaaf7fd8f35ac9c9de50a45b09e29c7b0d48c4
treed4d0b1f29de6c82b70765774da2542c3f37c76e4
parentc777e51468f5d44ad4600344683ecf9b46aa2b0f
[SampleFDO] Flow Sensitive Sample FDO (FSAFDO) profile loader

This patch implements Flow Sensitive Sample FDO (FSAFDO) profile
loader. We have two profile loaders for FS profile,
one before RegAlloc and one before BlockPlacement.

To enable it, when -fprofile-sample-use=<profile> is specified,
add "-enable-fs-discriminator=true \
     -disable-ra-fsprofile-loader=false \
     -disable-layout-fsprofile-loader=false"
to turn on the FS profile loaders.

Differential Revision: https://reviews.llvm.org/D107878
19 files changed:
clang/lib/CodeGen/BackendUtil.cpp
llvm/include/llvm/CodeGen/MIRSampleProfile.h [new file with mode: 0644]
llvm/include/llvm/CodeGen/MachineDominators.h
llvm/include/llvm/CodeGen/MachineOptimizationRemarkEmitter.h
llvm/include/llvm/CodeGen/Passes.h
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/Passes/PassBuilder.h
llvm/include/llvm/Support/PGOOptions.h [new file with mode: 0644]
llvm/include/llvm/Target/TargetMachine.h
llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
llvm/lib/CodeGen/CMakeLists.txt
llvm/lib/CodeGen/MIRSampleProfile.cpp [new file with mode: 0644]
llvm/lib/CodeGen/TargetPassConfig.cpp
llvm/lib/LTO/LTOBackend.cpp
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/CodeGen/X86/Inputs/fsloader.afdo [new file with mode: 0644]
llvm/test/CodeGen/X86/fsafdo_test2.ll
llvm/tools/opt/NewPMDriver.cpp