MLIR 22.0.0git
GPUToNVVMPass.h
Go to the documentation of this file.
1//===- GPUToNVVMPass.h - Convert GPU kernel to NVVM dialect -----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8#ifndef MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_
9#define MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_
10
14#include <memory>
15
16namespace mlir {
18class ConversionTarget;
20class Pass;
21
22namespace gpu {
23class GPUModuleOp;
24class MMAMatrixType;
25} // namespace gpu
26
27#define GEN_PASS_DECL_CONVERTGPUOPSTONVVMOPS
28#include "mlir/Conversion/Passes.h.inc"
29
30LLVM::LLVMStructType convertMMAToLLVMType(gpu::MMAMatrixType type);
31
32/// Configure target to convert from the GPU dialect to NVVM.
34
35/// Configure the LLVM type convert to convert types and address spaces from the
36/// GPU dialect to NVVM.
37void configureGpuToNVVMTypeConverter(LLVMTypeConverter &converter);
38
39/// Populate patterns that lower certain arith and math dialect ops to
40/// libdevice calls.
41void populateLibDeviceConversionPatterns(const LLVMTypeConverter &converter,
42 RewritePatternSet &patterns,
43 PatternBenefit benefit = 1);
44
45/// Collect a set of patterns to convert from the GPU dialect to NVVM.
46void populateGpuToNVVMConversionPatterns(const LLVMTypeConverter &converter,
47 RewritePatternSet &patterns,
48 PatternBenefit benefit = 1);
49
50/// Populate GpuSubgroupReduce pattern to NVVM. It generates a specific nvvm
51/// op that is not available on every GPU.
53 const LLVMTypeConverter &converter, RewritePatternSet &patterns,
54 PatternBenefit benefit = 1);
55
56/// Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM.
57void populateGpuWMMAToNVVMConversionPatterns(const LLVMTypeConverter &converter,
58 RewritePatternSet &patterns,
59 PatternBenefit benefit = 1);
60} // namespace mlir
61
62#endif // MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_
Conversion from types to the LLVM IR dialect.
The abstract base pass class.
Definition Pass.h:51
MMAMatrix represents a matrix held by a subgroup for matrix-matrix multiply accumulate operations.
Definition GPUDialect.h:131
Include the generated interface declarations.
LLVM::LLVMStructType convertMMAToLLVMType(gpu::MMAMatrixType type)
Return the LLVMStructureType corresponding to the MMAMatrixType type.
void configureGpuToNVVMTypeConverter(LLVMTypeConverter &converter)
Configure the LLVM type convert to convert types and address spaces from the GPU dialect to NVVM.
void configureGpuToNVVMConversionLegality(ConversionTarget &target)
Configure target to convert from the GPU dialect to NVVM.
const FrozenRewritePatternSet & patterns
void populateGpuSubgroupReduceOpLoweringPattern(const LLVMTypeConverter &converter, RewritePatternSet &patterns, PatternBenefit benefit=1)
Populate GpuSubgroupReduce pattern to NVVM.
void populateGpuToNVVMConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns, PatternBenefit benefit=1)
Collect a set of patterns to convert from the GPU dialect to NVVM.
void populateLibDeviceConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns, PatternBenefit benefit=1)
Populate patterns that lower certain arith and math dialect ops to libdevice calls.
void populateGpuWMMAToNVVMConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns, PatternBenefit benefit=1)
Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM.