forked from OSchip/llvm-project
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
This commit is contained in:
parent
279f83645c
commit
21554d9b30
|
@ -1548,19 +1548,27 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR,
|
||||||
// A live segment can end with either a redefinition, a kill flag on a
|
// A live segment can end with either a redefinition, a kill flag on a
|
||||||
// use, or a dead flag on a def.
|
// use, or a dead flag on a def.
|
||||||
bool hasRead = false;
|
bool hasRead = false;
|
||||||
|
bool hasSubRegDef = false;
|
||||||
for (ConstMIBundleOperands MOI(MI); MOI.isValid(); ++MOI) {
|
for (ConstMIBundleOperands MOI(MI); MOI.isValid(); ++MOI) {
|
||||||
if (!MOI->isReg() || MOI->getReg() != Reg)
|
if (!MOI->isReg() || MOI->getReg() != Reg)
|
||||||
continue;
|
continue;
|
||||||
if (LaneMask != 0 &&
|
if (LaneMask != 0 &&
|
||||||
(LaneMask & TRI->getSubRegIndexLaneMask(MOI->getSubReg())) == 0)
|
(LaneMask & TRI->getSubRegIndexLaneMask(MOI->getSubReg())) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
if (MOI->isDef() && MOI->getSubReg() != 0)
|
||||||
|
hasSubRegDef = true;
|
||||||
if (MOI->readsReg())
|
if (MOI->readsReg())
|
||||||
hasRead = true;
|
hasRead = true;
|
||||||
}
|
}
|
||||||
if (!S.end.isDead()) {
|
if (!S.end.isDead()) {
|
||||||
if (!hasRead) {
|
if (!hasRead) {
|
||||||
report("Instruction ending live segment doesn't read the register", MI);
|
// When tracking subregister liveness, the main range must start new
|
||||||
*OS << S << " in " << LR << '\n';
|
// 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';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue