aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineVerifier.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-17 19:18:41 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-17 19:18:41 +0000
commit2f3a4aa550f8f196a546f7957b2df944e04404a2 (patch)
tree71760f4f4d2607d327185786c651d520bf10494c /lib/CodeGen/MachineVerifier.cpp
parent4aec85ae01188f87e45e5e91baab4f303cbcd336 (diff)
Allow missing kill flags on an untied operand of a two-address instruction when
the operand uses the same register as a tied operand: %r1 = add %r1, %r1 If add were a three-address instruction, kill flags would be required on at least one of the uses. Since it is a two-address instruction, the tied use operand must not have a kill flag. This change makes the kill flag on the untied use operand optional. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122082 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineVerifier.cpp')
-rw-r--r--lib/CodeGen/MachineVerifier.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp
index f92b7fe5ac..1e2b478e93 100644
--- a/lib/CodeGen/MachineVerifier.cpp
+++ b/lib/CodeGen/MachineVerifier.cpp
@@ -625,7 +625,12 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
*OS << UseIdx << " is not live in " << LI << '\n';
}
// Verify isKill == LI.killedAt.
- if (!MI->isRegTiedToDefOperand(MONum)) {
+ // Two-address instrs don't have kill flags on the tied operands, and
+ // we even allow
+ // %r1 = add %r1, %r1
+ // without a kill flag on the untied operand.
+ // 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());