This is an archive of the discontinued LLVM Phabricator instance.

[mlir] add readonly/consume annotations to transform named sequences
ClosedPublic

Authored by ftynse on Mar 30 2023, 5:35 AM.

Details

Summary

Use the argument attribute mechanism for function-like operations to
annotate the arguments of named transform sequences as consuming or only
reading the handles passed as arguments. This makes it possible to
correctly specify handle invalidation for external named sequences by
requiring their declarations to always provide such annotations.
Additionally, these annotations remove the need to analyze the body of
a named sequence to understand its effects on the arguments. Make them
required for named sequences that are called from the same file, in
addition to external sequences.

Provide a convenience pass that infers annotations by analyzing bodies
of named sequences provided they are not called from the same file.

Diff Detail

Event Timeline

ftynse created this revision.Mar 30 2023, 5:35 AM
ftynse requested review of this revision.Mar 30 2023, 5:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2023, 5:35 AM
springerm accepted this revision.Mar 30 2023, 5:39 AM

Do you also have to update TransformDialect::verifyOperationAttribute?

This revision is now accepted and ready to land.Mar 30 2023, 5:39 AM

Do you also have to update TransformDialect::verifyOperationAttribute?

It doesn't seem to get called, otherwise it would have emitted "unknown attribute" errors... Perhaps some calls are missing somewhere.

ftynse updated this revision to Diff 510477.Apr 3 2023, 6:22 AM

Remove spurious change.