[PATCH] D77490: [mlir] Update the documentation on Canonicalization

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 5 12:16:51 PDT 2020


rriddle added inline comments.


================
Comment at: mlir/docs/Canonicalization.md:100
+`fold` has the restriction that no new operations may be created, and only the
+root operation may be replaced. It allows for updating an operation in-place, or
+returning a set of pre-existing values (or attributes) to replace the operation
----------------
mehdi_amini wrote:
> "no new operations" may be created: so I can't fold a `dynamic slice(..., const)` into a `static slice` that would take the constant value as an attribute, even though I'm just replacing the root operation?
Correct. The fold method isn't allowed to create anything, somewhat evident given that no builder is provided.


================
Comment at: mlir/docs/Canonicalization.md:168
+correspond to an existing value. The `fold` methods are not permitted to
+generate new `Value`s. There are no specific restrictions on the form of the
+`Attribute` value returned, but it is important to ensure that the `Attribute`
----------------
mehdi_amini wrote:
> > The `fold` methods are not permitted to generate new `Value`s.
> 
> Is this checked by the way?
Not at the moment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77490





More information about the llvm-commits mailing list