summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineVerifier.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index 68688cacabe..8ada60a5533 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';
}
OpenPOWER on IntegriCloud