diff options
author | Matthias Braun <matze@braunis.de> | 2014-12-10 01:13:11 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2014-12-10 01:13:11 +0000 |
commit | 21554d9b302571c7d2a6e0dbd17888b1b00bb038 (patch) | |
tree | 57576f89b1032e905def366eb432c8d4daa39a91 /llvm/lib/CodeGen/MachineVerifier.cpp | |
parent | 279f83645c41a875481618d9f8490c7fefd351b0 (diff) | |
download | bcm5719-llvm-21554d9b302571c7d2a6e0dbd17888b1b00bb038.tar.gz bcm5719-llvm-21554d9b302571c7d2a6e0dbd17888b1b00bb038.zip |
MachineVerifier: Allow LiveInterval segments to end at a partial write.
In the subregister liveness tracking case we do not create implicit
reads on partial register writes anymore, still we need to produce a new
SSA value for partial writes so the live segment has to end.
llvm-svn: 223895
Diffstat (limited to 'llvm/lib/CodeGen/MachineVerifier.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineVerifier.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 0586561ecc3..5cdcc666028 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -1548,19 +1548,27 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR, // A live segment can end with either a redefinition, a kill flag on a // use, or a dead flag on a def. bool hasRead = false; + bool hasSubRegDef = 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->readsReg()) hasRead = true; } if (!S.end.isDead()) { if (!hasRead) { - report("Instruction ending live segment doesn't read the register", MI); - *OS << S << " in " << LR << '\n'; + // When tracking subregister liveness, the main range must start new + // values on partial register writes, even if there is no read. + if (!MRI->tracksSubRegLiveness() || LaneMask != 0 || !hasSubRegDef) { + report("Instruction ending live segment doesn't read the register", + MI); + *OS << S << " in " << LR << '\n'; + } } } } |