summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-06-12 21:41:29 +0000
committerOwen Anderson <resistor@mac.com>2009-06-12 21:41:29 +0000
commitd0428da39869eeca2c8bd49ef493cfdb2ede6542 (patch)
tree4d4ff25637fe4d3bfba4c5fece63506ce3eb9955 /llvm/lib
parentb6cf8dbb96afecff1908bfe928d3a37ac92b3eb2 (diff)
downloadbcm5719-llvm-d0428da39869eeca2c8bd49ef493cfdb2ede6542.tar.gz
bcm5719-llvm-d0428da39869eeca2c8bd49ef493cfdb2ede6542.zip
Now with less iterator invalidation, and other forms of crashing!
llvm-svn: 73256
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LazyLiveness.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LazyLiveness.cpp b/llvm/lib/CodeGen/LazyLiveness.cpp
index 3ccccd5f5cc..85817da2e4f 100644
--- a/llvm/lib/CodeGen/LazyLiveness.cpp
+++ b/llvm/lib/CodeGen/LazyLiveness.cpp
@@ -22,6 +22,7 @@
using namespace llvm;
char LazyLiveness::ID = 0;
+static RegisterPass<LazyLiveness> X("lazy-liveness", "Lazy Liveness Analysis");
void LazyLiveness::computeBackedgeChain(MachineFunction& mf,
MachineBasicBlock* MBB) {
@@ -65,7 +66,7 @@ bool LazyLiveness::runOnMachineFunction(MachineFunction &mf) {
// Step 0: Compute preorder numbering for all MBBs.
unsigned num = 0;
for (df_iterator<MachineBasicBlock*> DI = df_begin(&*mf.begin());
- DI != df_end(&*mf.end()); ++DI) {
+ DI != df_end(&*mf.begin()); ++DI) {
preorder[*DI] = num++;
rev_preorder.push_back(*DI);
}
@@ -103,8 +104,10 @@ bool LazyLiveness::runOnMachineFunction(MachineFunction &mf) {
if (!backedge_target.test(preorder[*POI]))
for (MachineBasicBlock::succ_iterator SI = (*POI)->succ_begin();
SI != (*POI)->succ_end(); ++SI)
- if (!backedges.count(std::make_pair(*POI, *SI)) && tv.count(*SI))
- tv[*POI]= tv[*SI];
+ if (!backedges.count(std::make_pair(*POI, *SI)) && tv.count(*SI)) {
+ SparseBitVector<128>& PBV = tv[*POI];
+ PBV = tv[*SI];
+ }
for (po_iterator<MachineBasicBlock*> POI = po_begin(&*mf.begin()),
POE = po_end(&*mf.begin()); POI != POE; ++POI)
OpenPOWER on IntegriCloud