MLIR 24.0.0git
ACCToLLVM.h
Go to the documentation of this file.
1//===- ACCToLLVM.h - Convert OpenACC to LLVM 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
9#ifndef MLIR_CONVERSION_OPENACCTOLLVM_ACCTOLLVM_H
10#define MLIR_CONVERSION_OPENACCTOLLVM_ACCTOLLVM_H
11
13
14#include <functional>
15#include <memory>
16
17namespace mlir {
18class ConversionTarget;
20class Operation;
21class Pass;
23class Value;
24
25namespace acc {
26class OpenACCSupport;
27} // namespace acc
28
29#define GEN_PASS_DECL_CONVERTACCTOLLVMPASS
30#include "mlir/Conversion/Passes.h.inc"
31
32/// Configure conversion legality for OpenACC executable directives lowered to
33/// runtime calls.
36
37/// Populate patterns that lower OpenACC executable directives (init, shutdown,
38/// wait, set) to LLVM runtime calls.
40 LLVMTypeConverter &converter, RewritePatternSet &patterns,
41 const acc::ACCRuntimeCallConfig &config = {});
42
43/// Returns the address operand of a dialect-specific load operation. Used when
44/// moving capture/update dependencies into a cmpxchg loop. Patterns already
45/// recognize `llvm.load` and `memref.load`; this callback covers other dialect
46/// specific loads.
48
49/// Configure conversion legality for OpenACC atomic operations.
51
52/// Populate patterns that lower OpenACC atomic operations to LLVM dialect.
54 const LLVMTypeConverter &converter, RewritePatternSet &patterns,
55 acc::OpenACCSupport &accSupport,
56 ACCAtomicLoadAddressCallback getLoadAddress = {});
57
58} // namespace mlir
59
60#endif // MLIR_CONVERSION_OPENACCTOLLVM_ACCTOLLVM_H
Conversion from types to the LLVM IR dialect.
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87
The abstract base pass class.
Definition Pass.h:52
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
Include the generated interface declarations.
void populateACCAtomicPatterns(const LLVMTypeConverter &converter, RewritePatternSet &patterns, acc::OpenACCSupport &accSupport, ACCAtomicLoadAddressCallback getLoadAddress={})
Populate patterns that lower OpenACC atomic operations to LLVM dialect.
void configureACCExecutableDirectiveConversionLegality(ConversionTarget &target)
Configure conversion legality for OpenACC executable directives lowered to runtime calls.
void populateACCExecutableDirectivePatterns(LLVMTypeConverter &converter, RewritePatternSet &patterns, const acc::ACCRuntimeCallConfig &config={})
Populate patterns that lower OpenACC executable directives (init, shutdown, wait, set) to LLVM runtim...
std::function< Value(Operation *)> ACCAtomicLoadAddressCallback
Returns the address operand of a dialect-specific load operation.
Definition ACCToLLVM.h:47
void configureACCAtomicConversionLegality(ConversionTarget &target)
Configure conversion legality for OpenACC atomic operations.