mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-17 08:36:52 +00:00
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:
parent
3915c2cc7c
commit
44ab9ed9b8
@ -618,6 +618,9 @@ void SelectionDAGBuilder::visit(const Instruction &I) {
|
||||
|
||||
visit(I.getOpcode(), I);
|
||||
|
||||
if (!isa<TerminatorInst>(&I) && !HasTailCall)
|
||||
CopyToExportRegsIfNeeded(&I);
|
||||
|
||||
CurDebugLoc = DebugLoc();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user