|
| 1 | +//===-- Passes.td - flang OpenMP pass definition -----------*- tablegen -*-===// |
| 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 FORTRAN_OPTIMIZER_OPENMP_PASSES |
| 10 | +#define FORTRAN_OPTIMIZER_OPENMP_PASSES |
| 11 | + |
| 12 | +include "mlir/Pass/PassBase.td" |
| 13 | + |
| 14 | +def MapInfoFinalizationPass |
| 15 | + : Pass<"omp-map-info-finalization"> { |
| 16 | + let summary = "expands OpenMP MapInfo operations containing descriptors"; |
| 17 | + let description = [{ |
| 18 | + Expands MapInfo operations containing descriptor types into multiple |
| 19 | + MapInfo's for each pointer element in the descriptor that requires |
| 20 | + explicit individual mapping by the OpenMP runtime. |
| 21 | + }]; |
| 22 | + let dependentDialects = ["mlir::omp::OpenMPDialect"]; |
| 23 | +} |
| 24 | + |
| 25 | +def MarkDeclareTargetPass |
| 26 | + : Pass<"omp-mark-declare-target", "mlir::ModuleOp"> { |
| 27 | + let summary = "Marks all functions called by an OpenMP declare target function as declare target"; |
| 28 | + let dependentDialects = ["mlir::omp::OpenMPDialect"]; |
| 29 | +} |
| 30 | + |
| 31 | +def FunctionFiltering : Pass<"omp-function-filtering"> { |
| 32 | + let summary = "Filters out functions intended for the host when compiling " |
| 33 | + "for the target device."; |
| 34 | + let dependentDialects = [ |
| 35 | + "mlir::func::FuncDialect", |
| 36 | + "fir::FIROpsDialect" |
| 37 | + ]; |
| 38 | +} |
| 39 | + |
| 40 | +#endif //FORTRAN_OPTIMIZER_OPENMP_PASSES |
0 commit comments