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
44 std::string getRecipeName(mlir::acc::RecipeKind kind, mlir::Type type,
45 mlir::Value var);
46
47 mlir::InFlightDiagnostic emitNYI(mlir::Location loc,
48 const mlir::Twine &message);
49
50 bool isValidSymbolUse(mlir::Operation *user, mlir::SymbolRefAttr symbol,
51 mlir::Operation **definingOpPtr);
52
53 bool isValidValueUse(mlir::Value v, mlir::Region &region);
54
55 std::optional<mlir::acc::TypeSizeAndAlignment>
56 getTypeSizeAndAlignment(mlir::Type ty, mlir::ModuleOp module,
57 mlir::acc::OpenACCSupport &support);
58};
59
60} // namespace acc
61} // namespace fir
62
63#endif // FORTRAN_OPTIMIZER_OPENACC_ANALYSIS_FIROPENACCSUPPORTANALYSIS_H
Definition AbstractConverter.h:37