FLANG
FIROpenACCSupportAnalysis.h
1//===- FIROpenACCSupportAnalysis.h - FIR OpenACCSupport Analysis ----------===//
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// This file defines the FIR-specific implementation of OpenACCSupport analysis.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef FORTRAN_OPTIMIZER_OPENACC_ANALYSIS_FIROPENACCSUPPORTANALYSIS_H
14#define FORTRAN_OPTIMIZER_OPENACC_ANALYSIS_FIROPENACCSUPPORTANALYSIS_H
15
16#include "mlir/Dialect/OpenACC/Analysis/OpenACCSupport.h"
17#include "mlir/Dialect/OpenACC/OpenACC.h"
18#include "mlir/IR/Operation.h"
19#include "mlir/IR/Region.h"
20#include "mlir/IR/Value.h"
21#include <string>
22
23namespace fir {
24namespace acc {
25
38class FIROpenACCSupportAnalysis {
39public:
40 FIROpenACCSupportAnalysis() = default;
41
42 std::string getVariableName(mlir::Value v,
43 mlir::acc::VariableNameConfig config);
44
45 std::string getRecipeName(mlir::acc::RecipeKind kind, mlir::Type type,
46 mlir::Value var);
47
48 mlir::InFlightDiagnostic emitNYI(mlir::Location loc,
49 const mlir::Twine &message);
50
51 bool isValidSymbolUse(mlir::Operation *user, mlir::SymbolRefAttr symbol,
52 mlir::Operation **definingOpPtr);
53
54 bool isValidValueUse(mlir::Value v, mlir::Region &region);
55
56 std::optional<mlir::acc::TypeSizeAndAlignment>
57 getTypeSizeAndAlignment(mlir::Type ty, mlir::ModuleOp module,
58 mlir::acc::OpenACCSupport &support);
59};
60
61} // namespace acc
62} // namespace fir
63
64#endif // FORTRAN_OPTIMIZER_OPENACC_ANALYSIS_FIROPENACCSUPPORTANALYSIS_H
Definition AbstractConverter.h:37