Transfer weights in transferSuccessorsAndUpdatePHIs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2012-08-13 23:13:25 +00:00
parent cb6889b23d
commit 03e593efc6

View File

@ -535,14 +535,13 @@ void MachineBasicBlock::transferSuccessors(MachineBasicBlock *fromMBB) {
while (!fromMBB->succ_empty()) {
MachineBasicBlock *Succ = *fromMBB->succ_begin();
uint32_t weight = 0;
uint32_t Weight = 0;
// If Weight list is empty it means we don't use it (disabled optimization).
if (!fromMBB->Weights.empty())
weight = *fromMBB->Weights.begin();
Weight = *fromMBB->Weights.begin();
addSuccessor(Succ, weight);
addSuccessor(Succ, Weight);
fromMBB->removeSuccessor(Succ);
}
}
@ -554,7 +553,10 @@ MachineBasicBlock::transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB) {
while (!fromMBB->succ_empty()) {
MachineBasicBlock *Succ = *fromMBB->succ_begin();
addSuccessor(Succ);
uint32_t Weight = 0;
if (!fromMBB->Weights.empty())
Weight = *fromMBB->Weights.begin();
addSuccessor(Succ, Weight);
fromMBB->removeSuccessor(Succ);
// Fix up any PHI nodes in the successor.