This is an archive of the discontinued LLVM Phabricator instance.

[mlir] FunctionOpInterface: make get/setFunctionType interface methods
ClosedPublic

Authored by Mogball on Dec 6 2022, 11:32 AM.

Details

Summary

This patch removes the concept of a function_type-named type attribute
as a requirement for implementors of FunctionOpInterface. Instead, this
type should be provided through two interface methods, getFunctionType
and setFunctionTypeAttr (*Attr because functions may use different
concrete function types), which should be automatically implemented by
ODS for ops that define a $function_type attribute.

This also allows FunctionOpInterface to materialize function types if
they don't carry them in an attribute, for example.

Importantly, all the function "helper" still accept an attribute name to
use in parsing and printing functions, for example.

Diff Detail

Event Timeline

Mogball created this revision.Dec 6 2022, 11:32 AM
Mogball requested review of this revision.Dec 6 2022, 11:32 AM
lattner accepted this revision.Dec 6 2022, 1:15 PM

Nice!

mlir/include/mlir/IR/FunctionImplementation.h
79

Oh nice, I like making the attribute name explicit. Beyond allowing it to change, this makes it more clear that there is a baked-in assumption here that it is a stored attribute.

This revision is now accepted and ready to land.Dec 6 2022, 1:15 PM
Mogball updated this revision to Diff 480639.Dec 6 2022, 2:50 PM

Fix toyc

Makes sense to me!

rriddle accepted this revision.Dec 8 2022, 10:36 AM
This revision was landed with ongoing or failed builds.Dec 8 2022, 11:32 AM
This revision was automatically updated to reflect the committed changes.

It should be fixed at HEAD now. The fix was sent out shortly after this patch.

It should be fixed at HEAD now. The fix was sent out shortly after this patch.

The latest build is still broken in the same way (https://lab.llvm.org/buildbot/#/builders/13/builds/29454) and I don't see any fixes in main past the commit that it ran for that have fixes for mlir. Could you please confirm that the fix that was submitted resolved the issue?