summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-03-02 22:59:51 +0000
committerAdrian Prantl <aprantl@apple.com>2018-03-02 22:59:51 +0000
commitdfe15f36d5d7e6b9a92dd31273d041587c470278 (patch)
tree889127e61990f41d1dd17180ac9fbf35ff480841 /llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
parentfe6cbceec2aa6dd9eb4e188811d2a896ac0b33c0 (diff)
downloadbcm5719-llvm-dfe15f36d5d7e6b9a92dd31273d041587c470278.tar.gz
bcm5719-llvm-dfe15f36d5d7e6b9a92dd31273d041587c470278.zip
Add DBG_VALUE support to the linear DAG scheduler
The fast/linear DAG scheduler doesn't lower DBG_VALUEs except for function entry nodes. Patch by Joshua Cranmer! Differential Revision: https://reviews.llvm.org/D43028 llvm-svn: 326631
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
index 698e14453d1..f55d85f01e7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
@@ -13,6 +13,7 @@
#include "InstrEmitter.h"
#include "ScheduleDAGSDNodes.h"
+#include "SDNodeDbgValue.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
@@ -767,12 +768,24 @@ ScheduleDAGLinearize::EmitSchedule(MachineBasicBlock::iterator &InsertPos) {
dbgs() << "\n*** Final schedule ***\n";
});
- // FIXME: Handle dbg_values.
unsigned NumNodes = Sequence.size();
+ MachineBasicBlock *BB = Emitter.getBlock();
for (unsigned i = 0; i != NumNodes; ++i) {
SDNode *N = Sequence[NumNodes-i-1];
DEBUG(N->dump(DAG));
Emitter.EmitNode(N, false, false, VRBaseMap);
+
+ // Emit any debug values associated with the node.
+ if (N->getHasDebugValue()) {
+ MachineBasicBlock::iterator InsertPos = Emitter.getInsertPos();
+ for (auto DV : DAG->GetDbgValues(N)) {
+ if (DV->isInvalidated())
+ continue;
+ if (auto *DbgMI = Emitter.EmitDbgValue(DV, VRBaseMap))
+ BB->insert(InsertPos, DbgMI);
+ DV->setIsInvalidated();
+ }
+ }
}
DEBUG(dbgs() << '\n');
OpenPOWER on IntegriCloud