[llvm-commits] [llvm] r161805 - /llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Mon Aug 13 16:13:25 PDT 2012
Author: stoklund
Date: Mon Aug 13 18:13:25 2012
New Revision: 161805
URL: http://llvm.org/viewvc/llvm-project?rev=161805&view=rev
Log:
Transfer weights in transferSuccessorsAndUpdatePHIs().
Modified:
llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=161805&r1=161804&r2=161805&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Mon Aug 13 18:13:25 2012
@@ -535,14 +535,13 @@
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 @@
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.
More information about the llvm-commits
mailing list