summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2013-05-24 12:26:52 +0000
committerDiego Novillo <dnovillo@google.com>2013-05-24 12:26:52 +0000
commit77226a03dca98e6237c1068f2652fe41bea7b687 (patch)
tree3a8cb78a478d9e82735484091ae29647e3ec9002 /include/llvm/Analysis
parent49a6a8d8f2994249c81b7914b07015714748a55c (diff)
downloadllvm-77226a03dca98e6237c1068f2652fe41bea7b687.tar.gz
llvm-77226a03dca98e6237c1068f2652fe41bea7b687.tar.bz2
llvm-77226a03dca98e6237c1068f2652fe41bea7b687.tar.xz
Add a new function attribute 'cold' to functions.
Other than recognizing the attribute, the patch does little else. It changes the branch probability analyzer so that edges into blocks postdominated by a cold function are given low weight. Added analysis and code generation tests. Added documentation for the new attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r--include/llvm/Analysis/BranchProbabilityInfo.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Analysis/BranchProbabilityInfo.h b/include/llvm/Analysis/BranchProbabilityInfo.h
index 6c23f7c3ae..4ff7121728 100644
--- a/include/llvm/Analysis/BranchProbabilityInfo.h
+++ b/include/llvm/Analysis/BranchProbabilityInfo.h
@@ -131,11 +131,15 @@ private:
/// \brief Track the set of blocks directly succeeded by a returning block.
SmallPtrSet<BasicBlock *, 16> PostDominatedByUnreachable;
+ /// \brief Track the set of blocks that always lead to a cold call.
+ SmallPtrSet<BasicBlock *, 16> PostDominatedByColdCall;
+
/// \brief Get sum of the block successors' weights.
uint32_t getSumForBlock(const BasicBlock *BB) const;
bool calcUnreachableHeuristics(BasicBlock *BB);
bool calcMetadataWeights(BasicBlock *BB);
+ bool calcColdCallHeuristics(BasicBlock *BB);
bool calcPointerHeuristics(BasicBlock *BB);
bool calcLoopBranchHeuristics(BasicBlock *BB);
bool calcZeroHeuristics(BasicBlock *BB);