aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-08 01:10:31 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-08 01:10:31 +0000
commit0556be983d04f5e347d79bddf9cfd1148d302e92 (patch)
tree78310e1eef81931b030d5fde0c5c7a7cffc4400e /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent1be131ba275b33e674d09fc84a5ae5f4f27c8e15 (diff)
downloadllvm-0556be983d04f5e347d79bddf9cfd1148d302e92.zip
llvm-0556be983d04f5e347d79bddf9cfd1148d302e92.tar.gz
llvm-0556be983d04f5e347d79bddf9cfd1148d302e92.tar.bz2
Revert "Fix a quadratic algorithm in MachineBranchProbabilityInfo."
It caused an assertion failure when compiling consumer-typeset. llvm-svn: 161463
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 2ba414d..f361d1a 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -912,11 +912,12 @@ MachineBasicBlock::findDebugLoc(instr_iterator MBBI) {
/// getSuccWeight - Return weight of the edge from this block to MBB.
///
-uint32_t MachineBasicBlock::getSuccWeight(const_succ_iterator Succ) const {
+uint32_t MachineBasicBlock::getSuccWeight(const MachineBasicBlock *succ) const {
if (Weights.empty())
return 0;
- return *getWeightIterator(Succ);
+ const_succ_iterator I = std::find(Successors.begin(), Successors.end(), succ);
+ return *getWeightIterator(I);
}
/// getWeightIterator - Return wight iterator corresonding to the I successor