mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-03 17:32:59 +00:00
MachineVerifier: On dead-def live segments, check that corresponding machine operand has a dead flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264769 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f27ef7a795
commit
1df673217b
@ -1743,18 +1743,33 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR,
|
|||||||
// 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;
|
bool hasSubRegDef = false;
|
||||||
|
bool hasDeadDef = 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)
|
if (MOI->isDef()) {
|
||||||
hasSubRegDef = true;
|
if (MOI->getSubReg() != 0)
|
||||||
|
hasSubRegDef = true;
|
||||||
|
if (MOI->isDead())
|
||||||
|
hasDeadDef = true;
|
||||||
|
}
|
||||||
if (MOI->readsReg())
|
if (MOI->readsReg())
|
||||||
hasRead = true;
|
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) {
|
if (!hasRead) {
|
||||||
// When tracking subregister liveness, the main range must start new
|
// When tracking subregister liveness, the main range must start new
|
||||||
// values on partial register writes, even if there is no read.
|
// values on partial register writes, even if there is no read.
|
||||||
|
Loading…
Reference in New Issue
Block a user