diff options
author | Rong Xu <xur@google.com> | 2020-12-14 15:54:28 -0800 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2020-12-14 15:56:10 -0800 |
commit | 54e03d03a7a4d47f09d40bcbcfe484066a52a077 (patch) | |
tree | a8c8a61096d0715fe2b1446d92b4e94399937ed2 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 9eac818370fe4b50a167627593bfe53e61c216bc (diff) | |
download | llvm-54e03d03a7a4d47f09d40bcbcfe484066a52a077.zip llvm-54e03d03a7a4d47f09d40bcbcfe484066a52a077.tar.gz llvm-54e03d03a7a4d47f09d40bcbcfe484066a52a077.tar.bz2 |
[PGO] Verify BFI counts after loading profile data
This patch adds the functionality to compare BFI counts with real
profile
counts right after reading the profile. It will print remarks under
-Rpass-analysis=pgo, or the internal option -pass-remarks-analysis=pgo.
Differential Revision: https://reviews.llvm.org/D91813
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 0bb9c91..dec0cba 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1744,6 +1744,13 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, B.addAttribute(llvm::Attribute::OptimizeForSize); B.addAttribute(llvm::Attribute::Cold); } + if (D->hasAttr<HotAttr>()) { + if (!ShouldAddOptNone) + B.addAttribute(llvm::Attribute::OptimizeForSize); + // xur + // B.addAttribute(llvm::Attribute::Hot); + fprintf(stderr, "hihi 1\n"); + } if (D->hasAttr<MinSizeAttr>()) B.addAttribute(llvm::Attribute::MinSize); |