[PATCH] D32888: TableGen: Add support of Intrinsics with multiple returns

Wenbo Sun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 23:24:36 PDT 2017


wenbos updated this revision to Diff 98403.
wenbos added a comment.

new comments were added


https://reviews.llvm.org/D32888

Files:
  utils/TableGen/CodeGenDAGPatterns.cpp


Index: utils/TableGen/CodeGenDAGPatterns.cpp
===================================================================
--- utils/TableGen/CodeGenDAGPatterns.cpp
+++ utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2205,6 +2205,10 @@
   for (unsigned i = 0, e = Dag->getNumArgs(); i != e; ++i)
     Children.push_back(ParseTreePattern(Dag->getArg(i), Dag->getArgNameStr(i)));
 
+  // Get actual number of result before covert to intrinsic node which 
+  // is hard-coded to be 0 or 1.
+  unsigned NumResults = GetNumNodeResults(Operator, CDP);
+
   // If the operator is an intrinsic, then this is just syntactic sugar for for
   // (intrinsic_* <number>, ..children..).  Pick the right intrinsic node, and
   // convert the intrinsic name to a number.
@@ -2247,7 +2251,6 @@
     }
   }
 
-  unsigned NumResults = GetNumNodeResults(Operator, CDP);
   TreePatternNode *Result = new TreePatternNode(Operator, Children, NumResults);
   Result->setName(OpName);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32888.98403.patch
Type: text/x-patch
Size: 946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170510/f86fac4b/attachment.bin>


More information about the llvm-commits mailing list