[mlir] Refactor OpInterface internals to be faster and factor out common bits.
authorRiver Riddle <riddleriver@gmail.com>
Thu, 25 Jun 2020 00:23:41 +0000 (17:23 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Thu, 25 Jun 2020 00:23:58 +0000 (17:23 -0700)
commit7d1452d8373e5aaaa94b5d0d6c9a1dc4be457311
tree1233c084cbad32cf83241dcdc186fbaa1bbde93a
parent93bc571d472dddc188b0d169af38dc3eff128bb6
[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
mlir/docs/Interfaces.md
mlir/include/mlir/IR/OpDefinition.h
mlir/include/mlir/IR/OperationSupport.h
mlir/include/mlir/Support/InterfaceSupport.h [new file with mode: 0644]
mlir/lib/IR/MLIRContext.cpp