Page MenuHomePhabricator

Add a doc/tutorial on traversing the IR
ClosedPublic

Authored by mehdi_amini on Sep 6 2020, 10:02 PM.

Diff Detail

Event Timeline

mehdi_amini created this revision.Sep 6 2020, 10:02 PM
mehdi_amini requested review of this revision.Sep 6 2020, 10:02 PM

Love it. Thanks for adding this!

mlir/docs/Tutorials/UnderstandingTheIRStructure.md
6

"illustrates". Sentence structure is awkward.

12

period instead of semicolon

27–28

is itself wrapping -> itself wraps. I've been wondering if a picture would help to show the structure, rather than just text?

31

will inspect -> inspects

56

"anything else" -> "anything other"

69

has/holds

81

Complete sentence?

161

is exposing -> exposes

165–166

duplicated type could be auto?

172

is exposing -> exposes

179

"is exposing" again

182

maybe emphasize that this is a deep traversal, while getOps is a shallow traversal?

185

Recursively traverse...

193

LinalgOp operations?

202–203

Maybe introduce other WalkResult options here?

226

is referencing -> references

A picture would also help here, I think.

228

inspects...and prints.

247

results -> result Values?

254

enumerate is cool! Maybe provide a link to it here?

275

Code for this pass....

This revision is now accepted and ready to land.Sep 6 2020, 11:22 PM
mehdi_amini marked 16 inline comments as done.

Address comments

mlir/docs/Tutorials/UnderstandingTheIRStructure.md
165–166

I don't think auto would help readability here.

182

I was trying to express it with "recursively nested"

202–203

There is only interrupt() / advance() ?

226

I agree a picture would be nice!

254

I don't think I can link from a code sample in a markdown file?

Add two pictures to illustrate the structur

This revision was automatically updated to reflect the committed changes.