8 #ifndef MLIR_CONVERSION_GPUCOMMON_GPUOPSLOWERING_H_
9 #define MLIR_CONVERSION_GPUCOMMON_GPUOPSLOWERING_H_
25 unsigned alignmentBit = 0)
27 alignmentBit(alignmentBit) {}
35 unsigned alignmentBit;
65 allocaAddrSpace(
options.allocaAddrSpace),
66 workgroupAddrSpace(
options.workgroupAddrSpace),
67 kernelAttributeName(
options.kernelAttributeName),
68 kernelBlockSizeAttributeName(
options.kernelBlockSizeAttributeName),
69 kernelCallingConvention(
options.kernelCallingConvention),
70 nonKernelCallingConvention(
options.nonKernelCallingConvention),
71 encodeWorkgroupAttributionsAsArguments(
72 options.encodeWorkgroupAttributionsAsArguments) {}
80 unsigned allocaAddrSpace;
82 unsigned workgroupAddrSpace;
86 StringAttr kernelAttributeName;
89 StringAttr kernelBlockSizeAttributeName;
92 LLVM::CConv kernelCallingConvention;
94 LLVM::CConv nonKernelCallingConvention;
98 bool encodeWorkgroupAttributionsAsArguments;
110 matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor,
123 int addressSpace = 0)
125 addressSpace(addressSpace) {}
128 matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor,
141 matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor,
161 template <
typename SourceOp>
170 *this->getTypeConverter());
static llvm::ManagedStatic< PassManagerOptions > options
This class implements a pattern rewriter for use with ConversionPatterns.
Utility class for operation conversions targeting the LLVM dialect that match exactly one source oper...
ConvertOpToLLVMPattern(const LLVMTypeConverter &typeConverter, PatternBenefit benefit=1)
typename SourceOp::Adaptor OpAdaptor
Conversion from types to the LLVM IR dialect.
Operation is the basic unit of execution within MLIR.
This class provides an abstraction over the different types of ranges over Values.
LogicalResult scalarizeVectorOp(Operation *op, ValueRange operands, ConversionPatternRewriter &rewriter, const LLVMTypeConverter &converter)
Unrolls op if it's operating on vectors.
Include the generated interface declarations.
Lowering for gpu.dynamic.shared.memory to LLVM dialect.
LogicalResult matchAndRewrite(gpu::DynamicSharedMemoryOp op, OpAdaptor adaptor, ConversionPatternRewriter &rewriter) const override
GPUDynamicSharedMemoryOpLowering(const LLVMTypeConverter &converter, unsigned alignmentBit=0)
unsigned allocaAddrSpace
The address space to use for allocas in private memory.
LLVM::CConv nonKernelCallingConvention
The calling convention to use for non-kernel functions.
StringAttr kernelBlockSizeAttributeName
The attribute name to to set block size.
LLVM::CConv kernelCallingConvention
The calling convention to use for kernel functions.
unsigned workgroupAddrSpace
The address space to use declaring workgroup memory.
bool encodeWorkgroupAttributionsAsArguments
Whether to encode workgroup attributions as additional arguments instead of a global variable.
StringAttr kernelAttributeName
The attribute name to use instead of gpu.kernel.
LogicalResult matchAndRewrite(gpu::GPUFuncOp gpuFuncOp, OpAdaptor adaptor, ConversionPatternRewriter &rewriter) const override
GPUFuncOpLowering(const LLVMTypeConverter &converter, const GPUFuncOpLoweringOptions &options)
The lowering of gpu.printf to a call to HIP hostcalls.
LogicalResult matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor, ConversionPatternRewriter &rewriter) const override
The lowering of gpu.printf to a call to an external printf() function.
GPUPrintfOpToLLVMCallLowering(const LLVMTypeConverter &converter, int addressSpace=0)
LogicalResult matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor, ConversionPatternRewriter &rewriter) const override
Lowering of gpu.printf to a vprintf standard library.
LogicalResult matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor, ConversionPatternRewriter &rewriter) const override
LogicalResult matchAndRewrite(gpu::ReturnOp op, OpAdaptor adaptor, ConversionPatternRewriter &rewriter) const override
Rewriting that unrolls SourceOp to scalars if it's operating on vectors.
LogicalResult matchAndRewrite(SourceOp op, typename SourceOp::Adaptor adaptor, ConversionPatternRewriter &rewriter) const override