diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h index f4514b07fdd..f3eccf0a5ea 100644 --- a/include/llvm/CodeGen/DAGISelHeader.h +++ b/include/llvm/CodeGen/DAGISelHeader.h @@ -319,13 +319,11 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, case OPC_CheckPredicate: if (!CheckNodePredicate(N.getNode(), MatcherTable[MatcherIndex++])) break; continue; - case OPC_CheckComplexPat: { - unsigned PatNo = MatcherTable[MatcherIndex++]; - (void)PatNo; - // FIXME: CHECK IT. + case OPC_CheckComplexPat: + if (!CheckComplexPattern(NodeToMatch, N, + MatcherTable[MatcherIndex++], RecordedNodes)) + break; continue; - } - case OPC_CheckOpcode: if (N->getOpcode() != MatcherTable[MatcherIndex++]) break; continue; diff --git a/include/llvm/CodeGen/SelectionDAGISel.h b/include/llvm/CodeGen/SelectionDAGISel.h index 0be91b414d0..1b9c2686050 100644 --- a/include/llvm/CodeGen/SelectionDAGISel.h +++ b/include/llvm/CodeGen/SelectionDAGISel.h @@ -131,6 +131,12 @@ protected: return 0; } + virtual bool CheckComplexPattern(SDNode *Root, SDValue N, unsigned PatternNo, + SmallVectorImpl &Result) { + assert(0 && "Tblgen should generate the implementation of this!"); + return false; + } + // Calls to these functions are generated by tblgen. SDNode *Select_INLINEASM(SDNode *N); SDNode *Select_UNDEF(SDNode *N);