[PATCH] D34394: [MachineVerifier] Add check that tied physregs aren't different.

Jesper Antonsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 02:26:08 PDT 2017


JesperAntonsson updated this revision to Diff 103329.
JesperAntonsson added a comment.

Removed the check that tied physregs and virtregs aren't mixed. Removed changes in a test that had such mixes.


https://reviews.llvm.org/D34394

Files:
  lib/CodeGen/MachineVerifier.cpp


Index: lib/CodeGen/MachineVerifier.cpp
===================================================================
--- lib/CodeGen/MachineVerifier.cpp
+++ lib/CodeGen/MachineVerifier.cpp
@@ -985,6 +985,14 @@
         report("Operand should be tied", MO, MONum);
       else if (unsigned(TiedTo) != MI->findTiedOperandIdx(MONum))
         report("Tied def doesn't match MCInstrDesc", MO, MONum);
+      else if (TargetRegisterInfo::isPhysicalRegister(MO->getReg())) {
+        const MachineOperand &MOTied = MI->getOperand(TiedTo);
+        if (!MOTied.isReg())
+          report("Tied counterpart must be a register", &MOTied, TiedTo);
+        else if (TargetRegisterInfo::isPhysicalRegister(MOTied.getReg()) &&
+                 MO->getReg() != MOTied.getReg())
+          report("Tied physical registers must match.", &MOTied, TiedTo);
+      }
     } else if (MO->isReg() && MO->isTied())
       report("Explicit operand should not be tied", MO, MONum);
   } else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34394.103329.patch
Type: text/x-patch
Size: 962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170621/013e6210/attachment.bin>


More information about the llvm-commits mailing list