diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-03-14 02:24:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-03-14 02:24:55 +0000 |
| commit | 7e6559526af9f502d5f245b2fd02041a243387e8 (patch) | |
| tree | bab599e7ff270803ad7e7936f9ac3c91729281ab /lib/CodeGen | |
| parent | 31ae74daf3babf1733bb19cdef09eee8220d3497 (diff) | |
| download | external_llvm-7e6559526af9f502d5f245b2fd02041a243387e8.zip external_llvm-7e6559526af9f502d5f245b2fd02041a243387e8.tar.gz external_llvm-7e6559526af9f502d5f245b2fd02041a243387e8.tar.bz2 | |
eliminate InvalidateLabel and LabelIDList from MMI and replace
them with a counter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 11 | ||||
| -rw-r--r-- | lib/CodeGen/MachineModuleInfo.cpp | 4 | ||||
| -rw-r--r-- | lib/CodeGen/TailDuplication.cpp | 11 | ||||
| -rw-r--r-- | lib/CodeGen/UnreachableBlockElim.cpp | 16 |
4 files changed, 4 insertions, 38 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index 7e27bf5..13ae43d 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -105,17 +105,6 @@ void BranchFolder::RemoveDeadBlock(MachineBasicBlock *MBB) { while (!MBB->succ_empty()) MBB->removeSuccessor(MBB->succ_end()-1); - // If there are any labels in the basic block, unregister them from - // MachineModuleInfo. - if (MMI && !MBB->empty()) { - for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); - I != E; ++I) { - if (I->isLabel()) - // The label ID # is always operand #0, an immediate. - MMI->InvalidateLabel(I->getOperand(0).getImm()); - } - } - // Remove the block. MF->erase(MBB); } diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index 27c1387..42c6a7f 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -41,8 +41,8 @@ MachineModuleInfoImpl::~MachineModuleInfoImpl() {} MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI) : ImmutablePass(&ID), Context(MAI), - ObjFileMMI(0), CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), - DbgInfoAvailable(false) { + ObjFileMMI(0), NextLabelIDToReturn(1), + CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false){ // Always emit some info, by default "no personality" info. Personalities.push_back(NULL); } diff --git a/lib/CodeGen/TailDuplication.cpp b/lib/CodeGen/TailDuplication.cpp index 3223e53..fa3785d 100644 --- a/lib/CodeGen/TailDuplication.cpp +++ b/lib/CodeGen/TailDuplication.cpp @@ -648,17 +648,6 @@ void TailDuplicatePass::RemoveDeadBlock(MachineBasicBlock *MBB) { while (!MBB->succ_empty()) MBB->removeSuccessor(MBB->succ_end()-1); - // If there are any labels in the basic block, unregister them from - // MachineModuleInfo. - if (MMI && !MBB->empty()) { - for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); - I != E; ++I) { - if (I->isLabel()) - // The label ID # is always operand #0, an immediate. - MMI->InvalidateLabel(I->getOperand(0).getImm()); - } - } - // Remove the block. MBB->eraseFromParent(); } diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp index b0f0a07..7b33812 100644 --- a/lib/CodeGen/UnreachableBlockElim.cpp +++ b/lib/CodeGen/UnreachableBlockElim.cpp @@ -165,20 +165,8 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) { } // Actually remove the blocks now. - for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) { - MachineBasicBlock *MBB = DeadBlocks[i]; - // If there are any labels in the basic block, unregister them from - // MachineModuleInfo. - if (MMI && !MBB->empty()) { - for (MachineBasicBlock::iterator I = MBB->begin(), - E = MBB->end(); I != E; ++I) { - if (I->isLabel()) - // The label ID # is always operand #0, an immediate. - MMI->InvalidateLabel(I->getOperand(0).getImm()); - } - } - MBB->eraseFromParent(); - } + for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) + DeadBlocks[i]->eraseFromParent(); // Cleanup PHI nodes. for (MachineFunction::iterator I = F.begin(), E = F.end(); I != E; ++I) { |
