This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Attach InferTypeOpInterface on SameOperandsAndResultType operations when possible
ClosedPublic

Authored by rriddle on Apr 27 2022, 5:34 PM.

Details

Summary

This allows for inferring the result types of operations in certain situations by using the type of
an operand. This commit allowed for automatically supporting type inference for many more
operations with no additional effort, e.g. nearly all Arithmetic operations now support
result type inferrence with no additional changes.

Depends on D124580

Diff Detail

Event Timeline

rriddle created this revision.Apr 27 2022, 5:34 PM
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested review of this revision.Apr 27 2022, 5:34 PM
jpienaar accepted this revision.Apr 27 2022, 5:41 PM

Nice, thanks

mlir/lib/TableGen/Operator.cpp
336

We could also make this an OpTraitList and avoid need to inject here. But I can do that in follow up (that special casing Todo still applies)

This revision is now accepted and ready to land.Apr 27 2022, 5:41 PM
This revision was landed with ongoing or failed builds.Apr 28 2022, 12:58 PM
This revision was automatically updated to reflect the committed changes.