summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/CodeExtractor.cpp
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2018-01-17 22:24:23 +0000
committerEaswaran Raman <eraman@google.com>2018-01-17 22:24:23 +0000
commite5b8de2f1f4b785fe4105c74aa055e9319ebd9ac (patch)
tree735025f7c1b406cf0db165a0255412cc40de212c /llvm/lib/Transforms/Utils/CodeExtractor.cpp
parentd109b5e0273565d3af272d8c3660a4ce233f6494 (diff)
downloadbcm5719-llvm-e5b8de2f1f4b785fe4105c74aa055e9319ebd9ac.tar.gz
bcm5719-llvm-e5b8de2f1f4b785fe4105c74aa055e9319ebd9ac.zip
Add a ProfileCount class to represent entry counts.
Summary: The class wraps a uint64_t and an enum to represent the type of profile count (real and synthetic) with some helper methods. Reviewers: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41883 llvm-svn: 322771
Diffstat (limited to 'llvm/lib/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CodeExtractor.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index 08125962e0b..2fc987d860d 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -66,6 +66,7 @@
#include <vector>
using namespace llvm;
+using ProfileCount = Function::ProfileCount;
#define DEBUG_TYPE "code-extractor"
@@ -1163,10 +1164,10 @@ Function *CodeExtractor::extractCodeRegion() {
// Update the entry count of the function.
if (BFI) {
- Optional<uint64_t> EntryCount =
- BFI->getProfileCountFromFreq(EntryFreq.getFrequency());
- if (EntryCount.hasValue())
- newFunction->setEntryCount(EntryCount.getValue());
+ auto Count = BFI->getProfileCountFromFreq(EntryFreq.getFrequency());
+ if (Count.hasValue())
+ newFunction->setEntryCount(
+ ProfileCount(Count.getValue(), Function::PCT_Real)); // FIXME
BFI->setBlockFreq(codeReplacer, EntryFreq.getFrequency());
}
OpenPOWER on IntegriCloud