Revert r191940 to see if it fixes the build bots.
authorCraig Topper <craig.topper@gmail.com>
Fri, 4 Oct 2013 05:52:17 +0000 (05:52 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 4 Oct 2013 05:52:17 +0000 (05:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191941 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGISel.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
utils/TableGen/DAGISelMatcher.cpp
utils/TableGen/DAGISelMatcher.h
utils/TableGen/DAGISelMatcherEmitter.cpp
utils/TableGen/DAGISelMatcherOpt.cpp

index b5ec8cb075dca2051e48d9971c3bb70764926ff8..3d55d3a06bf3865346440d1484ad6839be101b14 100644 (file)
@@ -113,8 +113,6 @@ public:
     OPC_MoveChild,
     OPC_MoveParent,
     OPC_CheckSame,
-    OPC_CheckChild0Same, OPC_CheckChild1Same,
-    OPC_CheckChild2Same, OPC_CheckChild3Same,
     OPC_CheckPatternPredicate,
     OPC_CheckPredicate,
     OPC_CheckOpcode,
index f362a7bdf16bb47abd3b1f72f30eb3562b314a42..fcde6b5b939af7787ff49c5a4a3978b682bc34e1 100644 (file)
@@ -2097,18 +2097,6 @@ CheckSame(const unsigned char *MatcherTable, unsigned &MatcherIndex,
   return N == RecordedNodes[RecNo].first;
 }
 
-/// CheckChildSame - Implements OP_CheckChildXSame.
-LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
-CheckChildSame(const unsigned char *MatcherTable, unsigned &MatcherIndex,
-             SDValue N,
-             const SmallVectorImpl<std::pair<SDValue, SDNode*> > &RecordedNodes,
-             unsigned ChildNo) {
-  if (ChildNo >= N.getNumOperands())
-    return false;  // Match fails if out of range child #.
-  return ::CheckSame(MatcherTable, MatcherIndex, N.getOperand(ChildNo),
-                     RecordedNodes);
-}
-
 /// CheckPatternPredicate - Implements OP_CheckPatternPredicate.
 LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
 CheckPatternPredicate(const unsigned char *MatcherTable, unsigned &MatcherIndex,
@@ -2223,13 +2211,6 @@ static unsigned IsPredicateKnownToFail(const unsigned char *Table,
   case SelectionDAGISel::OPC_CheckSame:
     Result = !::CheckSame(Table, Index, N, RecordedNodes);
     return Index;
-  case SelectionDAGISel::OPC_CheckChild0Same:
-  case SelectionDAGISel::OPC_CheckChild1Same:
-  case SelectionDAGISel::OPC_CheckChild2Same:
-  case SelectionDAGISel::OPC_CheckChild3Same:
-    Result = !::CheckChildSame(Table, Index, N, RecordedNodes,
-                        Table[Index-1] - SelectionDAGISel::OPC_CheckChild0Same);
-    return Index;
   case SelectionDAGISel::OPC_CheckPatternPredicate:
     Result = !::CheckPatternPredicate(Table, Index, SDISel);
     return Index;
@@ -2527,14 +2508,6 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
     case OPC_CheckSame:
       if (!::CheckSame(MatcherTable, MatcherIndex, N, RecordedNodes)) break;
       continue;
-
-    case OPC_CheckChild0Same: case OPC_CheckChild1Same:
-    case OPC_CheckChild2Same: case OPC_CheckChild3Same:
-      if (!::CheckChildSame(MatcherTable, MatcherIndex, N, RecordedNodes,
-                            Opcode-OPC_CheckChild0Same))
-        break;
-      continue;
-
     case OPC_CheckPatternPredicate:
       if (!::CheckPatternPredicate(MatcherTable, MatcherIndex, *this)) break;
       continue;
index 5d6a11ae0dc7fccce3c9d95b536e99d4e83ecad6..af0eb97725027b33da967f7403fef208c3fc93ff 100644 (file)
@@ -134,10 +134,6 @@ void CheckSameMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
   OS.indent(indent) << "CheckSame " << MatchNumber << '\n';
 }
 
-void CheckChildSameMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
-  OS.indent(indent) << "CheckChild" << ChildNo << "Same\n";
-}
-
 void CheckPatternPredicateMatcher::
 printImpl(raw_ostream &OS, unsigned indent) const {
   OS.indent(indent) << "CheckPatternPredicate " << Predicate << '\n';
index 70031fa6d3b801b0ce0799bcf64ae87520aa26e8..ebac7902de4a1821d27b8d3e28fbb6efd7e44e3d 100644 (file)
@@ -55,7 +55,6 @@ public:
 
     // Predicate checking.
     CheckSame,            // Fail if not same as prev match.
-    CheckChildSame,       // Fail if child not same as prev match.
     CheckPatternPredicate,
     CheckPredicate,       // Fail if node predicate fails.
     CheckOpcode,          // Fail if not opcode.
@@ -123,7 +122,6 @@ public:
     switch (getKind()) {
     default: return false;
     case CheckSame:
-    case CheckChildSame:
     case CheckPatternPredicate:
     case CheckPredicate:
     case CheckOpcode:
@@ -394,34 +392,6 @@ private:
   virtual unsigned getHashImpl() const { return getMatchNumber(); }
 };
 
-/// CheckChildSameMatcher - This checks to see if child node is exactly the same
-/// node as the specified match that was recorded with 'Record'.  This is used
-/// when patterns have the same name in them, like '(mul GPR:$in, GPR:$in)'.
-class CheckChildSameMatcher : public Matcher {
-  unsigned ChildNo;
-  unsigned MatchNumber;
-public:
-  CheckChildSameMatcher(unsigned childno, unsigned matchnumber)
-    : Matcher(CheckChildSame), ChildNo(childno), MatchNumber(matchnumber) {}
-
-  unsigned getChildNo() const { return ChildNo; }
-  unsigned getMatchNumber() const { return MatchNumber; }
-
-  static inline bool classof(const Matcher *N) {
-    return N->getKind() == CheckChildSame;
-  }
-
-  virtual bool isSafeToReorderWithPatternPredicate() const { return true; }
-
-private:
-  virtual void printImpl(raw_ostream &OS, unsigned indent) const;
-  virtual bool isEqualImpl(const Matcher *M) const {
-    return cast<CheckChildSameMatcher>(M)->ChildNo == ChildNo &&
-           cast<CheckChildSameMatcher>(M)->MatchNumber == MatchNumber;
-  }
-  virtual unsigned getHashImpl() const { return (MatchNumber << 2) | ChildNo; }
-};
-
 /// CheckPatternPredicateMatcher - This checks the target-specific predicate
 /// to see if the entire pattern is capable of matching.  This predicate does
 /// not take a node as input.  This is used for subtarget feature checks etc.
index 04fe0d1824adf19db9f2f69d1e8cbaf2fccb3122..ba1b3585fbcf58e801a74b2752d664995cfa375d 100644 (file)
@@ -242,12 +242,6 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
        << cast<CheckSameMatcher>(N)->getMatchNumber() << ",\n";
     return 2;
 
-  case Matcher::CheckChildSame:
-    OS << "OPC_CheckChild"
-       << cast<CheckChildSameMatcher>(N)->getChildNo() << "Same, "
-       << cast<CheckChildSameMatcher>(N)->getMatchNumber() << ",\n";
-    return 2;
-
   case Matcher::CheckPatternPredicate: {
     StringRef Pred =cast<CheckPatternPredicateMatcher>(N)->getPredicate();
     OS << "OPC_CheckPatternPredicate, " << getPatternPredicate(Pred) << ',';
@@ -759,7 +753,6 @@ void MatcherTableEmitter::EmitHistogram(const Matcher *M,
     case Matcher::MoveChild: OS << "OPC_MoveChild"; break;
     case Matcher::MoveParent: OS << "OPC_MoveParent"; break;
     case Matcher::CheckSame: OS << "OPC_CheckSame"; break;
-    case Matcher::CheckChildSame: OS << "OPC_CheckChildSame"; break;
     case Matcher::CheckPatternPredicate:
       OS << "OPC_CheckPatternPredicate"; break;
     case Matcher::CheckPredicate: OS << "OPC_CheckPredicate"; break;
index 82e5d63be58b9fb08c9ca7875c13503dda25c807..f9964223c24850f6918793da6a3da243c3e18395 100644 (file)
@@ -51,11 +51,7 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr,
       if (MC->getChildNo() < 8 &&  // Only have CheckChildType0...7
           CT->getResNo() == 0)     // CheckChildType checks res #0
         New = new CheckChildTypeMatcher(MC->getChildNo(), CT->getType());
-
-    if (CheckSameMatcher *CS = dyn_cast<CheckSameMatcher>(MC->getNext()))
-      if (MC->getChildNo() < 4)  // Only have CheckChildSame0...3
-        New = new CheckChildSameMatcher(MC->getChildNo(), CS->getMatchNumber());
-
+    
     if (New) {
       // Insert the new node.
       New->setNext(MatcherPtr.take());