[PATCH] D80189: [mlir] Add canonicalization for Cstr and Assuming Shape Ops.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 20:53:53 PDT 2020


mehdi_amini added inline comments.


================
Comment at: mlir/lib/Dialect/Shape/IR/ShapeCanonicalization.td:19
+def ConstantAssumingAll : Pat<(Shape_AssumingAllOp:$op $input),
+          (Shape_TrueWitnessOp),
+          [(AllInputsTrueWitnesses $op)] >;
----------------
silvas wrote:
> I don't think that TableGen is buying us much here. I prefer loose C++ patterns since they are easier to debug and understand.
Easier to understand is arguable: this can be a matter of getting used to it, easier to debug is an infra issue which should be fixed if any.

C++ pattern aren't ideal because we can't manipulate them statically: even if DRR is far from perfect, at least it is declarative.
In particular with the interpreted rewrite engine coming, looking into authoring such transformation in a non-C++ way is valuable (whether we use DRR or we come up with another authoring language to express these)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80189





More information about the llvm-commits mailing list