8 #ifndef MLIR_CONVERSION_GPUCOMMON_GPUCOMMONPASS_H_
9 #define MLIR_CONVERSION_GPUCOMMON_GPUCOMMONPASS_H_
16 #include "llvm/ADT/StringRef.h"
26 class LLVMTypeConverter;
30 class RewritePatternSet;
36 enum class AddressSpace : uint32_t;
44 #define GEN_PASS_DECL_GPUTOLLVMCONVERSIONPASS
45 #include "mlir/Conversion/Passes.h.inc"
48 Operation *, llvm::LLVMContext &, StringRef)>;
53 : functionName(functionName),
54 functionType(LLVM::LLVMFunctionType::
get(returnType, argumentTypes)) {}
66 bool kernelBarePtrCallConv =
false,
67 bool kernelIntersperseSizeCallConv =
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 populateGpuToLLVMConversionPatterns(LLVMTypeConverter &converter, RewritePatternSet &patterns, bool kernelBarePtrCallConv=false, bool kernelIntersperseSizeCallConv=false)
Collect a set of patterns to convert from the GPU dialect to LLVM and populate converter for gpu type...
const FrozenRewritePatternSet & patterns
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...
FunctionCallBuilder(StringRef functionName, Type returnType, ArrayRef< Type > argumentTypes)
LLVM::LLVMFunctionType functionType