diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-04-25 20:20:15 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-04-25 20:20:15 +0000 |
commit | a4b2bab23313b1d45e1f3e6c9610a1e83fce4005 (patch) | |
tree | 7bc37fc0a510c8667a8524d2988504c88b1aa68a /lib/CodeGen | |
parent | 11d8fb960963a1f8a7e2b2972bc560a5b24cf216 (diff) | |
download | external_llvm-a4b2bab23313b1d45e1f3e6c9610a1e83fce4005.zip external_llvm-a4b2bab23313b1d45e1f3e6c9610a1e83fce4005.tar.gz external_llvm-a4b2bab23313b1d45e1f3e6c9610a1e83fce4005.tar.bz2 |
Reuse unused val#'s to avoid running out of memory in extreme cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/LiveInterval.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp index 39d6611..0450c35 100644 --- a/lib/CodeGen/LiveInterval.cpp +++ b/lib/CodeGen/LiveInterval.cpp @@ -577,6 +577,7 @@ void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers, 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 @@ void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers, 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 @@ void LiveInterval::MergeInClobberRanges(const LiveInterval &Clobbers, // Insert the clobber interval. IP = addRangeFrom(LiveRange(SubRangeStart, SubRangeEnd, ClobberValNo), IP); + UnusedValNo = 0; } } } |