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
This commit is contained in:
Jeffrey Yasskin
2009-05-26 18:27:15 +00:00
parent 91bb61a1e2
commit 493a3d015c
4 changed files with 17 additions and 19 deletions

View File

@ -33,6 +33,7 @@
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/SparseBitVector.h"
namespace llvm {
@ -75,7 +76,7 @@ public:
/// through. This is a bit set which uses the basic block number as an
/// index.
///
BitVector AliveBlocks;
SparseBitVector<> AliveBlocks;
/// NumUses - Number of uses of this register across the entire function.
///