summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2016-03-23 18:18:26 +0000
committerEaswaran Raman <eraman@google.com>2016-03-23 18:18:26 +0000
commit12b79aa0f1b7aa6e792a0b65d219a969f4ea8f0b (patch)
tree8661b501acc2524157130488c0e91e2797d73f58 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentd1728f0e5f5f4ab236febf2ae96949a974dca83a (diff)
downloadbcm5719-llvm-12b79aa0f1b7aa6e792a0b65d219a969f4ea8f0b.tar.gz
bcm5719-llvm-12b79aa0f1b7aa6e792a0b65d219a969f4ea8f0b.zip
Add getBlockProfileCount method to BlockFrequencyInfo
Differential Revision: http://reviews.llvm.org/D18233 llvm-svn: 264179
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 6510bce92b7..26cfe5943e1 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -34,7 +34,6 @@
#include "llvm/IR/Operator.h"
#include "llvm/IR/UseListOrder.h"
#include "llvm/IR/ValueSymbolTable.h"
-#include "llvm/ProfileData/ProfileCommon.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
@@ -2575,14 +2574,11 @@ static void WriteFunction(
auto *CalledFunction = CS.getCalledFunction();
if (CalledFunction && CalledFunction->hasName() &&
!CalledFunction->isIntrinsic()) {
- uint64_t ScaledCount = 0;
- if (HasProfileData)
- ScaledCount = getBlockProfileCount(
- BFI->getBlockFreq(&(*BB)).getFrequency(), BFI->getEntryFreq(),
- F.getEntryCount().getValue());
+ auto ScaledCount = BFI ? BFI->getBlockProfileCount(&*BB) : None;
unsigned CalleeId = VE.getValueID(
M->getValueSymbolTable().lookup(CalledFunction->getName()));
- CallGraphEdges[CalleeId] += ScaledCount;
+ CallGraphEdges[CalleeId] +=
+ (ScaledCount ? ScaledCount.getValue() : 0);
}
}
findRefEdges(&*I, VE, RefEdges, Visited);
OpenPOWER on IntegriCloud