aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/LiveVariables.h
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
commit493a3d015cbb2bcc18d9293a4dec3b35c7493818 (patch)
tree0ba9a0617346b05c385d9490ac306a9b21e57d64 /include/llvm/CodeGen/LiveVariables.h
parent91bb61a1e2c96f727726c2fe7962df3e18ef5416 (diff)
downloadexternal_llvm-493a3d015cbb2bcc18d9293a4dec3b35c7493818.zip
external_llvm-493a3d015cbb2bcc18d9293a4dec3b35c7493818.tar.gz
external_llvm-493a3d015cbb2bcc18d9293a4dec3b35c7493818.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 'include/llvm/CodeGen/LiveVariables.h')
-rw-r--r--include/llvm/CodeGen/LiveVariables.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h
index aae7687..26c0362 100644
--- a/include/llvm/CodeGen/LiveVariables.h
+++ b/include/llvm/CodeGen/LiveVariables.h
@@ -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.
///