[PATCH] D80304: [mlir] Canonicalization of shape.cstr_broadcastable
Sean Silva via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 12:02:44 PDT 2020
silvas requested changes to this revision.
silvas added inline comments.
This revision now requires changes to proceed.
================
Comment at: mlir/lib/Dialect/Shape/IR/Shape.cpp:265
+// operation.
+// TODO: Once Witnesses are Attributes, replace this with folding.
+struct CstrBroadcastableTrue : public OpRewritePattern<CstrBroadcastableOp> {
----------------
As far as the constant folding logic, you can just use an i1 for a witness. You just need to add a case in ShapeDialect::materializeConstant know how to materialize it into a true_witness op or false_witness op (or just a single const_witness?).
Maybe you can rename this patch "introduce basic constant folding for witnesses" and use this fold as the first example?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80304/new/
https://reviews.llvm.org/D80304
More information about the llvm-commits
mailing list