diff options
author | Dehao Chen <dehao@google.com> | 2017-08-24 21:37:33 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-08-24 21:37:33 +0000 |
commit | 5e97f2344122a287350516067c84dc13f9d71726 (patch) | |
tree | 8a66a408a34273f1e203b977422fb21c4e778204 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | f0e27e63e74977527e6e86a0117a64fbf7326b3d (diff) | |
download | bcm5719-llvm-5e97f2344122a287350516067c84dc13f9d71726.tar.gz bcm5719-llvm-5e97f2344122a287350516067c84dc13f9d71726.zip |
Expose -mllvm -accurate-sample-profile to clang.
Summary: With accurate sample profile, we can do more aggressive size optimization. For some size-critical application, this can reduce the text size by 20%
Reviewers: davidxl, rsmith
Reviewed By: davidxl, rsmith
Subscribers: mehdi_amini, eraman, sanjoy, cfe-commits
Differential Revision: https://reviews.llvm.org/D37091
llvm-svn: 311707
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 17295ae2be8..a9a1a53be20 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -838,6 +838,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, Fn->addFnAttr("no-jump-tables", llvm::toStringRef(CGM.getCodeGenOpts().NoUseJumpTables)); + // Add profile-sample-accurate value. + if (CGM.getCodeGenOpts().ProfileSampleAccurate) + Fn->addFnAttr("profile-sample-accurate"); + if (getLangOpts().OpenCL) { // Add metadata for a kernel function. if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) |