[TableGen] Handle ValueType in CodeGenDAGPatterns GetNumNodeResults
authorHal Finkel <hfinkel@anl.gov>
Thu, 2 Jan 2014 20:47:05 +0000 (20:47 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 2 Jan 2014 20:47:05 +0000 (20:47 +0000)
A ValueType in a pattern dag is a type cast, and GetNumNodeResults should
handle it (the type cast has only one result).

This comes up, for example, during the type checking of pattern fragments, for
example, AArch64's Neon_combine_2d fragment is:
  dag Operands = (ops node:$Rm, node:$Rn);
  dag Fragment = (v2f64 (concat_vectors (v1f64 node:$Rm), (v1f64 node:$Rn)));

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198347 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenDAGPatterns.cpp

index 717090ae01e48882c80eab83965f301e81a7bdf4..6941732aaac58f797f5f790271ac5aac6d4f6c8f 100644 (file)
@@ -1116,6 +1116,9 @@ static unsigned GetNumNodeResults(Record *Operator, CodeGenDAGPatterns &CDP) {
   if (Operator->isSubClassOf("SDNodeXForm"))
     return 1;  // FIXME: Generalize SDNodeXForm
 
+  if (Operator->isSubClassOf("ValueType"))
+    return 1;  // A type-cast of one result.
+
   Operator->dump();
   errs() << "Unhandled node in GetNumNodeResults\n";
   exit(1);