diff options
author | Cong Hou <congh@google.com> | 2015-12-18 21:53:24 +0000 |
---|---|---|
committer | Cong Hou <congh@google.com> | 2015-12-18 21:53:24 +0000 |
commit | fd0d62b87ef54e4cfdee7eb9ba7925af03d396aa (patch) | |
tree | 54cedcb700b316358a7ac7070c0cd06400bcdde5 /llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp | |
parent | 0f59cb38e7f319ee46b66812b212a5afaa3572bb (diff) | |
download | bcm5719-llvm-fd0d62b87ef54e4cfdee7eb9ba7925af03d396aa.tar.gz bcm5719-llvm-fd0d62b87ef54e4cfdee7eb9ba7925af03d396aa.zip |
Use getEdgeProbability() instead of getEdgeWeight() in BFI and remove getEdgeWeight() interfaces from MBPI.
This patch removes all getEdgeWeight() interfaces from CodeGen directory. As
getEdgeProbability() is a little more expensive than getEdgeWeight(), I will
compose a patch soon in which BPI only stores probabilities instead of edge
weights so that getEdgeProbability() will have O(1) time.
Differential revision: http://reviews.llvm.org/D15489
llvm-svn: 256039
Diffstat (limited to 'llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp b/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp index 5478dcba261..cf6d4018cb7 100644 --- a/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp +++ b/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp @@ -28,19 +28,6 @@ char MachineBranchProbabilityInfo::ID = 0; void MachineBranchProbabilityInfo::anchor() { } -uint32_t MachineBranchProbabilityInfo::getEdgeWeight( - const MachineBasicBlock *Src, - MachineBasicBlock::const_succ_iterator Dst) const { - return Src->getSuccProbability(Dst).getNumerator(); -} - -uint32_t MachineBranchProbabilityInfo::getEdgeWeight( - const MachineBasicBlock *Src, const MachineBasicBlock *Dst) const { - // This is a linear search. Try to use the const_succ_iterator version when - // possible. - return getEdgeWeight(Src, std::find(Src->succ_begin(), Src->succ_end(), Dst)); -} - BranchProbability MachineBranchProbabilityInfo::getEdgeProbability( const MachineBasicBlock *Src, MachineBasicBlock::const_succ_iterator Dst) const { |