From 2551f13c838be94c789f2479a73aa859c635890b Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Mon, 1 Nov 2010 23:59:53 +0000 Subject: [PATCH] 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 --- llvm/lib/CodeGen/MachineVerifier.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp index 68688cacabee..8ada60a55331 100644 --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -624,12 +624,14 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) { } // Verify isKill == LI.killedAt. 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()); - if (isKill && !liKill) { + if (miKill && !liKill) { report("Live range continues after kill flag", MO, MONum); *OS << "Live range: " << LI << '\n'; } - if (!isKill && liKill) { + if (!miKill && liKill) { report("Live range ends without kill flag", MO, MONum); *OS << "Live range: " << LI << '\n'; }