mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
Verify kill flags conservatively.
Allow a live range to end with a kill flag, but don't allow a kill flag that doesn't end the live range. This makes the machine code verifier more useful during register allocation when kill flag computation is deferred. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -647,24 +647,11 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
|
|||||||
report("No live range at use", MO, MONum);
|
report("No live range at use", MO, MONum);
|
||||||
*OS << UseIdx << " is not live in " << LI << '\n';
|
*OS << UseIdx << " is not live in " << LI << '\n';
|
||||||
}
|
}
|
||||||
// Verify isKill == LI.killedAt.
|
// Check for extra kill flags.
|
||||||
// Two-address instrs don't have kill flags on the tied operands, and
|
// Note that we allow missing kill flags for now.
|
||||||
// we even allow
|
if (MO->isKill() && !LI.killedAt(UseIdx.getDefIndex())) {
|
||||||
// %r1 = add %r1, %r1
|
report("Live range continues after kill flag", MO, MONum);
|
||||||
// without a kill flag on the untied operand.
|
*OS << "Live range: " << LI << '\n';
|
||||||
// MI->findRegisterUseOperandIdx finds the first operand using reg.
|
|
||||||
if (!MI->isRegTiedToDefOperand(MI->findRegisterUseOperandIdx(Reg))) {
|
|
||||||
// MI could kill register without a kill flag on MO.
|
|
||||||
bool miKill = MI->killsRegister(Reg);
|
|
||||||
bool liKill = LI.killedAt(UseIdx.getDefIndex());
|
|
||||||
if (miKill && !liKill) {
|
|
||||||
report("Live range continues after kill flag", MO, MONum);
|
|
||||||
*OS << "Live range: " << LI << '\n';
|
|
||||||
}
|
|
||||||
if (!miKill && liKill) {
|
|
||||||
report("Live range ends without kill flag", MO, MONum);
|
|
||||||
*OS << "Live range: " << LI << '\n';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
report("Virtual register has no Live interval", MO, MONum);
|
report("Virtual register has no Live interval", MO, MONum);
|
||||||
|
Reference in New Issue
Block a user