summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-22 22:30:37 +0000
committerChris Lattner <sabre@nondot.org>2010-02-22 22:30:37 +0000
commit12a667c1e8fa57a13ae751164b6dd4412a62dc5d (patch)
treea98a6a6557659a50699254f925e083f95fb1e6fb /include
parent1f2ed5fe7ed9327f79dc7128fc109e4d6c864907 (diff)
downloadllvm-12a667c1e8fa57a13ae751164b6dd4412a62dc5d.tar.gz
llvm-12a667c1e8fa57a13ae751164b6dd4412a62dc5d.tar.bz2
llvm-12a667c1e8fa57a13ae751164b6dd4412a62dc5d.tar.xz
add a new CheckMultiOpcode opcode for checking that a node
has one of the list of acceptable opcodes for a complex pattern. This fixes 4 regtest failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/DAGISelHeader.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h
index 63d15cda6c..d60940ff1f 100644
--- a/include/llvm/CodeGen/DAGISelHeader.h
+++ b/include/llvm/CodeGen/DAGISelHeader.h
@@ -211,6 +211,7 @@ enum BuiltinOpcodes {
OPC_CheckPatternPredicate,
OPC_CheckPredicate,
OPC_CheckOpcode,
+ OPC_CheckMultiOpcode,
OPC_CheckType,
OPC_CheckInteger1, OPC_CheckInteger2, OPC_CheckInteger4, OPC_CheckInteger8,
OPC_CheckCondCode,
@@ -410,6 +411,16 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
case OPC_CheckOpcode:
if (N->getOpcode() != MatcherTable[MatcherIndex++]) break;
continue;
+
+ case OPC_CheckMultiOpcode: {
+ unsigned NumOps = MatcherTable[MatcherIndex++];
+ bool OpcodeEquals = false;
+ for (unsigned i = 0; i != NumOps; ++i)
+ OpcodeEquals |= N->getOpcode() == MatcherTable[MatcherIndex++];
+ if (!OpcodeEquals) break;
+ continue;
+ }
+
case OPC_CheckType: {
MVT::SimpleValueType VT =
(MVT::SimpleValueType)MatcherTable[MatcherIndex++];