This is an archive of the discontinued LLVM Phabricator instance.

[mlir][scf] support 1:N type conversion for scf.if/while/condition
ClosedPublic

Authored by Peiming on Oct 31 2022, 11:37 AM.

Diff Detail

Event Timeline

Peiming created this revision.Oct 31 2022, 11:37 AM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Oct 31 2022, 11:37 AM

Good stuff! LGTM, but please wait for Alex ;-)

mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
167

nit pick: If somebody removes the forop comment later, this reference becomes "dangling" Why not say here why we inline?

EDIT: Ah, I see that this comment was already there in the original code; it is still my concern, but see if you feel like addressing it

ftynse accepted this revision.Nov 2 2022, 5:07 AM
ftynse added inline comments.
mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
167

I don't think this needs an explanation TBH. Inlining is a "move" operation as opposed to clone which is a "copy", everything else is a corollary. If we keep it, I suggest to at least put it next to the actual inlining.

176

Nit: "operator" is not a term MLIR uses, some ancient code might have inherited it from TF-oriented thinking, but let's not perpetuate this.

This revision is now accepted and ready to land.Nov 2 2022, 5:07 AM
Peiming updated this revision to Diff 472654.Nov 2 2022, 9:39 AM
Peiming marked 3 inline comments as done.

address comments from Alex and Aart.

mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
167

removed it.

176

Got it!

This revision was landed with ongoing or failed builds.Nov 2 2022, 9:53 AM
This revision was automatically updated to reflect the committed changes.