[llvm-branch-commits] [llvm-branch] r99534 - in /llvm/branches/Apple/Morbo: ./ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp utils/TableGen/DAGISelMatcherEmitter.cpp

Bill Wendling isanbard at gmail.com
Thu Mar 25 11:24:57 PDT 2010


Author: void
Date: Thu Mar 25 13:24:57 2010
New Revision: 99534

URL: http://llvm.org/viewvc/llvm-project?rev=99534&view=rev
Log:
$ svn merge -c 99494 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r99494 into '.':
U    utils/TableGen/DAGISelMatcherEmitter.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp


Modified:
    llvm/branches/Apple/Morbo/   (props changed)
    llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    llvm/branches/Apple/Morbo/utils/TableGen/DAGISelMatcherEmitter.cpp

Propchange: llvm/branches/Apple/Morbo/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 25 13:24:57 2010
@@ -1,2 +1,2 @@
 /llvm/branches/Apple/Hermes:96832,96835,96858,96870,96876,96879
-/llvm/trunk:98602,98604,98612,98615-98616,98675,98686,98743-98744,98773,98778,98780,98810,98835,98839,98845,98855,98862,98881,98920,98977,99032-99033,99043,99223,99263,99282-99284,99306,99319-99321,99324,99336,99423,99429,99463,99484,99490
+/llvm/trunk:98602,98604,98612,98615-98616,98675,98686,98743-98744,98773,98778,98780,98810,98835,98839,98845,98855,98862,98881,98920,98977,99032-99033,99043,99223,99263,99282-99284,99306,99319-99321,99324,99336,99423,99429,99463,99484,99490,99494

Modified: llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=99534&r1=99533&r2=99534&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Mar 25 13:24:57 2010
@@ -1888,7 +1888,9 @@
 ALWAYS_INLINE static bool
 CheckOpcode(const unsigned char *MatcherTable, unsigned &MatcherIndex,
             SDNode *N) {
-  return N->getOpcode() == MatcherTable[MatcherIndex++];
+  uint16_t Opc = MatcherTable[MatcherIndex++];
+  Opc |= (unsigned short)MatcherTable[MatcherIndex++] << 8;
+  return N->getOpcode() == Opc;
 }
 
 ALWAYS_INLINE static bool
@@ -2142,7 +2144,8 @@
       if (CaseSize == 0) break;
 
       // Get the opcode, add the index to the table.
-      unsigned Opc = MatcherTable[Idx++];
+      uint16_t Opc = MatcherTable[Idx++];
+      Opc |= (unsigned short)MatcherTable[Idx++] << 8;
       if (Opc >= OpcodeOffset.size())
         OpcodeOffset.resize((Opc+1)*2);
       OpcodeOffset[Opc] = Idx;
@@ -2298,8 +2301,11 @@
           CaseSize = GetVBR(CaseSize, MatcherTable, MatcherIndex);
         if (CaseSize == 0) break;
 
+        uint16_t Opc = MatcherTable[MatcherIndex++];
+        Opc |= (unsigned short)MatcherTable[MatcherIndex++] << 8;
+
         // If the opcode matches, then we will execute this case.
-        if (CurNodeOpcode == MatcherTable[MatcherIndex++])
+        if (CurNodeOpcode == Opc)
           break;
       
         // Otherwise, skip over this case.

Modified: llvm/branches/Apple/Morbo/utils/TableGen/DAGISelMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/utils/TableGen/DAGISelMatcherEmitter.cpp?rev=99534&r1=99533&r2=99534&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/utils/TableGen/DAGISelMatcherEmitter.cpp (original)
+++ llvm/branches/Apple/Morbo/utils/TableGen/DAGISelMatcherEmitter.cpp Thu Mar 25 13:24:57 2010
@@ -255,9 +255,9 @@
   }
 
   case Matcher::CheckOpcode:
-    OS << "OPC_CheckOpcode, "
-       << cast<CheckOpcodeMatcher>(N)->getOpcode().getEnumName() << ",\n";
-    return 2;
+    OS << "OPC_CheckOpcode, TARGET_OPCODE("
+       << cast<CheckOpcodeMatcher>(N)->getOpcode().getEnumName() << "),\n";
+    return 3;
       
   case Matcher::SwitchOpcode:
   case Matcher::SwitchType: {
@@ -315,16 +315,17 @@
       CurrentIdx += EmitVBRValue(ChildSize, OS);
       
       OS << ' ';
-      if (const SwitchOpcodeMatcher *SOM = dyn_cast<SwitchOpcodeMatcher>(N))
-        OS << SOM->getCaseOpcode(i).getEnumName();
-      else
-        OS << getEnumName(cast<SwitchTypeMatcher>(N)->getCaseType(i));
-      OS << ',';
+      if (const SwitchOpcodeMatcher *SOM = dyn_cast<SwitchOpcodeMatcher>(N)) {
+        OS << "TARGET_OPCODE(" << SOM->getCaseOpcode(i).getEnumName() << "),";
+        CurrentIdx += 2;
+      } else {
+        OS << getEnumName(cast<SwitchTypeMatcher>(N)->getCaseType(i)) << ',';
+        ++CurrentIdx;
+      }
       
       if (!OmitComments)
-        OS << "// ->" << CurrentIdx+ChildSize+1;
+        OS << "// ->" << CurrentIdx+ChildSize;
       OS << '\n';
-      ++CurrentIdx;
       OS << TmpBuf.str();
       CurrentIdx += ChildSize;
     }





More information about the llvm-branch-commits mailing list