[PATCH] D80484: [mlir][ods] Add simple generator for return types

Sean Silva via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 15:50:43 PDT 2020


silvas accepted this revision.
silvas added a comment.
This revision is now accepted and ready to land.

Awesome! Thanks so much for doing this :)



================
Comment at: mlir/lib/TableGen/Operator.cpp:257
 
+// Mapping from name of to argument or result index. Arguments are indexed
+// to match getArg index, while the results are negatively indexed.
----------------
This comment seems a bit out of date?


================
Comment at: mlir/lib/TableGen/Operator.cpp:262
+bool tblgen::Operator::isVariadic() const {
+  for (auto op : operands)
+    if (op.isVariadic())
----------------
any_of(concat(operands, results), [](op) { return op.IsVariadic()}) would be a bit more succicnt.


================
Comment at: mlir/lib/TableGen/Operator.cpp:296
+
+  llvm::EquivalenceClasses<int> ecs;
+  resultTypeMapping.resize(getNumResults());
----------------
maybe a small comment explaining how we intend to use EquivalenceClasses.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80484/new/

https://reviews.llvm.org/D80484





More information about the llvm-commits mailing list