Factor out a bit of code that appears in several places into a

utility function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2009-04-23 23:13:24 +00:00
parent 5e5558bc66
commit ad62f53795
3 changed files with 16 additions and 14 deletions

View File

@@ -476,11 +476,8 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB,
// Ensure that all instructions which are used outside of their defining
// blocks are available as virtual registers. Invoke is handled elsewhere.
for (BasicBlock::iterator I = Begin; I != End; ++I)
if (!I->use_empty() && !isa<PHINode>(I) && !isa<InvokeInst>(I)) {
DenseMap<const Value*,unsigned>::iterator VMI =FuncInfo->ValueMap.find(I);
if (VMI != FuncInfo->ValueMap.end())
SDL->CopyValueToVirtualRegister(I, VMI->second);
}
if (!isa<PHINode>(I) && !isa<InvokeInst>(I))
SDL->CopyToExportRegsIfNeeded(I);
// Handle PHI nodes in successor blocks.
if (End == LLVMBB->end()) {