MLIR  20.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 
13 #include <memory>
14 
15 namespace mlir {
16 class LLVMTypeConverter;
17 class ConversionTarget;
18 class RewritePatternSet;
19 class Pass;
20 
21 namespace gpu {
22 class GPUModuleOp;
23 class MMAMatrixType;
24 } // namespace gpu
25 
26 #define GEN_PASS_DECL_CONVERTGPUOPSTONVVMOPS
27 #include "mlir/Conversion/Passes.h.inc"
28 
29 LLVM::LLVMStructType convertMMAToLLVMType(gpu::MMAMatrixType type);
30 
31 /// Configure target to convert from the GPU dialect to NVVM.
32 void configureGpuToNVVMConversionLegality(ConversionTarget &target);
33 
34 /// Configure the LLVM type convert to convert types and address spaces from the
35 /// GPU dialect to NVVM.
36 void configureGpuToNVVMTypeConverter(LLVMTypeConverter &converter);
37 
38 /// Collect a set of patterns to convert from the GPU dialect to NVVM.
39 void populateGpuToNVVMConversionPatterns(const LLVMTypeConverter &converter,
40  RewritePatternSet &patterns);
41 
42 /// Populate GpuSubgroupReduce pattern to NVVM. It generates a specific nvvm
43 /// op that is not available on every GPU.
45  const LLVMTypeConverter &converter, RewritePatternSet &patterns);
46 
47 /// Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM.
48 void populateGpuWMMAToNVVMConversionPatterns(const LLVMTypeConverter &converter,
49  RewritePatternSet &patterns);
50 } // namespace mlir
51 
52 #endif // MLIR_CONVERSION_GPUTONVVM_GPUTONVVMPASS_H_
Include the generated interface declarations.
void populateGpuToNVVMConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns)
Collect a set of patterns to convert from the GPU dialect to NVVM.
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 populateGpuWMMAToNVVMConversionPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns)
Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM.
void populateGpuSubgroupReduceOpLoweringPattern(const LLVMTypeConverter &converter, RewritePatternSet &patterns)
Populate GpuSubgroupReduce pattern to NVVM.