summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/InlineSpiller.cpp
diff options
context:
space:
mode:
authorShiva Chen <shiva0217@gmail.com>2018-05-16 02:57:26 +0000
committerShiva Chen <shiva0217@gmail.com>2018-05-16 02:57:26 +0000
commit21eab936d5b4d3a02ba9038f8dea80ad503b91d1 (patch)
treec03e4d9f103e78441c9a9c7c87ecfe5f6d9dc389 /llvm/lib/CodeGen/InlineSpiller.cpp
parentbff9302c3d188954fbd6852c57bfc05419754305 (diff)
downloadbcm5719-llvm-21eab936d5b4d3a02ba9038f8dea80ad503b91d1.tar.gz
bcm5719-llvm-21eab936d5b4d3a02ba9038f8dea80ad503b91d1.zip
[DebugInfo] Only handle DBG_VALUE in InlineSpiller.
The instructions using registers should be DBG_VALUE and normal instructions. Use isDebugValue() to filter out DBG_VALUE and add an assert to ensure there is no other kind of debug instructions using the registers. Differential Revision: https://reviews.llvm.org/D46739 Patch by Hsiangkai Wang. llvm-svn: 332427
Diffstat (limited to 'llvm/lib/CodeGen/InlineSpiller.cpp')
-rw-r--r--llvm/lib/CodeGen/InlineSpiller.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp
index 478ea9b2bc5..007e9283d83 100644
--- a/llvm/lib/CodeGen/InlineSpiller.cpp
+++ b/llvm/lib/CodeGen/InlineSpiller.cpp
@@ -617,9 +617,12 @@ void InlineSpiller::reMaterializeAll() {
MachineInstr &MI = *RegI++;
// Debug values are not allowed to affect codegen.
- if (MI.isDebugInstr())
+ if (MI.isDebugValue())
continue;
+ assert(!MI.isDebugInstr() && "Did not expect to find a use in debug "
+ "instruction that isn't a DBG_VALUE");
+
anyRemat |= reMaterializeFor(LI, MI);
}
}
@@ -933,7 +936,7 @@ void InlineSpiller::spillAroundUses(unsigned Reg) {
MachineInstr *MI = &*(RegI++);
// Debug values are not allowed to affect codegen.
- if (MI->isDebugInstr()) {
+ if (MI->isDebugValue()) {
// Modify DBG_VALUE now that the value is in a spill slot.
MachineBasicBlock *MBB = MI->getParent();
LLVM_DEBUG(dbgs() << "Modifying debug info due to spill:\t" << *MI);
@@ -942,6 +945,9 @@ void InlineSpiller::spillAroundUses(unsigned Reg) {
continue;
}
+ assert(!MI->isDebugInstr() && "Did not expect to find a use in debug "
+ "instruction that isn't a DBG_VALUE");
+
// Ignore copies to/from snippets. We'll delete them.
if (SnippetCopies.count(MI))
continue;
OpenPOWER on IntegriCloud