This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Update the documentation on Canonicalization
ClosedPublic

Authored by rriddle on Apr 5 2020, 2:41 AM.

Details

Summary

This updates the canonicalization documentation, and properly documents the different ways of canonicalizing operations.

Diff Detail

Event Timeline

rriddle created this revision.Apr 5 2020, 2:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2020, 2:41 AM
mehdi_amini added inline comments.Apr 5 2020, 10:05 AM
mlir/docs/Canonicalization.md
53

This is controlled per dialect I believe, it can be more restrictive than "the first parent region that is isolated from above"

100

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

168

The fold methods are not permitted to generate new Values.

Is this checked by the way?

mehdi_amini accepted this revision.Apr 5 2020, 10:05 AM
This revision is now accepted and ready to land.Apr 5 2020, 10:05 AM
rriddle updated this revision to Diff 255178.Apr 5 2020, 11:47 AM
rriddle marked 5 inline comments as done.

Resolve comments

mlir/docs/Canonicalization.md
100

Correct. The fold method isn't allowed to create anything, somewhat evident given that no builder is provided.

168

Not at the moment.

This revision was automatically updated to reflect the committed changes.