8 #ifndef MLIR_CONVERSION_GPUCOMMON_GPUCOMMONPASS_H_
9 #define MLIR_CONVERSION_GPUCOMMON_GPUCOMMONPASS_H_
16 #include "llvm/ADT/StringRef.h"
27 class LLVMTypeConverter;
31 class RewritePatternSet;
37 enum class AddressSpace : uint32_t;
45 #define GEN_PASS_DECL_GPUTOLLVMCONVERSIONPASS
46 #include "mlir/Conversion/Passes.h.inc"
49 Operation *, llvm::LLVMContext &, StringRef)>;
54 : functionName(functionName),
55 functionType(LLVM::LLVMFunctionType::
get(returnType, argumentTypes)) {}
67 bool kernelBarePtrCallConv =
false);
Conversion from types to the LLVM IR dialect.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
Operation is the basic unit of execution within MLIR.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Include the generated interface declarations.
std::function< unsigned(gpu::AddressSpace)> MemorySpaceMapping
A function that maps a MemorySpace enum to a target-specific integer value.
std::function< std::unique_ptr< llvm::Module >(Operation *, llvm::LLVMContext &, StringRef)> LoweringCallback
void populateGpuMemorySpaceAttributeConversions(TypeConverter &typeConverter, const MemorySpaceMapping &mapping)
Populates memory space attribute conversion rules for lowering gpu.address_space to integer values.
auto get(MLIRContext *context, Ts &&...params)
Helper method that injects context only if needed, this helps unify some of the attribute constructio...
void populateGpuToLLVMConversionPatterns(LLVMTypeConverter &converter, RewritePatternSet &patterns, bool kernelBarePtrCallConv=false)
Collect a set of patterns to convert from the GPU dialect to LLVM and populate converter for gpu type...
FunctionCallBuilder(StringRef functionName, Type returnType, ArrayRef< Type > argumentTypes)
LLVM::LLVMFunctionType functionType