Update edge weights correctly in replaceSuccessor().
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 10 Aug 2012 03:23:27 +0000 (03:23 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 10 Aug 2012 03:23:27 +0000 (03:23 +0000)
commit15121ca0d18e6a0f6a16f8a696f4efc3782dc965
treefa9130bbbf99063a36a5f389c5aa7c928d4e4548
parent94bc246a8b2fd0ef371c8f3846ac9a5a367ed9ab
Update edge weights correctly in replaceSuccessor().

When replacing Old with New, it can happen that New is already a
successor. Add the old and new edge weights instead of creating a
duplicate edge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161653 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineBasicBlock.cpp
test/CodeGen/X86/br-fold.ll