FLANG
DescriptorScalarization.h
1//===- DescriptorScalarization.h ------------------------------------------===//
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// Helpers for descriptor scalarization, which involves passing descriptor
10// fields as scalar inputs to an offload region and rebuilding the descriptor
11// inside it.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef FORTRAN_OPTIMIZER_OPENACC_UTILS_DESCRIPTORSCALARIZATION_H
16#define FORTRAN_OPTIMIZER_OPENACC_UTILS_DESCRIPTORSCALARIZATION_H
17
18#include "flang/Optimizer/Dialect/FIRType.h"
19#include "mlir/IR/Value.h"
20#include "llvm/ADT/SmallVector.h"
21
22namespace mlir {
23class Location;
24class OpBuilder;
25class Operation;
26} // namespace mlir
27
28namespace fir::acc {
29
32fir::SequenceType getScalarizableArrayType(fir::BaseBoxType boxType);
33
36bool mayRequireBaseAddress(mlir::Operation *op);
37
40 llvm::SmallVector<mlir::Value> lbs, extents, strides;
41};
42
44ShapeScalars emitShapeScalars(mlir::OpBuilder &builder, mlir::Location loc,
45 mlir::Value box, unsigned rank);
46
47} // namespace fir::acc
48
49#endif // FORTRAN_OPTIMIZER_OPENACC_UTILS_DESCRIPTORSCALARIZATION_H
Definition OpenACC.h:20
Definition AbstractConverter.h:32
Per-dimension lower bounds, extents, and byte strides of a descriptor.
Definition DescriptorScalarization.h:39