[PATCH] D74171: [mlir] [LLVMIR] add all vector reduction intrinsics to LLVM IR dialect

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 11:30:58 PST 2020


rriddle added inline comments.


================
Comment at: mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td:789
+    Arguments<(ins LLVM_Type)>, Results<(outs LLVM_Type:$res)> {
+  let llvmBuilder = [{
+    llvm::Module *module = builder.GetInsertBlock()->getModule();
----------------
ftynse wrote:
> aartbik wrote:
> > rriddle wrote:
> > > Can you define a template for these? The builder is effectively the same for all of these.
> > Ha! I actually started to write a template by hand and then was pointed to Alex' brilliant tool to generate this code automatically. I am okay cleaning up the code by hand now, but then some of the automation is lost :-)
> We should eventually injecting the generated code into the file instead of copy-pasting, but for now it's fine if it stays as is.
So the plan is to have a `GeneratedOps.td` alongside this one? That makes sense if so, but can we start a new file for generated ops prematurely to avoid extra work later on? It also keeps this file clean so that people don't look at it as just technical debt laying around to be cleaned up.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74171





More information about the llvm-commits mailing list