LLVM 23.0.0git
OpenMPOpt.h
Go to the documentation of this file.
1//===- IPO/OpenMPOpt.h - Collection of OpenMP optimizations -----*- C++ -*-===//
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 LLVM_TRANSFORMS_IPO_OPENMPOPT_H
10#define LLVM_TRANSFORMS_IPO_OPENMPOPT_H
11
14#include "llvm/IR/PassManager.h"
15
16namespace llvm {
17
18namespace omp {
19
20/// Summary of a kernel (=entry point for target offloading).
21using Kernel = Function *;
22
23/// Set of kernels in the module
25
26/// Helper to determine if \p M contains OpenMP.
28
29/// Helper to determine if \p M is a OpenMP target offloading device module.
31
32/// Return true iff \p Fn is an OpenMP GPU kernel; \p Fn has the "kernel"
33/// attribute.
35
36/// Get OpenMP device kernels in \p M.
38
39} // namespace omp
40
41/// OpenMP optimizations pass.
42class OpenMPOptPass : public OptionalPassInfoMixin<OpenMPOptPass> {
43public:
44 OpenMPOptPass() = default;
45 OpenMPOptPass(ThinOrFullLTOPhase LTOPhase) : LTOPhase(LTOPhase) {}
46
48
49private:
51};
52
53class OpenMPOptCGSCCPass : public OptionalPassInfoMixin<OpenMPOptCGSCCPass> {
54public:
55 OpenMPOptCGSCCPass() = default;
56 OpenMPOptCGSCCPass(ThinOrFullLTOPhase LTOPhase) : LTOPhase(LTOPhase) {}
57
61
62private:
64};
65
66} // end namespace llvm
67
68#endif // LLVM_TRANSFORMS_IPO_OPENMPOPT_H
This header provides classes for managing passes over SCCs of the call graph.
#define LLVM_ABI
Definition Compiler.h:213
This header defines various interfaces for pass management in LLVM.
Implements a lazy call graph analysis and related passes for the new pass manager.
An SCC of the call graph.
A lazily constructed view of the call graph of a module.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
LLVM_ABI PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR)
OpenMPOptCGSCCPass(ThinOrFullLTOPhase LTOPhase)
Definition OpenMPOpt.h:56
OpenMPOptPass()=default
OpenMPOptPass(ThinOrFullLTOPhase LTOPhase)
Definition OpenMPOpt.h:45
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
A vector that has set insertion semantics.
Definition SetVector.h:57
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34
LLVM_ABI bool isOpenMPDevice(Module &M)
Helper to determine if M is a OpenMP target offloading device module.
LLVM_ABI bool containsOpenMP(Module &M)
Helper to determine if M contains OpenMP.
LLVM_ABI KernelSet getDeviceKernels(Module &M)
Get OpenMP device kernels in M.
SetVector< Kernel > KernelSet
Set of kernels in the module.
Definition OpenMPOpt.h:24
Function * Kernel
Summary of a kernel (=entry point for target offloading).
Definition OpenMPOpt.h:21
LLVM_ABI bool isOpenMPKernel(Function &Fn)
Return true iff Fn is an OpenMP GPU kernel; Fn has the "kernel" attribute.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
Definition Pass.h:77
@ None
No LTO/ThinLTO behavior needed.
Definition Pass.h:79
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
A CRTP mix-in for passes that can be skipped.