8 #ifndef MLIR_CONVERSION_GPUCOMMON_GPUOPSLOWERING_H_
9 #define MLIR_CONVERSION_GPUCOMMON_GPUOPSLOWERING_H_
25 unsigned alignmentBit = 0)
27 alignmentBit(alignmentBit) {}
35 unsigned alignmentBit;
41 unsigned workgroupAddrSpace, StringAttr kernelAttributeName,
42 std::optional<StringAttr> kernelBlockSizeAttributeName = std::nullopt)
44 allocaAddrSpace(allocaAddrSpace),
45 workgroupAddrSpace(workgroupAddrSpace),
46 kernelAttributeName(kernelAttributeName),
47 kernelBlockSizeAttributeName(kernelBlockSizeAttributeName) {}
55 unsigned allocaAddrSpace;
57 unsigned workgroupAddrSpace;
60 StringAttr kernelAttributeName;
63 std::optional<StringAttr> kernelBlockSizeAttributeName;
75 matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor,
90 addressSpace(addressSpace) {}
93 matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor,
106 matchAndRewrite(gpu::PrintfOp gpuPrintfOp, gpu::PrintfOpAdaptor adaptor,
124 ConversionPatternRewriter &rewriter,
125 const LLVMTypeConverter &converter);
129 template <
typename SourceOp>
138 *this->getTypeConverter());
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.
OpTy replaceOpWithNewOp(Operation *op, Args &&...args)
Replace the results of the given (original) op with a new op that is created without verification (re...
LogicalResult scalarizeVectorOp(Operation *op, ValueRange operands, ConversionPatternRewriter &rewriter, const LLVMTypeConverter &converter)
Unrolls op if it's operating on vectors.
Include the generated interface declarations.
LogicalResult success(bool isSuccess=true)
Utility function to generate a LogicalResult.
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)
LogicalResult matchAndRewrite(gpu::GPUFuncOp gpuFuncOp, OpAdaptor adaptor, ConversionPatternRewriter &rewriter) const override
GPUFuncOpLowering(const LLVMTypeConverter &converter, unsigned allocaAddrSpace, unsigned workgroupAddrSpace, StringAttr kernelAttributeName, std::optional< StringAttr > kernelBlockSizeAttributeName=std::nullopt)
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
This class represents an efficient way to signal success or failure.
Rewriting that unrolls SourceOp to scalars if it's operating on vectors.
LogicalResult matchAndRewrite(SourceOp op, typename SourceOp::Adaptor adaptor, ConversionPatternRewriter &rewriter) const override