llvm-project/mlir/lib/Dialect/SPIRV/Transforms
River Riddle 7ceffae18c [mlir] Convert OpTrait::FunctionLike to FunctionOpInterface
This commit refactors the FunctionLike trait into an interface (FunctionOpInterface).
FunctionLike as it is today is already a pseudo-interface, with many users checking the
presence of the trait and then manually into functionality implemented in the
function_like_impl namespace. By transitioning to an interface, these accesses are much
cleaner (ideally with no direct calls to the impl namespace outside of the implementation
of the derived function operations, e.g. for parsing/printing utilities).

I've tried to maintain as much compatability with the current state as possible, while
also trying to clean up as much of the cruft as possible. The general migration plan for
current users of FunctionLike is as follows:

* function_like_impl -> function_interface_impl
Realistically most user calls should remove references to functions within this namespace
outside of a vary narrow set (e.g. parsing/printing utilities). Calls to the attribute name
accessors should be migrated to the `FunctionOpInterface::` equivalent, most everything
else should be updated to be driven through an instance of the interface.

* OpTrait::FunctionLike -> FunctionOpInterface
`hasTrait` checks will need to be moved to isa, along with the other various Trait vs
Interface API differences.

* populateFunctionLikeTypeConversionPattern -> populateFunctionOpInterfaceTypeConversionPattern

Fixes #52917

Differential Revision: https://reviews.llvm.org/D117272
2022-01-18 20:56:53 -08:00
..
CMakeLists.txt [mlir][spirv] NFC: Shuffle code around to better follow convention 2020-12-17 11:03:26 -05:00
DecorateCompositeTypeLayoutPass.cpp [mlir] Convert NamedAttribute to be a class 2021-11-18 05:39:29 +00:00
LowerABIAttributesPass.cpp Apply clang-tidy fixes for performance-for-range-copy to MLIR (NFC) 2022-01-02 22:19:56 +00:00
PassDetail.h Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
RewriteInsertsPass.cpp Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
SPIRVConversion.cpp [mlir] Convert OpTrait::FunctionLike to FunctionOpInterface 2022-01-18 20:56:53 -08:00
UpdateVCEPass.cpp [mlir][spirv] Change the return type for {Min|Max}VersionBase 2021-11-24 17:33:01 -05:00