aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineVerifier.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-01 23:59:53 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-01 23:59:53 +0000
commit962c71089d5c725784135146177736c43d550813 (patch)
tree7dc0950722e6c3337cd7d7a0b37178c617656c96 /lib/CodeGen/MachineVerifier.cpp
parent3d4114c464d1ec6c9a6088e04d2156f72c4b42ce (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117981 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineVerifier.cpp')
-rw-r--r--lib/CodeGen/MachineVerifier.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp
index 68688cacab..8ada60a553 100644
--- a/lib/CodeGen/MachineVerifier.cpp
+++ b/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';
}