This is an archive of the discontinued LLVM Phabricator instance.

[mlir][OpInterfaces] Add support for generating a DialectInterface fallback for OpInterfaces
AbandonedPublic

Authored by rriddle on Dec 8 2020, 4:52 PM.

Details

Summary

This allows for a dialect to provide an implementation of an OpInterface for select unregistered operations. The fallback interface is generated when an OpInterface set generateDialectFallback to 1. The fallback interface requires the implementation of the same hooks as the op-specific model, along with an additional hook: bool isOpSupported(OperationName op) const that allows for filtering which unregistered operations are supported. The use of this fallback is transparent to users of the interface.

Depends On D92895

Diff Detail

Event Timeline

rriddle created this revision.Dec 8 2020, 4:52 PM
rriddle requested review of this revision.Dec 8 2020, 4:52 PM

Nice, first scan, may be a bad base change here as it feels like some unrelated changes.

mlir/docs/Interfaces.md
215

"filters" makes me think exclude. Could we use a different word here?

233

Would this be default false if not overridden?

mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td
852

Related change?

mlir/include/mlir/IR/OpDefinition.h
1765

s/does have/has/ ?

1771

dialect interface?

mlir/include/mlir/IR/RegionKindInterface.td
42

Related?

I know there was another prototype in this region, does that subsume this?

I know there was another prototype in this region, does that subsume this?

I have this: https://reviews.llvm.org/D93085 but River had a suggestion about the implementation and I didn't come to finish trying this alternative.

rriddle abandoned this revision.Feb 1 2021, 2:32 PM

I know there was another prototype in this region, does that subsume this?

I have this: https://reviews.llvm.org/D93085 but River had a suggestion about the implementation and I didn't come to finish trying this alternative.

I think what we have been discussing on D93085 is better, so we can continue improving that one.