[PATCH] D53816: [TableGen:AsmWriter] Cope with consecutive tied operands.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 14 03:44:09 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL349141: [TableGen:AsmWriter] Cope with consecutive tied operands. (authored by statham, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D53816?vs=171494&id=178216#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53816/new/

https://reviews.llvm.org/D53816

Files:
  llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp


Index: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
===================================================================
--- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
+++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp
@@ -835,15 +835,20 @@
       for (unsigned i = 0, e = LastOpNo; i != e; ++i) {
         // Skip over tied operands as they're not part of an alias declaration.
         auto &Operands = CGA.ResultInst->Operands;
-        unsigned OpNum = Operands.getSubOperandNumber(MIOpNum).first;
-        if (Operands[OpNum].MINumOperands == 1 &&
-            Operands[OpNum].getTiedRegister() != -1) {
-          // Tied operands of different RegisterClass should be explicit within
-          // an instruction's syntax and so cannot be skipped.
-          int TiedOpNum = Operands[OpNum].getTiedRegister();
-          if (Operands[OpNum].Rec->getName() ==
-              Operands[TiedOpNum].Rec->getName())
-            ++MIOpNum;
+        while (true) {
+          unsigned OpNum = Operands.getSubOperandNumber(MIOpNum).first;
+          if (Operands[OpNum].MINumOperands == 1 &&
+              Operands[OpNum].getTiedRegister() != -1) {
+            // Tied operands of different RegisterClass should be explicit within
+            // an instruction's syntax and so cannot be skipped.
+            int TiedOpNum = Operands[OpNum].getTiedRegister();
+            if (Operands[OpNum].Rec->getName() ==
+                Operands[TiedOpNum].Rec->getName()) {
+              ++MIOpNum;
+              continue;
+            }
+          }
+          break;
         }
 
         std::string Op = "MI->getOperand(" + utostr(MIOpNum) + ")";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53816.178216.patch
Type: text/x-patch
Size: 1651 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181214/4730325e/attachment.bin>


More information about the llvm-commits mailing list