diff options
author | Dan Gohman <gohman@apple.com> | 2010-04-20 00:48:35 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-04-20 00:48:35 +0000 |
commit | 8ba3aa7f9c5048c31172788f98ad2b90ffad565a (patch) | |
tree | 684d0f201d34df6e4c12aa63b2cd7eb4680a8926 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 8a39ed75ec57c7fabde318c0d45fac014ac287f4 (diff) |
Sink DebugLoc handling out of SelectionDAGISel into FastISel and
SelectionDAGBuilder, where it doesn't have to be as complicated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index d47c76bbbf..796b14d070 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -224,26 +224,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { return true; } -/// SetDebugLoc - Update MF's and SDB's DebugLocs if debug information is -/// attached with this instruction. -static void SetDebugLoc(const Instruction *I, SelectionDAGBuilder *SDB, - FastISel *FastIS, MachineFunction *MF) { - DebugLoc DL = I->getDebugLoc(); - if (DL.isUnknown()) return; - - SDB->setCurDebugLoc(DL); - - if (FastIS) - FastIS->setCurDebugLoc(DL); -} - -/// ResetDebugLoc - Set MF's and SDB's DebugLocs to Unknown. -static void ResetDebugLoc(SelectionDAGBuilder *SDB, FastISel *FastIS) { - SDB->setCurDebugLoc(DebugLoc()); - if (FastIS) - FastIS->setCurDebugLoc(DebugLoc()); -} - MachineBasicBlock * SelectionDAGISel::SelectBasicBlock(MachineBasicBlock *BB, const BasicBlock *LLVMBB, @@ -255,11 +235,8 @@ SelectionDAGISel::SelectBasicBlock(MachineBasicBlock *BB, // are handled below. for (BasicBlock::const_iterator I = Begin; I != End && !SDB->HasTailCall && !isa<TerminatorInst>(I); - ++I) { - SetDebugLoc(I, SDB, 0, MF); + ++I) SDB->visit(*I); - ResetDebugLoc(SDB, 0); - } if (!SDB->HasTailCall) { // Ensure that all instructions which are used outside of their defining @@ -273,9 +250,7 @@ SelectionDAGISel::SelectBasicBlock(MachineBasicBlock *BB, HandlePHINodesInSuccessorBlocks(LLVMBB); // Lower the terminator after the copies are emitted. - SetDebugLoc(LLVMBB->getTerminator(), SDB, 0, MF); SDB->visit(*LLVMBB->getTerminator()); - ResetDebugLoc(SDB, 0); } } @@ -800,7 +775,6 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { if (isa<TerminatorInst>(BI)) if (!HandlePHINodesInSuccessorBlocksFast(LLVMBB, FastIS)) { ++NumFastIselFailures; - ResetDebugLoc(SDB, FastIS); if (EnableFastISelVerbose || EnableFastISelAbort) { dbgs() << "FastISel miss: "; BI->dump(); @@ -810,17 +784,9 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { break; } - SetDebugLoc(BI, SDB, FastIS, MF); - // Try to select the instruction with FastISel. - if (FastIS->SelectInstruction(BI)) { - ResetDebugLoc(SDB, FastIS); + if (FastIS->SelectInstruction(BI)) continue; - } - - // Clear out the debug location so that it doesn't carry over to - // unrelated instructions. - ResetDebugLoc(SDB, FastIS); // Then handle certain instructions as single-LLVM-Instruction blocks. if (isa<CallInst>(BI)) { |