[llvm-commits] [llvm] r92503 - in /llvm/trunk: include/llvm/Target/TargetSelectionDAG.td utils/TableGen/CodeGenTarget.cpp utils/TableGen/CodeGenTarget.h utils/TableGen/DAGISelEmitter.cpp

Dan Gohman gohman at apple.com
Mon Jan 4 12:31:56 PST 2010


Author: djg
Date: Mon Jan  4 14:31:55 2010
New Revision: 92503

URL: http://llvm.org/viewvc/llvm-project?rev=92503&view=rev
Log:
Remove the CPAttrParentAsRoot code, which is unused, and inconvenient
for a refactoring I'm working on.

Modified:
    llvm/trunk/include/llvm/Target/TargetSelectionDAG.td
    llvm/trunk/utils/TableGen/CodeGenTarget.cpp
    llvm/trunk/utils/TableGen/CodeGenTarget.h
    llvm/trunk/utils/TableGen/DAGISelEmitter.cpp

Modified: llvm/trunk/include/llvm/Target/TargetSelectionDAG.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelectionDAG.td?rev=92503&r1=92502&r2=92503&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetSelectionDAG.td (original)
+++ llvm/trunk/include/llvm/Target/TargetSelectionDAG.td Mon Jan  4 14:31:55 2010
@@ -843,11 +843,6 @@
 // Complex pattern definitions.
 //
 
-class CPAttribute;
-// Pass the parent Operand as root to CP function rather 
-// than the root of the sub-DAG
-def CPAttrParentAsRoot : CPAttribute;
-
 // Complex patterns, e.g. X86 addressing mode, requires pattern matching code
 // in C++. NumOperands is the number of operands returned by the select function;
 // SelectFunc is the name of the function used to pattern match the max. pattern;
@@ -855,12 +850,10 @@
 // e.g. X86 addressing mode - def addr : ComplexPattern<4, "SelectAddr", [add]>;
 //
 class ComplexPattern<ValueType ty, int numops, string fn,
-                     list<SDNode> roots = [], list<SDNodeProperty> props = [],
-                     list<CPAttribute> attrs = []> {
+                     list<SDNode> roots = [], list<SDNodeProperty> props = []> {
   ValueType Ty = ty;
   int NumOperands = numops;
   string SelectFunc = fn;
   list<SDNode> RootNodes = roots;
   list<SDNodeProperty> Properties = props;
-  list<CPAttribute> Attributes = attrs;
 }

Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=92503&r1=92502&r2=92503&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Mon Jan  4 14:31:55 2010
@@ -402,18 +402,6 @@
              << "' on ComplexPattern '" << R->getName() << "'!\n";
       exit(1);
     }
-  
-  // Parse the attributes.  
-  Attributes = 0;
-  PropList = R->getValueAsListOfDefs("Attributes");
-  for (unsigned i = 0, e = PropList.size(); i != e; ++i)
-    if (PropList[i]->getName() == "CPAttrParentAsRoot") {
-      Attributes |= 1 << CPAttrParentAsRoot;
-    } else {
-      errs() << "Unsupported pattern attribute '" << PropList[i]->getName()
-             << "' on ComplexPattern '" << R->getName() << "'!\n";
-      exit(1);
-    }
 }
 
 //===----------------------------------------------------------------------===//

Modified: llvm/trunk/utils/TableGen/CodeGenTarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.h?rev=92503&r1=92502&r2=92503&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.h Mon Jan  4 14:31:55 2010
@@ -46,9 +46,6 @@
   SDNPMemOperand
 };
 
-// ComplexPattern attributes.
-enum CPAttr { CPAttrParentAsRoot };
-
 /// getValueType - Return the MVT::SimpleValueType that the specified TableGen
 /// record corresponds to.
 MVT::SimpleValueType getValueType(Record *Rec);
@@ -227,7 +224,6 @@
   std::string SelectFunc;
   std::vector<Record*> RootNodes;
   unsigned Properties; // Node properties
-  unsigned Attributes; // Pattern attributes
 public:
   ComplexPattern() : NumOperands(0) {}
   ComplexPattern(Record *R);
@@ -239,7 +235,6 @@
     return RootNodes;
   }
   bool hasProperty(enum SDNP Prop) const { return Properties & (1 << Prop); }
-  bool hasAttribute(enum CPAttr Attr) const { return Attributes & (1 << Attr); }
 };
 
 } // End llvm namespace

Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=92503&r1=92502&r2=92503&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Mon Jan  4 14:31:55 2010
@@ -610,7 +610,7 @@
           emitCheck(MaskPredicate + RootName + "0, Tmp" + utostr(NTmp) +
                     ", INT64_C(" + itostr(II->getValue()) + "))");
           
-          EmitChildMatchCode(N->getChild(0), N, RootName + utostr(0), RootName,
+          EmitChildMatchCode(N->getChild(0), N, RootName + utostr(0),
                              ChainSuffix + utostr(0), FoundChain);
           return;
         }
@@ -621,7 +621,7 @@
       emitInit("SDValue " + RootName + utostr(OpNo) + " = " +
                RootName + ".getOperand(" +utostr(OpNo) + ");");
 
-      EmitChildMatchCode(N->getChild(i), N, RootName + utostr(OpNo), RootName,
+      EmitChildMatchCode(N->getChild(i), N, RootName + utostr(OpNo),
                          ChainSuffix + utostr(OpNo), FoundChain);
     }
 
@@ -654,7 +654,6 @@
 
   void EmitChildMatchCode(TreePatternNode *Child, TreePatternNode *Parent,
                           const std::string &RootName, 
-                          const std::string &ParentRootName,
                           const std::string &ChainSuffix, bool &FoundChain) {
     if (!Child->isLeaf()) {
       // If it's not a leaf, recursively match.
@@ -719,12 +718,7 @@
             emitCode("SDValue " + ChainName + ";");
           }
           
-          std::string Code = Fn + "(";
-          if (CP->hasAttribute(CPAttrParentAsRoot)) {
-            Code += ParentRootName + ", ";
-          } else {
-            Code += "N, ";
-          }
+          std::string Code = Fn + "(N, ";
           if (CP->hasProperty(SDNPHasChain)) {
             std::string ParentName(RootName.begin(), RootName.end()-1);
             Code += ParentName + ", ";





More information about the llvm-commits mailing list