Reduce indentation with early exit.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2012-10-26 23:05:13 +00:00
parent 0de4fd23a7
commit 96e6da4841

View File

@ -588,35 +588,34 @@ TwoAddressInstructionPass::convertInstTo3Addr(MachineBasicBlock::iterator &mi,
MachineFunction::iterator MFI = MBB;
MachineInstr *NewMI = TII->convertToThreeAddress(MFI, mi, LV);
assert(MBB == MFI && "convertToThreeAddress changed iterator reference");
if (NewMI) {
DEBUG(dbgs() << "2addr: CONVERTING 2-ADDR: " << *mi);
DEBUG(dbgs() << "2addr: TO 3-ADDR: " << *NewMI);
bool Sunk = false;
if (!NewMI)
return false;
if (Indexes)
Indexes->replaceMachineInstrInMaps(mi, NewMI);
DEBUG(dbgs() << "2addr: CONVERTING 2-ADDR: " << *mi);
DEBUG(dbgs() << "2addr: TO 3-ADDR: " << *NewMI);
bool Sunk = false;
if (NewMI->findRegisterUseOperand(RegB, false, TRI))
// FIXME: Temporary workaround. If the new instruction doesn't
// uses RegB, convertToThreeAddress must have created more
// then one instruction.
Sunk = sink3AddrInstruction(NewMI, RegB, mi);
if (Indexes)
Indexes->replaceMachineInstrInMaps(mi, NewMI);
MBB->erase(mi); // Nuke the old inst.
if (NewMI->findRegisterUseOperand(RegB, false, TRI))
// FIXME: Temporary workaround. If the new instruction doesn't
// uses RegB, convertToThreeAddress must have created more
// then one instruction.
Sunk = sink3AddrInstruction(NewMI, RegB, mi);
if (!Sunk) {
DistanceMap.insert(std::make_pair(NewMI, Dist));
mi = NewMI;
nmi = llvm::next(mi);
}
MBB->erase(mi); // Nuke the old inst.
// Update source and destination register maps.
SrcRegMap.erase(RegA);
DstRegMap.erase(RegB);
return true;
if (!Sunk) {
DistanceMap.insert(std::make_pair(NewMI, Dist));
mi = NewMI;
nmi = llvm::next(mi);
}
return false;
// Update source and destination register maps.
SrcRegMap.erase(RegA);
DstRegMap.erase(RegB);
return true;
}
/// scanUses - Scan forward recursively for only uses, update maps if the use