[PATCH] D72926: [mlir] Generator converting LLVM intrinsics defs to MLIR ODS

Lei Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 08:45:59 PST 2020


antiagainst added a comment.

Cool stuff! I don't see this generator is actually used though; is that in a following up CL?



================
Comment at: mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td:57
+class LLVM_Op<string mnemonic, list<OpTrait> traits = []> :
+    LLVM_OpBase<LLVM_Dialect, mnemonic, traits> {
+}
----------------
We don't need the `{}` at the end given nothing inside.


================
Comment at: mlir/test/mlir-tblgen/intrinsics.td:1
+// This checks that we can consume LLVM's Intrinsic definitions from TableGen
+// files and produce ODS. Unlike MLIR, LLVM's main Intrinsics.td file that
----------------
Rename this file to `llvm-intrinsics.td` to be clear?


================
Comment at: mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp:153
+  os << "def LLVM_" << intr.getProperRecordName() << " : LLVM_Op<\"intr."
+     << intr.getOperationName() << "\", [" << llvm::join(traits, ", ")
+     << "]>, Arguments<(ins" << (operands.empty() ? "" : " ")
----------------
Can use `interleaveComma` for `llvm::join(..., ", ")`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72926





More information about the llvm-commits mailing list