diff options
Diffstat (limited to 'lib/Target/PowerPC/PPCBranchSelector.cpp')
| -rw-r--r-- | lib/Target/PowerPC/PPCBranchSelector.cpp | 16 | 
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Target/PowerPC/PPCBranchSelector.cpp b/lib/Target/PowerPC/PPCBranchSelector.cpp index 64b8f1168beb8..0d1bb9297bcb3 100644 --- a/lib/Target/PowerPC/PPCBranchSelector.cpp +++ b/lib/Target/PowerPC/PPCBranchSelector.cpp @@ -130,7 +130,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {      BlockSizes[MBB->getNumber()].first = BlockSize;      FuncSize += BlockSize;    } -   +    // If the entire function is smaller than the displacement of a branch field,    // we know we don't need to shrink any branches in this function.  This is a    // common case. @@ -138,7 +138,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {      BlockSizes.clear();      return false;    } -   +    // For each conditional branch, if the offset to its destination is larger    // than the offset field allows, transform it into a long branch sequence    // like this: @@ -153,7 +153,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {    while (MadeChange) {      // Iteratively expand branches until we reach a fixed point.      MadeChange = false; -   +      for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;           ++MFI) {        MachineBasicBlock &MBB = *MFI; @@ -175,7 +175,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {            MBBStartOffset += TII->getInstSizeInBytes(*I);            continue;          } -         +          // Determine the offset from the current branch to the destination          // block.          int BranchSize; @@ -184,7 +184,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {            // start of this block to this branch, plus the sizes of all blocks            // from this block to the dest.            BranchSize = MBBStartOffset; -           +            for (unsigned i = Dest->getNumber(), e = MBB.getNumber(); i != e; ++i)              BranchSize += BlockSizes[i].first;          } else { @@ -213,7 +213,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {            // 2. Target MBB            PPC::Predicate Pred = (PPC::Predicate)I->getOperand(0).getImm();            unsigned CRReg = I->getOperand(1).getReg(); -        +            // Jump over the uncond branch inst (i.e. $PC+8) on opposite condition.            BuildMI(MBB, I, dl, TII->get(PPC::BCC))              .addImm(PPC::InvertPredicate(Pred)).addReg(CRReg).addImm(2); @@ -234,7 +234,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {          } else {             llvm_unreachable("Unhandled branch type!");          } -         +          // Uncond branch to the real destination.          I = BuildMI(MBB, I, dl, TII->get(PPC::B)).addMBB(Dest); @@ -277,7 +277,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {      EverMadeChange |= MadeChange;    } -   +    BlockSizes.clear();    return true;  }  | 
