summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/BranchProbabilityInfo.cpp
diff options
context:
space:
mode:
authorJun Bum Lim <junbuml@codeaurora.org>2016-09-23 17:26:14 +0000
committerJun Bum Lim <junbuml@codeaurora.org>2016-09-23 17:26:14 +0000
commit3822939ba79fbae0cd7464a403ffb63fca53471b (patch)
tree80f06643b7105a9a2f9c633dcdb07d28773c7ae9 /llvm/lib/Analysis/BranchProbabilityInfo.cpp
parent7bc254f89c4d7abd26e0c9ccffac2b650c2b6500 (diff)
downloadbcm5719-llvm-3822939ba79fbae0cd7464a403ffb63fca53471b.tar.gz
bcm5719-llvm-3822939ba79fbae0cd7464a403ffb63fca53471b.zip
Enhance calcColdCallHeuristics for InvokeInst
Summary: When identifying cold blocks, consider only the edge to the normal destination if the terminator is InvokeInst and let calcInvokeHeuristics() decide edge weights for the InvokeInst. Reviewers: mcrosier, hfinkel, davidxl Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D24868 llvm-svn: 282262
Diffstat (limited to 'llvm/lib/Analysis/BranchProbabilityInfo.cpp')
-rw-r--r--llvm/lib/Analysis/BranchProbabilityInfo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
index bf02653b492..0228e895879 100644
--- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp
+++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -279,6 +279,16 @@ bool BranchProbabilityInfo::calcColdCallHeuristics(const BasicBlock *BB) {
}
}
+ if (auto *II = dyn_cast<InvokeInst>(TI)) {
+ // If the terminator is an InvokeInst, consider only the normal destination
+ // block.
+ if (PostDominatedByColdCall.count(II->getNormalDest()))
+ PostDominatedByColdCall.insert(BB);
+ // Return false here so that edge weights for InvokeInst could be decided
+ // in calcInvokeHeuristics().
+ return false;
+ }
+
// Skip probabilities if this block has a single successor.
if (TI->getNumSuccessors() == 1 || ColdEdges.empty())
return false;
OpenPOWER on IntegriCloud