[llvm-commits] [llvm] r47059 - /llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
Evan Cheng
evan.cheng at apple.com
Wed Feb 13 01:18:16 PST 2008
Author: evancheng
Date: Wed Feb 13 03:18:16 2008
New Revision: 47059
URL: http://llvm.org/viewvc/llvm-project?rev=47059&view=rev
Log:
Simplify.
Modified:
llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
Modified: llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=47059&r1=47058&r2=47059&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveIntervalAnalysis.h Wed Feb 13 03:18:16 2008
@@ -217,14 +217,14 @@
/// maps used by register allocator.
void ReplaceMachineInstrInMaps(MachineInstr *MI, MachineInstr *NewMI) {
Mi2IndexMap::iterator mi2i = mi2iMap_.find(MI);
- if (mi2i != mi2iMap_.end()) {
- i2miMap_[mi2i->second/InstrSlots::NUM] = NewMI;
- Mi2IndexMap::const_iterator it = mi2iMap_.find(MI);
- assert(it != mi2iMap_.end() && "Invalid instruction!");
- unsigned Index = it->second;
- mi2iMap_.erase(MI);
- mi2iMap_[NewMI] = Index;
- }
+ if (mi2i == mi2iMap_.end())
+ return;
+ i2miMap_[mi2i->second/InstrSlots::NUM] = NewMI;
+ Mi2IndexMap::iterator it = mi2iMap_.find(MI);
+ assert(it != mi2iMap_.end() && "Invalid instruction!");
+ unsigned Index = it->second;
+ mi2iMap_.erase(it);
+ mi2iMap_[NewMI] = Index;
}
BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; }
More information about the llvm-commits
mailing list