forked from OSchip/llvm-project
Insert the debugging instructions in one fell-swoop so that it doesn't call the
expensive "getFirstTerminator" call. This reduces the time of compilation in PR12258 from >10 minutes to < 10 seconds. llvm-svn: 152704
This commit is contained in:
parent
c54f63b204
commit
618d57310a
|
@ -855,16 +855,17 @@ EmitSchedule(MachineBasicBlock::iterator &InsertPos) {
|
|||
}
|
||||
// Add trailing DbgValue's before the terminator. FIXME: May want to add
|
||||
// some of them before one or more conditional branches?
|
||||
SmallVector<MachineInstr*, 8> DbgMIs;
|
||||
while (DI != DE) {
|
||||
MachineBasicBlock *InsertBB = Emitter.getBlock();
|
||||
MachineBasicBlock::iterator Pos= Emitter.getBlock()->getFirstTerminator();
|
||||
if (!(*DI)->isInvalidated()) {
|
||||
MachineInstr *DbgMI= Emitter.EmitDbgValue(*DI, VRBaseMap);
|
||||
if (DbgMI)
|
||||
InsertBB->insert(Pos, DbgMI);
|
||||
}
|
||||
if (!(*DI)->isInvalidated())
|
||||
if (MachineInstr *DbgMI = Emitter.EmitDbgValue(*DI, VRBaseMap))
|
||||
DbgMIs.push_back(DbgMI);
|
||||
++DI;
|
||||
}
|
||||
|
||||
MachineBasicBlock *InsertBB = Emitter.getBlock();
|
||||
MachineBasicBlock::iterator Pos = InsertBB->getFirstTerminator();
|
||||
InsertBB->insert(Pos, DbgMIs.begin(), DbgMIs.end());
|
||||
}
|
||||
|
||||
InsertPos = Emitter.getInsertPos();
|
||||
|
|
Loading…
Reference in New Issue