Skip to content

Commit

Permalink
MachineVerifier: Allow LiveInterval segments to end at a partial write.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223895 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
MatzeB committed Dec 10, 2014
1 parent 8f08002 commit 8f08516
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/CodeGen/MachineVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
}
}
Expand Down

0 comments on commit 8f08516

Please sign in to comment.