forked from OSchip/llvm-project
Be more precise about verifying missing kill flags.
It is legal for an instruction to have two operands using the same register, only one a kill. This is interpreted as a kill. llvm-svn: 117981
This commit is contained in:
parent
1e32688e4c
commit
2551f13c83
|
@ -624,12 +624,14 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
|
||||||
}
|
}
|
||||||
// Verify isKill == LI.killedAt.
|
// Verify isKill == LI.killedAt.
|
||||||
if (!MI->isRegTiedToDefOperand(MONum)) {
|
if (!MI->isRegTiedToDefOperand(MONum)) {
|
||||||
|
// MI could kill register without a kill flag on MO.
|
||||||
|
bool miKill = MI->killsRegister(Reg);
|
||||||
bool liKill = LI.killedAt(UseIdx.getDefIndex());
|
bool liKill = LI.killedAt(UseIdx.getDefIndex());
|
||||||
if (isKill && !liKill) {
|
if (miKill && !liKill) {
|
||||||
report("Live range continues after kill flag", MO, MONum);
|
report("Live range continues after kill flag", MO, MONum);
|
||||||
*OS << "Live range: " << LI << '\n';
|
*OS << "Live range: " << LI << '\n';
|
||||||
}
|
}
|
||||||
if (!isKill && liKill) {
|
if (!miKill && liKill) {
|
||||||
report("Live range ends without kill flag", MO, MONum);
|
report("Live range ends without kill flag", MO, MONum);
|
||||||
*OS << "Live range: " << LI << '\n';
|
*OS << "Live range: " << LI << '\n';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue