Files
clang-p2996/mlir/lib/Conversion/ConvertToLLVM/CMakeLists.txt
Fabian Mora 7498eaa9ab [mlir][LLVM] Add the ConvertToLLVMAttrInterface and ConvertToLLVMOpInterface interfaces (#99566)
This patch adds the `ConvertToLLVMAttrInterface` and
`ConvertToLLVMOpInterface` interfaces. It also modifies the
`convert-to-llvm` pass to use these interfaces when available.

The `ConvertToLLVMAttrInterface` interfaces allows attributes to
configure conversion to LLVM, including the conversion target, LLVM type
converter, and populating conversion patterns. See the `NVVMTargetAttr`
implementation of this interface for an example of how this interface
can be used to configure conversion to LLVM.

The `ConvertToLLVMOpInterface` interface collects all convert to LLVM
attributes stored in an operation.

Finally, the `convert-to-llvm` pass was modified to use these interfaces
when available. This allows applying `convert-to-llvm` to GPU modules
and letting the `NVVMTargetAttr` decide which patterns to populate.
2024-11-24 10:09:43 -05:00

33 lines
523 B
CMake

set(LLVM_OPTIONAL_SOURCES
ConvertToLLVMPass.cpp
ToLLVMInterface.cpp
)
add_mlir_conversion_library(MLIRConvertToLLVMInterface
ToLLVMInterface.cpp
DEPENDS
MLIRConvertToLLVMInterfaceIncGen
LINK_LIBS PUBLIC
MLIRIR
MLIRSupport
)
add_mlir_conversion_library(MLIRConvertToLLVMPass
ConvertToLLVMPass.cpp
DEPENDS
MLIRConversionPassIncGen
LINK_LIBS PUBLIC
MLIRIR
MLIRConvertToLLVMInterface
MLIRLLVMCommonConversion
MLIRLLVMDialect
MLIRPass
MLIRRewrite
MLIRSupport
MLIRTransformUtils
)