Sink the CopyToExportRegsIfNeeded calls out of SelectionDAGISel

into SelectionDAGBuilder. This avoids a separate pass over the
instructions, and has the side effect of providing debug location
information to the copy.

llvm-svn: 101906
This commit is contained in:
Dan Gohman 2010-04-20 15:03:56 +00:00
parent 3915c2cc7c
commit 44ab9ed9b8
2 changed files with 3 additions and 6 deletions

View File

@ -618,6 +618,9 @@ void SelectionDAGBuilder::visit(const Instruction &I) {
visit(I.getOpcode(), I);
if (!isa<TerminatorInst>(&I) && !HasTailCall)
CopyToExportRegsIfNeeded(&I);
CurDebugLoc = DebugLoc();
}

View File

@ -239,12 +239,6 @@ SelectionDAGISel::SelectBasicBlock(MachineBasicBlock *BB,
SDB->visit(*I);
if (!SDB->HasTailCall) {
// Ensure that all instructions which are used outside of their defining
// blocks are available as virtual registers. Invoke is handled elsewhere.
for (BasicBlock::const_iterator I = Begin; I != End; ++I)
if (!isa<PHINode>(I) && !isa<InvokeInst>(I))
SDB->CopyToExportRegsIfNeeded(I);
// Handle PHI nodes in successor blocks.
if (End == LLVMBB->end()) {
HandlePHINodesInSuccessorBlocks(LLVMBB);