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

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 5 10:08:35 PDT 2020


mehdi_amini added inline comments.


================
Comment at: mlir/docs/Canonicalization.md:53
+    the first parent region that is isolated from above, e.g. the entry block of
+    a function.
+
----------------
This is controlled per dialect I believe, it can be more restrictive than "the first parent region that is isolated from above"


================
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
----------------
"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?


================
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`
----------------
> The `fold` methods are not permitted to generate new `Value`s.

Is this checked by the way?


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