[PATCH] D76659: [mlir][Pass] Add support for generating pass utilities via tablegen

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 29 13:23:50 PDT 2020


rriddle marked 2 inline comments as done.
rriddle added inline comments.


================
Comment at: mlir/lib/Dialect/Quant/Transforms/ConvertConst.cpp:27
+#define GEN_PASS_QuantConvertConst
+#include "mlir/Dialect/Quant/Passes.h.inc"
 
----------------
mehdi_amini wrote:
> Have you looked into generating normal top-level headers (maybe even one per pass) that would put define a base class for each of the pass so you could just inherit from it?
> 
> ```
> #include "milr/Dialect/Quant/ConvertConstPassGen.h"
> 
> struct ConvertConstPass : public ConvertConstPassBase {
> 
> }
> ```
> 
As a first order it ended up being more boilerplate than I'd like, e.g. properly handling CRTP, setting the right base class(between function, module, operation, and user defined), etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76659





More information about the llvm-commits mailing list