Closed lucarfox closed 4 years ago
SG for location. At the bottom of chapter 2 the output example does show locations. All ops have locations but the mlir-opt tool doesn't print them out by default (would be good to mention that in the tutorial if missing, I see the flag being referenced in the tutorial). An operation doesn't have a location if created with an UnknownLoc and the only reason I can think of would be if there is no reasonable location that could be given to it (but that should be exceptional and I can't think of where one couldn't give some more useful information, even just a name, than unknown).
For successor blocks it is a bit more tricky given the Toy language up to that point, the link from successor blocks to the LangRef does show an example though.
SG. I'll make this change.
the mlir-opt tool doesn't print them out by default
Is this documented somewhere that I can link to in the tutorial? Given that this is the first introduction to mlir-opt.
I see the flag being referenced in the tutorial
Which flag do you mean here?
For successor blocks it is a bit more tricky given the Toy language up to that point, the link from successor blocks to the LangRef does show an example though.
Agreed; for successor blocks I think it will be sufficient just to add this information. The location bit is what I think is most confusing as it is right now.
SG. I'll make this change.
the mlir-opt tool doesn't print them out by default
Is this documented somewhere that I can link to in the tutorial? Given that this is the first introduction to mlir-opt.
In the tools help it is (e.g., mlir-opt --help), but I don't think it has separate page.
I see the flag being referenced in the tutorial
Which flag do you mean here?
mlir-print-debuginfo
For successor blocks it is a bit more tricky given the Toy language up to that point, the link from successor blocks to the LangRef does show an example though.
Agreed; for successor blocks I think it will be sufficient just to add this information. The location bit is what I think is most confusing as it is right now.
Chapter 2 of the tutorial breaks down the anatomy of an example operation. The tutorial then discusses operations more generically, listing 7 different pieces. However, only 5 of these are captured by the example, the missing ones being the source location and the list of successor blocks.
Could we add example operations that demonstrate these aspects?
In particular, the tutorial emphasizes that all operations must have an attached source location, and that dropping that must be intentional. However, our existing example doesn't have one - it would be great to explain here why/when an operation might not, and also to add an example operation with a source location so it's clear how it works.