diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-03-14 07:14:25 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-03-14 07:14:25 +0000 |
commit | 618d57310a2c4ef3d0e0f727423aa972be8035d4 (patch) | |
tree | a7a9a672a14523f8c251ce09e34a8602eae99a73 /llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | |
parent | c54f63b204fe536e9d602dcc73e17f31759283d5 (diff) | |
download | bcm5719-llvm-618d57310a2c4ef3d0e0f727423aa972be8035d4.tar.gz bcm5719-llvm-618d57310a2c4ef3d0e0f727423aa972be8035d4.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp index d2aec08534a..69dd813b24e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp @@ -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(); |