[mips] Use range-based for loops and simplify slightly the code. NFC.

llvm-svn: 266471
This commit is contained in:
Vasileios Kalintiris 2016-04-15 20:18:48 +00:00
parent 0a91cf8a84
commit 36311395ae
1 changed files with 13 additions and 9 deletions

View File

@ -220,15 +220,19 @@ void MipsSEDAGToDAGISel::processFunctionAfterISel(MachineFunction &MF) {
MachineRegisterInfo *MRI = &MF.getRegInfo(); MachineRegisterInfo *MRI = &MF.getRegInfo();
for (MachineFunction::iterator MFI = MF.begin(), MFE = MF.end(); MFI != MFE; for (auto &MBB: MF) {
++MFI) for (auto &MI: MBB) {
for (MachineBasicBlock::iterator I = MFI->begin(); I != MFI->end(); ++I) { switch (MI.getOpcode()) {
if (I->getOpcode() == Mips::RDDSP) case Mips::RDDSP:
addDSPCtrlRegOperands(false, *I, MF); addDSPCtrlRegOperands(false, MI, MF);
else if (I->getOpcode() == Mips::WRDSP) break;
addDSPCtrlRegOperands(true, *I, MF); case Mips::WRDSP:
else addDSPCtrlRegOperands(true, MI, MF);
replaceUsesWithZeroReg(MRI, *I); break;
default:
replaceUsesWithZeroReg(MRI, MI);
}
}
} }
} }