This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ods] Fix OpDefinitionsGen infer return types builder with regions
ClosedPublic

Authored by Mogball on Dec 10 2021, 7:58 AM.

Details

Summary

Despite handling regions and inferred return types, the builder was never generated for ops with both InferReturnTypeOpInterface and regions.

Diff Detail

Event Timeline

Mogball created this revision.Dec 10 2021, 7:58 AM
Mogball requested review of this revision.Dec 10 2021, 7:58 AM
jpienaar accepted this revision.Dec 12 2021, 5:52 PM

LG I'm not sure if TODO is addressed fully given condition move

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
1224

We don't have any real uses where we utilize the types of the region to determine the type so this check was to conservatively skip until verified that it is useful. You move the check down, what does that change? (out of my cache)

This revision is now accepted and ready to land.Dec 12 2021, 5:52 PM
Mogball marked an inline comment as done.Dec 13 2021, 6:56 AM

It's only partially addressed (region and successors -> regions).

mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
1224

This check was called in two places. In one place it stops a builder with inferredReturnTypes from being generated that does not handle regions (although there isn't any reason it shouldn't, since the extent of region handling is calling odsState.addRegion() N times). In another it does the same, except that builder has code for dealing with regions.

The builder gen in these edge cases could use a look-over.

This revision was automatically updated to reflect the committed changes.
Mogball marked an inline comment as done.