LLVM 17.0.0git
CycleAnalysis.h
Go to the documentation of this file.
1//===- CycleAnalysis.h - Cycle Info for LLVM IR -----------------*- 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/// \file
9///
10/// This file declares an analysis pass that computes CycleInfo for
11/// LLVM IR, specialized from GenericCycleInfo.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_ANALYSIS_CYCLEANALYSIS_H
16#define LLVM_ANALYSIS_CYCLEANALYSIS_H
17
19#include "llvm/IR/PassManager.h"
20#include "llvm/IR/SSAContext.h"
21#include "llvm/Pass.h"
22
23namespace llvm {
24extern template class GenericCycleInfo<SSAContext>;
25extern template class GenericCycle<SSAContext>;
26
29
30/// Legacy analysis pass which computes a \ref CycleInfo.
32 Function *F = nullptr;
33 CycleInfo CI;
34
35public:
36 static char ID;
37
39
40 CycleInfo &getResult() { return CI; }
41 const CycleInfo &getResult() const { return CI; }
42
43 bool runOnFunction(Function &F) override;
44 void getAnalysisUsage(AnalysisUsage &AU) const override;
45 void releaseMemory() override;
46 void print(raw_ostream &OS, const Module *M = nullptr) const override;
47
48 // TODO: verify analysis?
49};
50
51/// Analysis pass which computes a \ref CycleInfo.
54 static AnalysisKey Key;
55
56public:
57 /// Provide the result typedef for this analysis pass.
59
61
62 /// Run the analysis pass over a function and produce a dominator tree.
64
65 // TODO: verify analysis?
66};
67
68/// Printer pass for the \c DominatorTree.
70 raw_ostream &OS;
71
72public:
74
76};
77
78} // end namespace llvm
79
80#endif // LLVM_ANALYSIS_CYCLEANALYSIS_H
static bool runOnFunction(Function &F, bool PostInlining)
Find all cycles in a control-flow graph, including irreducible loops.
#define F(x, y, z)
Definition: MD5.cpp:55
This header defines various interfaces for pass management in LLVM.
This file declares a specialization of the GenericSSAContext<X> class template for LLVM IR.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:620
Represent the analysis usage information of a pass.
Analysis pass which computes a CycleInfo.
Definition: CycleAnalysis.h:52
Printer pass for the DominatorTree.
Definition: CycleAnalysis.h:69
Legacy analysis pass which computes a CycleInfo.
Definition: CycleAnalysis.h:31
const CycleInfo & getResult() const
Definition: CycleAnalysis.h:41
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:308
GenericCycle< SSAContext > CycleT
A possibly irreducible generalization of a Loop.
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr)
GenericCycleInfo< SSAContext > CycleInfo
Definition: CycleAnalysis.h:27
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:394
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: PassManager.h:69
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371