diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 7a4a4f9a1ad..c38c8e9cddb 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -256,15 +256,13 @@ void SelectionDAGISel::SelectBasicBlock(const BasicBlock *LLVMBB, SDB->setCurrentBasicBlock(BB); // Lower all of the non-terminator instructions. If a call is emitted - // as a tail call, cease emitting nodes for this block. + // as a tail call, cease emitting nodes for this block. Terminators + // are handled below. for (BasicBlock::const_iterator I = Begin; - I != End && !SDB->HasTailCall; ++I) { + I != End && !SDB->HasTailCall && !isa(I); + ++I) { SetDebugLoc(I, SDB, 0, MF); - - // Visit the instruction. Terminators are handled below. - if (!isa(I)) - SDB->visit(*I); - + SDB->visit(*I); ResetDebugLoc(SDB, 0); }