This is an archive of the discontinued LLVM Phabricator instance.

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
5

"illustrates". Sentence structure is awkward.

11

period instead of semicolon

26–27

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

30

will inspect -> inspects

55

"anything else" -> "anything other"

68

has/holds

80

Complete sentence?

160

is exposing -> exposes

164–165

duplicated type could be auto?

171

is exposing -> exposes

178

"is exposing" again

181

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

184

Recursively traverse...

192

LinalgOp operations?

201–202

Maybe introduce other WalkResult options here?

225

is referencing -> references

A picture would also help here, I think.

227

inspects...and prints.

246

results -> result Values?

253

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

274

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
164–165

I don't think auto would help readability here.

181

I was trying to express it with "recursively nested"

201–202

There is only interrupt() / advance() ?

225

I agree a picture would be nice!

253

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.