[llvm-commits] [llvm] r70069 - /llvm/trunk/lib/CodeGen/LiveInterval.cpp
Evan Cheng
evan.cheng at apple.com
Sat Apr 25 13:20:16 PDT 2009
Author: evancheng
Date: Sat Apr 25 15:20:15 2009
New Revision: 70069
URL: http://llvm.org/viewvc/llvm-project?rev=70069&view=rev
Log:
Reuse unused val#'s to avoid running out of memory in extreme cases.
Modified:
llvm/trunk/lib/CodeGen/LiveInterval.cpp
Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=70069&r1=70068&r2=70069&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Sat Apr 25 15:20:15 2009
@@ -577,6 +577,7 @@
if (Clobbers.empty()) return;
DenseMap<VNInfo*, VNInfo*> ValNoMaps;
+ VNInfo *UnusedValNo = 0;
iterator IP = begin();
for (const_iterator I = Clobbers.begin(), E = Clobbers.end(); I != E; ++I) {
// For every val# in the Clobbers interval, create a new "unknown" val#.
@@ -584,8 +585,10 @@
DenseMap<VNInfo*, VNInfo*>::iterator VI = ValNoMaps.find(I->valno);
if (VI != ValNoMaps.end())
ClobberValNo = VI->second;
+ else if (UnusedValNo)
+ ClobberValNo = UnusedValNo;
else {
- ClobberValNo = getNextValue(~0U, 0, VNInfoAllocator);
+ UnusedValNo = ClobberValNo = getNextValue(~0U, 0, VNInfoAllocator);
ValNoMaps.insert(std::make_pair(I->valno, ClobberValNo));
}
@@ -623,6 +626,7 @@
// Insert the clobber interval.
IP = addRangeFrom(LiveRange(SubRangeStart, SubRangeEnd, ClobberValNo),
IP);
+ UnusedValNo = 0;
}
}
}
More information about the llvm-commits
mailing list