LLVM 17.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.
27bool containsOpenMP(Module &M);
28
29/// Helper to determine if \p M is a OpenMP target offloading device module.
30bool isOpenMPDevice(Module &M);
31
32/// Get OpenMP device kernels in \p M.
34
35} // namespace omp
36
37/// OpenMP optimizations pass.
38class OpenMPOptPass : public PassInfoMixin<OpenMPOptPass> {
39public:
40 OpenMPOptPass() = default;
41 OpenMPOptPass(ThinOrFullLTOPhase LTOPhase) : LTOPhase(LTOPhase) {}
42
44
45private:
47};
48
49class OpenMPOptCGSCCPass : public PassInfoMixin<OpenMPOptCGSCCPass> {
50public:
51 OpenMPOptCGSCCPass() = default;
52 OpenMPOptCGSCCPass(ThinOrFullLTOPhase LTOPhase) : LTOPhase(LTOPhase) {}
53
56
57private:
59};
60
61} // end namespace llvm
62
63#endif // LLVM_TRANSFORMS_IPO_OPENMPOPT_H
This header provides classes for managing passes over SCCs of the call graph.
Implements a lazy call graph analysis and related passes for the new pass manager.
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:620
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:65
PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR)
Definition: OpenMPOpt.cpp:5452
OpenMPOptCGSCCPass(ThinOrFullLTOPhase LTOPhase)
Definition: OpenMPOpt.h:52
OpenMP optimizations pass.
Definition: OpenMPOpt.h:38
OpenMPOptPass()=default
OpenMPOptPass(ThinOrFullLTOPhase LTOPhase)
Definition: OpenMPOpt.h:41
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: OpenMPOpt.cpp:5344
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
A vector that has set insertion semantics.
Definition: SetVector.h:51
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
bool isOpenMPDevice(Module &M)
Helper to determine if M is a OpenMP target offloading device module.
Definition: OpenMPOpt.cpp:5559
bool containsOpenMP(Module &M)
Helper to determine if M contains OpenMP.
Definition: OpenMPOpt.cpp:5551
KernelSet getDeviceKernels(Module &M)
Get OpenMP device kernels in M.
Definition: OpenMPOpt.cpp:5523
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
Definition: Pass.h:76
@ None
No LTO/ThinLTO behavior needed.
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371