[llvm-commits] [llvm] r55004 - /llvm/trunk/utils/TableGen/FastISelEmitter.cpp

Dan Gohman gohman at apple.com
Tue Aug 19 13:36:33 PDT 2008


Author: djg
Date: Tue Aug 19 15:36:33 2008
New Revision: 55004

URL: http://llvm.org/viewvc/llvm-project?rev=55004&view=rev
Log:
Add more comments.

Modified:
    llvm/trunk/utils/TableGen/FastISelEmitter.cpp

Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=55004&r1=55003&r2=55004&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Tue Aug 19 15:36:33 2008
@@ -163,6 +163,9 @@
     CodeGenInstruction &II = CGP.getTargetInfo().getInstruction(Op->getName());
     if (II.OperandList.empty())
       continue;
+
+    // For now, ignore instructions where the first operand is not an
+    // output register.
     Record *Op0Rec = II.OperandList[0].Rec;
     if (!Op0Rec->isSubClassOf("RegisterClass"))
       continue;
@@ -191,7 +194,7 @@
     if (!InstPatNode->getPredicateFn().empty())
       continue;
 
-    // Check all the operands. For now only accept register operands.
+    // Check all the operands.
     OperandsSignature Operands;
     for (unsigned i = 0, e = InstPatNode->getNumChildren(); i != e; ++i) {
       TreePatternNode *Op = InstPatNode->getChild(i);
@@ -204,11 +207,15 @@
       if (!OpDI)
         goto continue_label;
       Record *OpLeafRec = OpDI->getDef();
+      // For now, only accept register operands.
       if (!OpLeafRec->isSubClassOf("RegisterClass"))
         goto continue_label;
+      // For now, require the register operands' register classes to all
+      // be the same.
       const CodeGenRegisterClass *RC = &Target.getRegisterClass(OpLeafRec);
       if (!RC)
         goto continue_label;
+      // For now, all the operands must have the same type.
       if (Op->getTypeNum(0) != VT)
         goto continue_label;
       Operands.Operands.push_back("r");





More information about the llvm-commits mailing list