HomePhabricator

[mlir] Refactor OpInterface internals to be faster and factor out common bits.

Authored by rriddle on Wed, Jun 24, 5:23 PM.

Description

[mlir] Refactor OpInterface internals to be faster and factor out common bits.

This revision adds a new support header, InterfaceSupport, to contain various generic bits of functionality for implementing "Interfaces". Interfaces embody a mechanism for attaching concept-based polymorphism to a type system. With this refactoring a new InterfaceMap type is added to allow for efficient interface lookups without going through an indirect call. This should provide a decent performance speedup without changing the size of AbstractOperation.

In a future revision, this functionality will also be used to bring Interface like functionality to Attributes and Types.

Differential Revision: https://reviews.llvm.org/D81882