summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2020-01-21 15:49:04 -0800
committerHans Wennborg <hans@chromium.org>2020-01-23 00:47:18 +0100
commitb5cdee9bdce49b31c74b0cf4f8231f66bbc2708e (patch)
tree0a914bcd0951fb45d3eee75a9b28cb7535045782 /llvm/lib
parent7adf83beece381d153f8b4a67fa341d13f9c4ba2 (diff)
downloadbcm5719-llvm-b5cdee9bdce49b31c74b0cf4f8231f66bbc2708e.tar.gz
bcm5719-llvm-b5cdee9bdce49b31c74b0cf4f8231f66bbc2708e.zip
[PGO][PGSO] Update BFI in CodeGenPrepare::optimizeSelectInst.
Summary: Without the BFI update, some hot blocks are incorrectly treated as cold code. This fixes a FDO perf regression in the TSVC benchmark from D71288. Reviewers: davidxl Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D73146 (cherry picked from commit ddbc728828c70728473b47c9f7427aa9514f3d17)
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index f05afd05874..003db39fe5f 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -6122,6 +6122,7 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) {
BasicBlock *StartBlock = SI->getParent();
BasicBlock::iterator SplitPt = ++(BasicBlock::iterator(LastSI));
BasicBlock *EndBlock = StartBlock->splitBasicBlock(SplitPt, "select.end");
+ BFI->setBlockFreq(EndBlock, BFI->getBlockFreq(StartBlock).getFrequency());
// Delete the unconditional branch that was just created by the split.
StartBlock->getTerminator()->eraseFromParent();
OpenPOWER on IntegriCloud