aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBlockPlacement.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2020-09-23 09:27:34 -0700
committerGuozhi Wei <carrot@google.com>2020-09-23 09:31:45 -0700
commitfd75ad86624eaebf21e544335ea28f12e54a5ec1 (patch)
tree6914fbb905de191aa7c1e8148d8ff24c9c5fa215 /llvm/lib/CodeGen/MachineBlockPlacement.cpp
parent63998649dd4886ecf9b5c8304173cb0c7357cd5d (diff)
downloadllvm-fd75ad86624eaebf21e544335ea28f12e54a5ec1.zip
llvm-fd75ad86624eaebf21e544335ea28f12e54a5ec1.tar.gz
llvm-fd75ad86624eaebf21e544335ea28f12e54a5ec1.tar.bz2
[MBFIWrapper] Add a new function getBlockProfileCount
MBFIWrapper keeps track of block frequencies of newly created blocks and modified blocks, modified block frequencies should also impact block profile count. This class doesn't provide interface getBlockProfileCount, users can only use the underlying MBFI to query profile count, the underlying MBFI doesn't know the modifications made in MBFIWrapper, so it either provides stale profile count for modified block or simply crashes on new blocks. So this patch add function getBlockProfileCount to class MBFIWrapper to handle new blocks or modified blocks. Differential Revision: https://reviews.llvm.org/D87802
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBlockPlacement.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index e32ea57..8a86696 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -418,7 +418,7 @@ class MachineBlockPlacement : public MachineFunctionPass {
/// The return value is used to model tail duplication cost.
BlockFrequency getBlockCountOrFrequency(const MachineBasicBlock *BB) {
if (UseProfileCount) {
- auto Count = MBFI->getMBFI().getBlockProfileCount(BB);
+ auto Count = MBFI->getBlockProfileCount(BB);
if (Count)
return *Count;
else