diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2009-05-26 18:27:15 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2009-05-26 18:27:15 +0000 |
commit | 7d287cb7ed0188f85fa4730f3e3c079aff5457d9 (patch) | |
tree | 096ddc7d556d8a046c7cb1418e931c62495dd9b1 /llvm/lib/CodeGen/PHIElimination.cpp | |
parent | fed44d215eefdc241237cd92b0dc899d16cb968d (diff) | |
download | bcm5719-llvm-7d287cb7ed0188f85fa4730f3e3c079aff5457d9.tar.gz bcm5719-llvm-7d287cb7ed0188f85fa4730f3e3c079aff5457d9.zip |
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.
llvm-svn: 72426
Diffstat (limited to 'llvm/lib/CodeGen/PHIElimination.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PHIElimination.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index 2eacb086d8b..c5c76fc7946 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/lib/CodeGen/PHIElimination.cpp @@ -334,8 +334,7 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB, // Is it alive in this successor? unsigned SuccIdx = SuccMBB->getNumber(); - if (SuccIdx < InRegVI.AliveBlocks.size() && - InRegVI.AliveBlocks[SuccIdx]) { + if (InRegVI.AliveBlocks.test(SuccIdx)) { ValueIsLive = true; break; } @@ -407,8 +406,7 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB, // This vreg no longer lives all of the way through opBlock. unsigned opBlockNum = opBlock.getNumber(); - if (opBlockNum < InRegVI.AliveBlocks.size()) - InRegVI.AliveBlocks[opBlockNum] = false; + InRegVI.AliveBlocks.reset(opBlockNum); } } |