diff options
author | Owen Anderson <resistor@mac.com> | 2009-06-12 22:07:19 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-06-12 22:07:19 +0000 |
commit | d0e823987e07b867285e5d8f9fe6dbea1849674b (patch) | |
tree | c5a8e79b7f1924b9dbfb4607e40793b7e389a382 /lib | |
parent | 725aaed9a7b0a99ae5779c6b061acb87c6660b5e (diff) | |
download | external_llvm-d0e823987e07b867285e5d8f9fe6dbea1849674b.zip external_llvm-d0e823987e07b867285e5d8f9fe6dbea1849674b.tar.gz external_llvm-d0e823987e07b867285e5d8f9fe6dbea1849674b.tar.bz2 |
Improve style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73258 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/LazyLiveness.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/CodeGen/LazyLiveness.cpp b/lib/CodeGen/LazyLiveness.cpp index 4b2d737..6fb35d2 100644 --- a/lib/CodeGen/LazyLiveness.cpp +++ b/lib/CodeGen/LazyLiveness.cpp @@ -66,21 +66,21 @@ bool LazyLiveness::runOnMachineFunction(MachineFunction &mf) { // Step 0: Compute preorder numbering for all MBBs. unsigned num = 0; - for (df_iterator<MachineDomTreeNode*> DI = df_begin(MDT.getRootNode()); - DI != df_end(MDT.getRootNode()); ++DI) { + for (df_iterator<MachineDomTreeNode*> DI = df_begin(MDT.getRootNode()), + DE = df_end(MDT.getRootNode()); DI != DE; ++DI) { preorder[(*DI)->getBlock()] = num++; rev_preorder.push_back((*DI)->getBlock()); } // Step 1: Compute the transitive closure of the CFG, ignoring backedges. - for (po_iterator<MachineBasicBlock*> POI = po_begin(&*mf.begin()); - POI != po_end(&*mf.begin()); ++POI) { + for (po_iterator<MachineBasicBlock*> POI = po_begin(&*mf.begin()), + POE = po_end(&*mf.begin()); POI != POE; ++POI) { MachineBasicBlock* MBB = *POI; SparseBitVector<128>& entry = rv[MBB]; entry.set(preorder[MBB]); - for (MachineBasicBlock::succ_iterator SI = MBB->succ_begin(); - SI != MBB->succ_end(); ++SI) { + for (MachineBasicBlock::succ_iterator SI = MBB->succ_begin(), + SE = MBB->succ_end(); SI != SE; ++SI) { DenseMap<MachineBasicBlock*, SparseBitVector<128> >::iterator SII = rv.find(*SI); @@ -103,8 +103,8 @@ bool LazyLiveness::runOnMachineFunction(MachineFunction &mf) { for (po_iterator<MachineBasicBlock*> POI = po_begin(&*mf.begin()), POE = po_end(&*mf.begin()); POI != POE; ++POI) if (!backedge_target.test(preorder[*POI])) - for (MachineBasicBlock::succ_iterator SI = (*POI)->succ_begin(); - SI != (*POI)->succ_end(); ++SI) + for (MachineBasicBlock::succ_iterator SI = (*POI)->succ_begin(), + SE = (*POI)->succ_end(); SI != SE; ++SI) if (!backedges.count(std::make_pair(*POI, *SI)) && tv.count(*SI)) { SparseBitVector<128>& PBV = tv[*POI]; PBV = tv[*SI]; @@ -123,11 +123,12 @@ bool LazyLiveness::vregLiveIntoMBB(unsigned vreg, MachineBasicBlock* MBB) { MachineBasicBlock* DefMBB = MRI->def_begin(vreg)->getParent(); unsigned def = preorder[DefMBB]; unsigned max_dom = 0; - for (df_iterator<MachineDomTreeNode*> DI = df_begin(MDT[DefMBB]); - DI != df_end(MDT[DefMBB]); ++DI) + for (df_iterator<MachineDomTreeNode*> DI = df_begin(MDT[DefMBB]), + DE = df_end(MDT[DefMBB]); DI != DE; ++DI) { if (preorder[DI->getBlock()] > max_dom) { max_dom = preorder[(*DI)->getBlock()]; } + } if (preorder[MBB] <= def || max_dom < preorder[MBB]) return false; @@ -135,16 +136,16 @@ bool LazyLiveness::vregLiveIntoMBB(unsigned vreg, MachineBasicBlock* MBB) { SparseBitVector<128>::iterator I = tv[MBB].begin(); while (I != tv[MBB].end() && *I <= def) ++I; while (I != tv[MBB].end() && *I < max_dom) { - for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(vreg); - UI != MachineRegisterInfo::use_end(); ++UI) { + for (MachineRegisterInfo::use_iterator UI = MRI->use_begin(vreg), + UE = MachineRegisterInfo::use_end(); UI != UE; ++UI) { MachineBasicBlock* UseMBB = UI->getParent(); if (rv[rev_preorder[*I]].test(preorder[UseMBB])) return true; - + unsigned t_dom = 0; for (df_iterator<MachineDomTreeNode*> DI = - df_begin(MDT[rev_preorder[*I]]); - DI != df_end(MDT[rev_preorder[*I]]); ++DI) + df_begin(MDT[rev_preorder[*I]]), DE = df_end(MDT[rev_preorder[*I]]); + DI != DE; ++DI) if (preorder[DI->getBlock()] > t_dom) { max_dom = preorder[(*DI)->getBlock()]; } @@ -155,4 +156,3 @@ bool LazyLiveness::vregLiveIntoMBB(unsigned vreg, MachineBasicBlock* MBB) { return false; } - |