[llvm] r192213 - [mips] Simplify and optimize code.
Akira Hatanaka
ahatanaka at mips.com
Tue Oct 8 11:13:24 PDT 2013
Author: ahatanak
Date: Tue Oct 8 13:13:24 2013
New Revision: 192213
URL: http://llvm.org/viewvc/llvm-project?rev=192213&view=rev
Log:
[mips] Simplify and optimize code.
No intended functionality change.
Modified:
llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp
llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp?rev=192213&r1=192212&r2=192213&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsLongBranch.cpp Tue Oct 8 13:13:24 2013
@@ -241,7 +241,7 @@ void MipsLongBranch::replaceBranch(Machi
// and erase the original branch.
assert(Br->isBundledWithSucc());
MachineBasicBlock::instr_iterator II(Br);
- MIBundleBuilder(&*MIB).append(llvm::next(II)->removeFromBundle());
+ MIBundleBuilder(&*MIB).append((++II)->removeFromBundle());
Br->eraseFromParent();
}
Modified: llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp?rev=192213&r1=192212&r2=192213&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsMachineFunction.cpp Tue Oct 8 13:13:24 2013
@@ -121,24 +121,20 @@ bool MipsFunctionInfo::isEhDataRegFI(int
}
MachinePointerInfo MipsFunctionInfo::callPtrInfo(const StringRef &Name) {
- StringMap<const MipsCallEntry *>::const_iterator I;
- I = ExternalCallEntries.find(Name);
+ const MipsCallEntry *&E = ExternalCallEntries[Name];
- if (I != ExternalCallEntries.end())
- return MachinePointerInfo(I->getValue());
+ if (!E)
+ E = new MipsCallEntry(Name);
- const MipsCallEntry *E = ExternalCallEntries[Name] = new MipsCallEntry(Name);
return MachinePointerInfo(E);
}
MachinePointerInfo MipsFunctionInfo::callPtrInfo(const GlobalValue *Val) {
- ValueMap<const GlobalValue *, const MipsCallEntry *>::const_iterator I;
- I = GlobalCallEntries.find(Val);
+ const MipsCallEntry *&E = GlobalCallEntries[Val];
- if (I != GlobalCallEntries.end())
- return MachinePointerInfo(I->second);
+ if (!E)
+ E = new MipsCallEntry(Val);
- const MipsCallEntry *E = GlobalCallEntries[Val] = new MipsCallEntry(Val);
return MachinePointerInfo(E);
}
More information about the llvm-commits
mailing list