aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2009-05-26 18:27:15 +0000
committerJeffrey Yasskin <jyasskin@google.com>2009-05-26 18:27:15 +0000
commit02d392b4b8dbbc83fb98fba9b6116289ca70f4e8 (patch)
tree0ba9a0617346b05c385d9490ac306a9b21e57d64 /lib/CodeGen/LiveIntervalAnalysis.cpp
parent140f08f5468ee1925809b47734d5cf0f8a85fa21 (diff)
downloadexternal_llvm-02d392b4b8dbbc83fb98fba9b6116289ca70f4e8.zip
external_llvm-02d392b4b8dbbc83fb98fba9b6116289ca70f4e8.tar.gz
external_llvm-02d392b4b8dbbc83fb98fba9b6116289ca70f4e8.tar.bz2
LiveVariables::VarInfo contains an AliveBlocks BitVector, which has as many
entries as there are basic blocks in the function. LiveVariables::getVarInfo creates a VarInfo struct for every register in the function, leading to quadratic space use. This patch changes the BitVector to a SparseBitVector, which doesn't help the worst-case memory use but does reduce the actual use in very long functions with short-lived variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 612b9ac..bf18015 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -422,7 +422,7 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
// If the kill happens after the definition, we have an intra-block
// live range.
if (killIdx > defIndex) {
- assert(vi.AliveBlocks.none() &&
+ assert(vi.AliveBlocks.empty() &&
"Shouldn't be alive across any blocks!");
LiveRange LR(defIndex, killIdx, ValNo);
interval.addRange(LR);
@@ -443,10 +443,10 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
// Iterate over all of the blocks that the variable is completely
// live in, adding [insrtIndex(begin), instrIndex(end)+4) to the
// live interval.
- for (int i = vi.AliveBlocks.find_first(); i != -1;
- i = vi.AliveBlocks.find_next(i)) {
- LiveRange LR(getMBBStartIdx(i),
- getMBBEndIdx(i)+1, // MBB ends at -1.
+ for (SparseBitVector<>::iterator I = vi.AliveBlocks.begin(),
+ E = vi.AliveBlocks.end(); I != E; ++I) {
+ LiveRange LR(getMBBStartIdx(*I),
+ getMBBEndIdx(*I)+1, // MBB ends at -1.
ValNo);
interval.addRange(LR);
DOUT << " +" << LR;