LLVM 20.0.0git
Classes | Namespaces | Typedefs | Functions
PassManager.h File Reference

This header defines various interfaces for pass management in LLVM. More...

#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/TinyPtrVector.h"
#include "llvm/IR/Analysis.h"
#include "llvm/IR/PassManagerInternal.h"
#include "llvm/Support/TypeName.h"
#include <cassert>
#include <cstring>
#include <iterator>
#include <list>
#include <memory>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  llvm::PassInfoMixin< DerivedT >
 A CRTP mix-in to automatically provide informational APIs needed for passes. More...
 
struct  llvm::AnalysisInfoMixin< DerivedT >
 A CRTP mix-in that provides informational APIs needed for analysis passes. More...
 
class  llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >
 Manages a sequence of passes over a particular unit of IR. More...
 
class  llvm::AnalysisManager< IRUnitT, ExtraArgTs >
 A container for analyses that lazily runs them and caches their results. More...
 
class  llvm::AnalysisManager< IRUnitT, ExtraArgTs >::Invalidator
 API to communicate dependencies between analyses during invalidation. More...
 
class  llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >
 An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR unit. More...
 
class  llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >::Result
 
class  llvm::OuterAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >
 An analysis over an "inner" IR unit that provides access to an analysis manager over a "outer" IR unit. More...
 
class  llvm::OuterAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >::Result
 Result proxy object for OuterAnalysisManagerProxy. More...
 
class  llvm::ModuleToFunctionPassAdaptor
 Trivial adaptor that maps from a module to its functions. More...
 
struct  llvm::RequireAnalysisPass< AnalysisT, IRUnitT, AnalysisManagerT, ExtraArgTs >
 A utility pass template to force an analysis result to be available. More...
 
struct  llvm::InvalidateAnalysisPass< AnalysisT >
 A no-op pass template which simply forces a specific analysis result to be invalidated. More...
 
struct  llvm::InvalidateAllAnalysesPass
 A utility pass that does nothing, but preserves no analyses. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::detail
 These are wrappers over isa* function that allow them to be used in generic algorithms such as llvm:all_of, llvm::none_of, etc.
 

Typedefs

using llvm::ModulePassManager = PassManager< Module >
 Convenience typedef for a pass manager over modules.
 
using llvm::FunctionPassManager = PassManager< Function >
 Convenience typedef for a pass manager over functions.
 
using llvm::FunctionAnalysisManager = AnalysisManager< Function >
 Convenience typedef for the Function analysis manager.
 
using llvm::FunctionAnalysisManagerModuleProxy = InnerAnalysisManagerProxy< FunctionAnalysisManager, Module >
 Provide the FunctionAnalysisManager to Module proxy.
 
using llvm::ModuleAnalysisManagerFunctionProxy = OuterAnalysisManagerProxy< ModuleAnalysisManager, Function >
 Provide the ModuleAnalysisManager to Function proxy.
 

Functions

template<typename PassT , typename IRUnitT , typename AnalysisManagerT , typename... ArgTs, size_t... Ns>
PassT::Result llvm::detail::getAnalysisResultUnpackTuple (AnalysisManagerT &AM, IRUnitT &IR, std::tuple< ArgTs... > Args, std::index_sequence< Ns... >)
 Actual unpacker of extra arguments in getAnalysisResult, passes only those tuple arguments that are mentioned in index_sequence.
 
template<typename PassT , typename IRUnitT , typename... AnalysisArgTs, typename... MainArgTs>
PassT::Result llvm::detail::getAnalysisResult (AnalysisManager< IRUnitT, AnalysisArgTs... > &AM, IRUnitT &IR, std::tuple< MainArgTs... > Args)
 Helper for partial unpacking of extra arguments in getAnalysisResult.
 
template<typename IRUnitT >
void llvm::printIRUnitNameForStackTrace (raw_ostream &OS, const IRUnitT &IR)
 
template<>
void llvm::printIRUnitNameForStackTrace< Module > (raw_ostream &OS, const Module &IR)
 
template<>
void llvm::printIRUnitNameForStackTrace< Function > (raw_ostream &OS, const Function &IR)
 
template<typename FunctionPassT >
ModuleToFunctionPassAdaptor llvm::createModuleToFunctionPassAdaptor (FunctionPassT &&Pass, bool EagerlyInvalidate=false)
 A function to deduce a function pass type and wrap it in the templated adaptor.
 

Detailed Description

This header defines various interfaces for pass management in LLVM.

There is no "pass" interface in LLVM per se. Instead, an instance of any class which supports a method to 'run' it over a unit of IR can be used as a pass. A pass manager is generally a tool to collect a sequence of passes which run over a particular IR construct, and run each of them in sequence over each such construct in the containing IR construct. As there is no containing IR construct for a Module, a manager for passes over modules forms the base case which runs its managed passes in sequence over the single module provided.

The core IR library provides managers for running passes over modules and functions.

Note that the implementations of the pass managers use concept-based polymorphism as outlined in the "Value Semantics and Concept-based Polymorphism" talk (or its abbreviated sibling "Inheritance Is The Base Class of Evil") by Sean Parent:

Definition in file PassManager.h.