diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-23 23:13:24 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-23 23:13:24 +0000 |
commit | ad62f53795ac3da0353afba7e83464679c91ce5c (patch) | |
tree | 2e585ec0f30decb918102698245adb013b931163 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 5e5558bc66d593605ece81502bc310b7cf9e87f0 (diff) |
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
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 49ff4f2a5d..2953472da9 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -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()) { |