aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/PHIElimination.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
commit493a3d015cbb2bcc18d9293a4dec3b35c7493818 (patch)
tree0ba9a0617346b05c385d9490ac306a9b21e57d64 /lib/CodeGen/PHIElimination.cpp
parent91bb61a1e2c96f727726c2fe7962df3e18ef5416 (diff)
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/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index 2eacb086d8..c5c76fc794 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/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);
}
}