diff options
author | Matthias Braun <matze@braunis.de> | 2016-03-29 19:07:43 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-03-29 19:07:43 +0000 |
commit | 72a58c3e28eabeffb7789410d89620895156a132 (patch) | |
tree | 5ab88d88a6a3728a56ed8fe2653718dcad5491f3 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 1c20c8280a493093de9c4432abc78cf57fb90bf7 (diff) | |
download | bcm5719-llvm-72a58c3e28eabeffb7789410d89620895156a132.tar.gz bcm5719-llvm-72a58c3e28eabeffb7789410d89620895156a132.zip |
MachineVerifier: On dead-def live segments, check that corresponding machine operand has a dead flag
llvm-svn: 264769
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index b957fd824f8..e2391b49bab 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -1743,18 +1743,33 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR, // use, or a dead flag on a def. bool hasRead = false; bool hasSubRegDef = false; + bool hasDeadDef = false; for (ConstMIBundleOperands MOI(*MI); MOI.isValid(); ++MOI) { if (!MOI->isReg() || MOI->getReg() != Reg) continue; if (LaneMask != 0 && (LaneMask & TRI->getSubRegIndexLaneMask(MOI->getSubReg())) == 0) continue; - if (MOI->isDef() && MOI->getSubReg() != 0) - hasSubRegDef = true; + if (MOI->isDef()) { + if (MOI->getSubReg() != 0) + hasSubRegDef = true; + if (MOI->isDead()) + hasDeadDef = true; + } if (MOI->readsReg()) hasRead = true; } - if (!S.end.isDead()) { + if (S.end.isDead()) { + // Make sure that the corresponding machine operand for a "dead" live + // range has the dead flag. We cannot perform this check for subregister + // liveranges as partially dead values are allowed. + if (LaneMask == 0 && !hasDeadDef) { + report("Instruction ending live segment on dead slot has no dead flag", + MI); + report_context(LR, Reg, LaneMask); + report_context(S); + } + } else { if (!hasRead) { // When tracking subregister liveness, the main range must start new // values on partial register writes, even if there is no read. |