forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][NFC] Move OpenMP related passes into a separate directory (ll…
- Loading branch information
1 parent
4933fd9
commit e0a2d29
Showing
19 changed files
with
153 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(LLVM_TARGET_DEFINITIONS Passes.td) | ||
mlir_tablegen(Passes.h.inc -gen-pass-decls -name FlangOpenMP) | ||
|
||
add_public_tablegen_target(FlangOpenMPPassesIncGen) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//===- Passes.h - OpenMP pass entry points ----------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This header declares the flang OpenMP passes. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef FORTRAN_OPTIMIZER_OPENMP_PASSES_H | ||
#define FORTRAN_OPTIMIZER_OPENMP_PASSES_H | ||
|
||
#include "mlir/Dialect/Func/IR/FuncOps.h" | ||
#include "mlir/IR/BuiltinOps.h" | ||
#include "mlir/Pass/Pass.h" | ||
#include "mlir/Pass/PassRegistry.h" | ||
|
||
#include <memory> | ||
|
||
namespace flangomp { | ||
#define GEN_PASS_DECL | ||
#define GEN_PASS_REGISTRATION | ||
#include "flang/Optimizer/OpenMP/Passes.h.inc" | ||
|
||
} // namespace flangomp | ||
|
||
#endif // FORTRAN_OPTIMIZER_OPENMP_PASSES_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//===-- Passes.td - flang OpenMP pass definition -----------*- tablegen -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef FORTRAN_OPTIMIZER_OPENMP_PASSES | ||
#define FORTRAN_OPTIMIZER_OPENMP_PASSES | ||
|
||
include "mlir/Pass/PassBase.td" | ||
|
||
def MapInfoFinalizationPass | ||
: Pass<"omp-map-info-finalization"> { | ||
let summary = "expands OpenMP MapInfo operations containing descriptors"; | ||
let description = [{ | ||
Expands MapInfo operations containing descriptor types into multiple | ||
MapInfo's for each pointer element in the descriptor that requires | ||
explicit individual mapping by the OpenMP runtime. | ||
}]; | ||
let dependentDialects = ["mlir::omp::OpenMPDialect"]; | ||
} | ||
|
||
def MarkDeclareTargetPass | ||
: Pass<"omp-mark-declare-target", "mlir::ModuleOp"> { | ||
let summary = "Marks all functions called by an OpenMP declare target function as declare target"; | ||
let dependentDialects = ["mlir::omp::OpenMPDialect"]; | ||
} | ||
|
||
def FunctionFiltering : Pass<"omp-function-filtering"> { | ||
let summary = "Filters out functions intended for the host when compiling " | ||
"for the target device."; | ||
let dependentDialects = [ | ||
"mlir::func::FuncDialect", | ||
"fir::FIROpsDialect" | ||
]; | ||
} | ||
|
||
#endif //FORTRAN_OPTIMIZER_OPENMP_PASSES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) | ||
|
||
add_flang_library(FlangOpenMPTransforms | ||
FunctionFiltering.cpp | ||
MapInfoFinalization.cpp | ||
MarkDeclareTarget.cpp | ||
|
||
DEPENDS | ||
FIRDialect | ||
HLFIROpsIncGen | ||
FlangOpenMPPassesIncGen | ||
|
||
LINK_LIBS | ||
FIRAnalysis | ||
FIRBuilder | ||
FIRCodeGen | ||
FIRDialect | ||
FIRDialectSupport | ||
FIRSupport | ||
FortranCommon | ||
MLIRFuncDialect | ||
MLIROpenMPDialect | ||
HLFIRDialect | ||
MLIRIR | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters