37 #ifndef LLVM_IR_PASSMANAGER_H 38 #define LLVM_IR_PASSMANAGER_H 59 #include <type_traits> 162 PA.PreservedIDs.
insert(&AllAnalysesKey);
167 template <
typename AnalysisSetT>
181 NotPreservedAnalysisIDs.erase(ID);
185 if (!areAllPreserved())
186 PreservedIDs.insert(ID);
197 if (!areAllPreserved())
198 PreservedIDs.insert(ID);
218 PreservedIDs.erase(ID);
219 NotPreservedAnalysisIDs.insert(ID);
229 if (areAllPreserved()) {
235 for (
auto ID : Arg.NotPreservedAnalysisIDs) {
236 PreservedIDs.erase(
ID);
237 NotPreservedAnalysisIDs.insert(
ID);
239 for (
auto ID : PreservedIDs)
240 if (!Arg.PreservedIDs.
count(
ID))
241 PreservedIDs.erase(
ID);
249 if (
Arg.areAllPreserved())
251 if (areAllPreserved()) {
252 *
this = std::move(
Arg);
257 for (
auto ID :
Arg.NotPreservedAnalysisIDs) {
258 PreservedIDs.erase(
ID);
259 NotPreservedAnalysisIDs.insert(
ID);
261 for (
auto ID : PreservedIDs)
262 if (!
Arg.PreservedIDs.count(
ID))
263 PreservedIDs.erase(
ID);
273 const bool IsAbandoned;
279 : PA(PA), ID(ID), IsAbandoned(PA.NotPreservedAnalysisIDs.
count(ID)) {}
286 return !IsAbandoned && (PA.PreservedIDs.
count(&AllAnalysesKey) ||
287 PA.PreservedIDs.
count(ID));
302 return !IsAbandoned && (PA.PreservedIDs.
count(&AllAnalysesKey) ||
303 PA.PreservedIDs.
count(SetID));
330 return NotPreservedAnalysisIDs.empty() &&
331 PreservedIDs.count(&AllAnalysesKey);
345 return NotPreservedAnalysisIDs.empty() &&
346 (PreservedIDs.count(&AllAnalysesKey) || PreservedIDs.count(SetID));
367 template <
typename IRUnitT,
typename... ExtraArgTs>
class AnalysisManager;
376 static_assert(std::is_base_of<PassInfoMixin, DerivedT>::value,
377 "Must pass the derived type as the template argument!");
389 template <
typename DerivedT>
407 static_assert(std::is_base_of<AnalysisInfoMixin, DerivedT>::value,
408 "Must pass the derived type as the template argument!");
417 template <
typename PassT,
typename IRUnitT,
typename AnalysisManagerT,
418 typename... ArgTs,
size_t... Ns>
419 typename PassT::Result
421 std::tuple<ArgTs...>
Args,
422 std::index_sequence<Ns...>) {
424 return AM.template getResult<PassT>(
IR, std::get<Ns>(
Args)...);
432 template <
typename PassT,
typename IRUnitT,
typename... AnalysisArgTs,
433 typename... MainArgTs>
434 typename PassT::Result
436 std::tuple<MainArgTs...>
Args) {
438 PassT, IRUnitT>)(AM,
IR,
Args,
439 std::index_sequence_for<AnalysisArgTs...>{});
462 template <
typename IRUnitT,
464 typename... ExtraArgTs>
466 PassManager<IRUnitT, AnalysisManagerT, ExtraArgTs...>> {
471 explicit PassManager(
bool DebugLogging =
false) : DebugLogging(DebugLogging) {}
478 : Passes(
std::move(
Arg.Passes)),
479 DebugLogging(
std::move(
Arg.DebugLogging)) {}
482 Passes = std::move(RHS.Passes);
483 DebugLogging = std::move(RHS.DebugLogging);
490 ExtraArgTs... ExtraArgs) {
498 detail::getAnalysisResult<PassInstrumentationAnalysis>(
499 AM,
IR, std::tuple<ExtraArgTs...>(ExtraArgs...));
502 dbgs() <<
"Starting " << getTypeName<IRUnitT>() <<
" pass manager run.\n";
504 for (
unsigned Idx = 0,
Size = Passes.size(); Idx !=
Size; ++Idx) {
505 auto *
P = Passes[Idx].get();
507 dbgs() <<
"Running pass: " <<
P->name() <<
" on " << IR.getName()
524 AM.invalidate(IR, PassPA);
544 dbgs() <<
"Finished " << getTypeName<IRUnitT>() <<
" pass manager run.\n";
554 Passes.emplace_back(
new PassModelT(std::move(Pass)));
561 std::vector<std::unique_ptr<PassConceptT>> Passes;
593 : Callbacks(Callbacks) {}
597 template <
typename IRUnitT,
typename AnalysisManagerT,
typename... ExtraArgTs>
598 Result run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...) {
608 template <
typename IRUnitT,
typename... ExtraArgTs>
class AnalysisManager {
614 using ResultConceptT =
626 using AnalysisResultListT =
627 std::list<std::pair<AnalysisKey *, std::unique_ptr<ResultConceptT>>>;
635 using AnalysisResultMapT =
637 typename AnalysisResultListT::iterator>;
666 template <
typename PassT>
670 PreservedAnalyses, Invalidator>;
672 return invalidateImpl<ResultModelT>(
PassT::ID(),
IR, PA);
682 return invalidateImpl<>(
ID,
IR, PA);
688 template <
typename ResultT = ResultConceptT>
690 const PreservedAnalyses &PA) {
693 auto IMapI = IsResultInvalidated.find(ID);
694 if (IMapI != IsResultInvalidated.end())
695 return IMapI->second;
698 auto RI =
Results.find({ID, &IR});
700 "Trying to invalidate a dependent result that isn't in the " 701 "manager's cache is always an error, likely due to a stale result " 704 auto &Result =
static_cast<ResultT &
>(*RI->second->second);
711 std::tie(IMapI, Inserted) =
712 IsResultInvalidated.insert({
ID, Result.invalidate(IR, PA, *
this)});
714 assert(Inserted &&
"Should not have already inserted this ID, likely " 715 "indicates a dependency cycle!");
716 return IMapI->second;
720 const AnalysisResultMapT &
Results)
721 : IsResultInvalidated(IsResultInvalidated), Results(Results) {}
724 const AnalysisResultMapT &
Results;
736 assert(AnalysisResults.empty() == AnalysisResultLists.empty() &&
737 "The storage and index of analysis results disagree on how many " 739 return AnalysisResults.empty();
749 dbgs() <<
"Clearing all analysis results for: " << Name <<
"\n";
751 auto ResultsListI = AnalysisResultLists.
find(&IR);
752 if (ResultsListI == AnalysisResultLists.end())
755 for (
auto &IDAndResult : ResultsListI->second)
756 AnalysisResults.erase({IDAndResult.first, &IR});
759 AnalysisResultLists.erase(ResultsListI);
769 AnalysisResults.clear();
770 AnalysisResultLists.clear();
776 template <
typename PassT>
777 typename PassT::Result &
getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs) {
779 "This analysis pass was not registered prior to being queried");
781 getResultImpl(
PassT::ID(), IR, ExtraArgs...);
785 PreservedAnalyses, Invalidator>;
787 return static_cast<ResultModelT &
>(ResultConcept).Result;
795 template <
typename PassT>
798 "This analysis pass was not registered prior to being queried");
806 PreservedAnalyses, Invalidator>;
808 return &
static_cast<ResultModelT *
>(ResultConcept)->Result;
828 template <
typename PassBuilderT>
833 Invalidator, ExtraArgTs...>;
835 auto &PassPtr = AnalysisPasses[
PassT::ID()];
851 "This analysis pass was not registered prior to being invalidated");
865 dbgs() <<
"Invalidating all non-preserved analyses for: " << IR.getName()
871 Invalidator Inv(IsResultInvalidated, AnalysisResults);
872 AnalysisResultListT &ResultsList = AnalysisResultLists[&
IR];
873 for (
auto &AnalysisResultPair : ResultsList) {
879 auto &Result = *AnalysisResultPair.second;
881 auto IMapI = IsResultInvalidated.
find(ID);
882 if (IMapI != IsResultInvalidated.
end())
892 IsResultInvalidated.
insert({
ID, Result.invalidate(IR, PA, Inv)})
895 assert(Inserted &&
"Should never have already inserted this ID, likely " 896 "indicates a cycle!");
900 if (!IsResultInvalidated.
empty()) {
901 for (
auto I = ResultsList.begin(),
E = ResultsList.end();
I !=
E;) {
903 if (!IsResultInvalidated.
lookup(ID)) {
909 dbgs() <<
"Invalidating analysis: " << this->lookUpPass(ID).name()
910 <<
" on " << IR.getName() <<
"\n";
912 I = ResultsList.erase(
I);
913 AnalysisResults.erase({
ID, &IR});
917 if (ResultsList.empty())
918 AnalysisResultLists.erase(&IR);
925 assert(PI != AnalysisPasses.end() &&
926 "Analysis passes must be registered prior to being queried!");
933 assert(PI != AnalysisPasses.end() &&
934 "Analysis passes must be registered prior to being queried!");
940 ExtraArgTs... ExtraArgs) {
941 typename AnalysisResultMapT::iterator RI;
943 std::tie(RI, Inserted) = AnalysisResults.insert(std::make_pair(
944 std::make_pair(ID, &IR),
typename AnalysisResultListT::iterator()));
949 auto &
P = this->lookUpPass(ID);
951 dbgs() <<
"Running analysis: " <<
P.name() <<
" on " << IR.getName()
956 PI = getResult<PassInstrumentationAnalysis>(
IR, ExtraArgs...);
960 AnalysisResultListT &ResultList = AnalysisResultLists[&
IR];
961 ResultList.emplace_back(ID,
P.run(IR, *
this, ExtraArgs...));
967 RI = AnalysisResults.find({
ID, &IR});
968 assert(RI != AnalysisResults.end() &&
"we just inserted it!");
970 RI->second = std::prev(ResultList.end());
973 return *RI->second->second;
978 typename AnalysisResultMapT::const_iterator RI =
979 AnalysisResults.find({
ID, &IR});
980 return RI == AnalysisResults.end() ? nullptr : &*RI->second->second;
984 void invalidateImpl(
AnalysisKey *ID, IRUnitT &IR) {
985 typename AnalysisResultMapT::iterator RI =
986 AnalysisResults.find({
ID, &IR});
987 if (RI == AnalysisResults.end())
991 dbgs() <<
"Invalidating analysis: " << this->lookUpPass(ID).name()
992 <<
" on " << IR.getName() <<
"\n";
993 AnalysisResultLists[&
IR].erase(RI->second);
994 AnalysisResults.erase(RI);
1012 AnalysisResultMapT AnalysisResults;
1044 template <
typename AnalysisManagerT,
typename IRUnitT,
typename... ExtraArgTs>
1047 InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT>> {
1051 explicit Result(AnalysisManagerT &InnerAM) : InnerAM(&InnerAM) {}
1057 Arg.InnerAM =
nullptr;
1071 InnerAM = RHS.InnerAM;
1075 RHS.InnerAM =
nullptr;
1093 IRUnitT &IR,
const PreservedAnalyses &PA,
1097 AnalysisManagerT *InnerAM;
1101 : InnerAM(&InnerAM) {}
1119 AnalysisManagerT *InnerAM;
1122 template <
typename AnalysisManagerT,
typename IRUnitT,
typename... ExtraArgTs>
1134 Module &M,
const PreservedAnalyses &PA,
1160 template <
typename AnalysisManagerT,
typename IRUnitT,
typename... ExtraArgTs>
1163 OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>> {
1168 explicit Result(
const AnalysisManagerT &OuterAM) : OuterAM(&OuterAM) {}
1174 IRUnitT &IRUnit,
const PreservedAnalyses &PA,
1179 for (
auto &KeyValuePair : OuterAnalysisInvalidationMap) {
1181 auto &InnerIDs = KeyValuePair.second;
1183 return Inv.
invalidate(InnerID, IRUnit, PA); }),
1185 if (InnerIDs.empty())
1189 for (
auto OuterID : DeadKeys)
1190 OuterAnalysisInvalidationMap.erase(OuterID);
1198 template <
typename OuterAnalysisT,
typename Inval
idatedAnalysisT>
1203 auto &InvalidatedIDList = OuterAnalysisInvalidationMap[OuterID];
1208 auto InvalidatedIt =
std::find(InvalidatedIDList.begin(),
1209 InvalidatedIDList.end(), InvalidatedID);
1210 if (InvalidatedIt == InvalidatedIDList.end())
1211 InvalidatedIDList.push_back(InvalidatedID);
1218 return OuterAnalysisInvalidationMap;
1222 const AnalysisManagerT *OuterAM;
1227 OuterAnalysisInvalidationMap;
1231 : OuterAM(&OuterAM) {}
1247 const AnalysisManagerT *OuterAM;
1250 template <
typename AnalysisManagerT,
typename IRUnitT,
typename... ExtraArgTs>
1283 template <
typename FunctionPassT>
1285 :
public PassInfoMixin<ModuleToFunctionPassAdaptor<FunctionPassT>> {
1288 : Pass(
std::move(Pass)) {}
1291 PreservedAnalyses
run(Module &M, ModuleAnalysisManager &AM) {
1292 FunctionAnalysisManager &FAM =
1300 for (Function &
F : M) {
1301 if (
F.isDeclaration())
1309 PreservedAnalyses PassPA =
Pass.run(
F, FAM);
1320 PA.intersect(std::move(PassPA));
1339 template <
typename FunctionPassT>
1354 template <
typename AnalysisT,
typename IRUnitT,
1356 typename... ExtraArgTs>
1358 :
PassInfoMixin<RequireAnalysisPass<AnalysisT, IRUnitT, AnalysisManagerT,
1366 PreservedAnalyses
run(IRUnitT &
Arg, AnalysisManagerT &AM,
1367 ExtraArgTs &&...
Args) {
1368 (void)AM.template getResult<AnalysisT>(Arg,
1369 std::forward<ExtraArgTs>(
Args)...);
1377 template <
typename AnalysisT>
1386 template <
typename IRUnitT,
typename AnalysisManagerT,
typename... ExtraArgTs>
1387 PreservedAnalyses
run(IRUnitT &
Arg, AnalysisManagerT &AM, ExtraArgTs &&...) {
1400 template <
typename IRUnitT,
typename AnalysisManagerT,
typename... ExtraArgTs>
1401 PreservedAnalyses
run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...) {
1410 template <
typename PassT>
1415 template <
typename IRUnitT,
typename AnalysisManagerT,
typename... Ts>
1416 PreservedAnalyses
run(IRUnitT &IR, AnalysisManagerT &AM, Ts &&...
Args) {
1423 detail::getAnalysisResult<PassInstrumentationAnalysis>(
1424 AM,
IR, std::tuple<Ts...>(
Args...));
1427 for (
int i = 0; i < Count; ++i) {
1433 PA.intersect(
P.run(IR, AM, std::forward<Ts>(
Args)...));
1444 template <
typename PassT>
1451 #endif // LLVM_IR_PASSMANAGER_H Pass interface - Implemented by all 'passes'.
void abandon()
Mark an analysis as abandoned.
bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Trigger the invalidation of some other analysis pass if not already handled and return whether it was...
Wrapper to model the analysis pass concept.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
This class represents lattice values for constants.
void intersect(const PreservedAnalyses &Arg)
Intersect this set with another in place.
Trivial adaptor that maps from a module to its functions.
A Module instance is used to store all the information related to an LLVM module. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
bool invalidate(IRUnitT &IRUnit, const PreservedAnalyses &PA, typename AnalysisManager< IRUnitT, ExtraArgTs... >::Invalidator &Inv)
When invalidation occurs, remove any registered invalidation events.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
void clear(IRUnitT &IR, llvm::StringRef Name)
Clear any cached analysis results for a single unit of IR.
void push_back(const T &Elt)
PassManager(bool DebugLogging=false)
Construct a pass manager.
bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA, typename AnalysisManager< IRUnitT, ExtraArgTs... >::Invalidator &Inv)
Handler for invalidation of the outer IR unit, IRUnitT.
RepeatedPass< PassT > createRepeatedPass(int Count, PassT P)
RepeatedPass(int Count, PassT P)
Function Alias Analysis Results
Template for the abstract base class used to dispatch polymorphically over pass objects.
A utility pass template that simply runs another pass multiple times.
PassT::Result getAnalysisResult(AnalysisManager< IRUnitT, AnalysisArgTs... > &AM, IRUnitT &IR, std::tuple< MainArgTs... > Args)
Helper for partial unpacking of extra arguments in getAnalysisResult.
A utility pass template to force an analysis result to be available.
PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs... ExtraArgs)
Run all of the passes in this manager over the given unit of IR.
Abstract concept of an analysis pass.
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
bool preservedWhenStateless()
Return true if the checker's analysis was not abandoned, i.e.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
LLVM_NODISCARD StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
static AnalysisKey * ID()
Returns an opaque, unique ID for this analysis type.
bool registerPass(PassBuilderT &&PassBuilder)
Register an analysis pass with the manager.
This class provides access to building LLVM's passes.
PassT::Result 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 m...
AnalysisManagerT & getManager()
Accessor for the analysis manager.
bool empty() const
Returns true if the analysis manager has an empty results cache.
PassManager(PassManager &&Arg)
AnalysisManager(bool DebugLogging=false)
Construct an empty analysis manager.
A CRTP mix-in to automatically provide informational APIs needed for passes.
This file defines the Pass Instrumentation classes that provide instrumentation points into the pass ...
bool runBeforePass(const PassT &Pass, const IRUnitT &IR) const
BeforePass instrumentation point - takes Pass instance to be executed and constant reference to IR it...
void registerOuterAnalysisInvalidation()
Register a deferred invalidation event for when the outer analysis manager processes its invalidation...
static PreservedAnalyses allInSet()
Construct a preserved analyses object with a single preserved set.
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(adl_begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
iterator find(const_arg_type_t< KeyT > Val)
A checker object that makes it easy to query for whether an analysis or some set covering it is prese...
Result run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...)
A set of analyses that are preserved following a run of a transformation pass.
bool areAllPreserved() const
Test whether all analyses are preserved (and none are abandoned).
InnerAnalysisManagerProxy(AnalysisManagerT &InnerAM)
ModuleToFunctionPassAdaptor< FunctionPassT > createModuleToFunctionPassAdaptor(FunctionPassT Pass)
A function to deduce a function pass type and wrap it in the templated adaptor.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
A CRTP mix-in that provides informational APIs needed for analysis passes.
Wrapper to model the analysis result concept.
LLVM_NODISCARD size_t find(char C, size_t From=0) const
Search for the first character C in the string.
bool preservedSet()
Returns true if the checker's analysis was not abandoned and either.
PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM, Ts &&... Args)
void clear()
Clear all analysis results cached by this AnalysisManager.
PreservedAnalyses run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...)
Run this pass over some unit of IR.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
static StringRef name()
Gets the name of the pass we are mixed into.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
auto remove_if(R &&Range, UnaryPredicate P) -> decltype(adl_begin(Range))
Provide wrappers to std::remove_if which take ranges instead of having to pass begin/end explicitly...
PreservedAnalysisChecker getChecker(AnalysisKey *ID) const
Build a checker for this PreservedAnalyses and the specified analysis ID.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
void intersect(PreservedAnalyses &&Arg)
Intersect this set with a temporary other set in place.
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
PassManager & operator=(PassManager &&RHS)
Result proxy object for OuterAnalysisManagerProxy.
ModuleToFunctionPassAdaptor(FunctionPassT Pass)
Pseudo-analysis pass that exposes the PassInstrumentation to pass managers.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
print lazy value Lazy Value Info Printer Pass
static AnalysisSetKey * ID()
void runAfterPass(const PassT &Pass, const IRUnitT &IR) const
AfterPass instrumentation point - takes Pass instance that has just been executed and constant refere...
An analysis over an "inner" IR unit that provides access to an analysis manager over a "outer" IR uni...
A template wrapper used to implement the polymorphic API.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
Result run(IRUnitT &IR, AnalysisManager< IRUnitT, ExtraArgTs... > &AM, ExtraArgTs...)
Run the analysis pass and create our proxy result object.
void invalidate(IRUnitT &IR)
Invalidate a specific analysis pass for an IR module.
Abstract concept of an analysis result.
A utility pass that does nothing, but preserves no analyses.
Result run(IRUnitT &, AnalysisManager< IRUnitT, ExtraArgTs... > &, ExtraArgTs...)
Run the analysis pass and create our proxy result object.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Result(AnalysisManagerT &InnerAM)
OuterAnalysisManagerProxy(const AnalysisManagerT &OuterAM)
static AnalysisSetKey * ID()
This header provides internal APIs and implementation details used by the pass management interfaces ...
Represents analyses that only rely on functions' control flow.
bool allAnalysesInSetPreserved(AnalysisSetKey *SetID) const
Directly test whether a set of analyses is preserved.
void abandon(AnalysisKey *ID)
Mark an analysis as abandoned using its ID.
Result & operator=(Result &&RHS)
void preserveSet(AnalysisSetKey *ID)
Mark an analysis set as preserved using its ID.
A special type used to provide an address that identifies a set of related analyses.
Manages a sequence of passes over a particular unit of IR.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Runs the function pass across every function in the module.
void preserveSet()
Mark an analysis set as preserved.
PassT::Result * getCachedResult(IRUnitT &IR) const
Get the cached result of an analysis pass for a given IR unit.
void preserve()
Mark an analysis as preserved.
PreservedAnalyses run(IRUnitT &Arg, AnalysisManagerT &AM, ExtraArgTs &&... Args)
Run this pass over some unit of IR.
A no-op pass template which simply forces a specific analysis result to be invalidated.
LLVM_NODISCARD bool empty() const
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
API to communicate dependencies between analyses during invalidation.
bool invalidate(AnalysisKey *ID, IRUnitT &IR, const PreservedAnalyses &PA)
A type-erased variant of the above invalidate method with the same core API other than passing an ana...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This templated class represents "all analyses that operate over <a particular IR unit>" (e...
void runBeforeAnalysis(const PassT &Analysis, const IRUnitT &IR) const
BeforeAnalysis instrumentation point - takes Analysis instance to be executed and constant reference ...
PassInstrumentationAnalysis(PassInstrumentationCallbacks *Callbacks=nullptr)
PassInstrumentationCallbacks object is shared, owned by something else, not this analysis.
void preserve(AnalysisKey *ID)
Given an analysis's ID, mark the analysis as preserved, adding it to the set.
bool preserved()
Returns true if the checker's analysis was not abandoned and either.
Result(const AnalysisManagerT &OuterAM)
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
StringRef - Represent a constant reference to a string, i.e.
A container for analyses that lazily runs them and caches their results.
This class provides instrumentation entry points for the Pass Manager, doing calls to callbacks regis...
const SmallDenseMap< AnalysisKey *, TinyPtrVector< AnalysisKey * >, 2 > & getOuterInvalidations() const
Access the map from outer analyses to deferred invalidation requiring analyses.
PreservedAnalyses run(IRUnitT &Arg, AnalysisManagerT &AM, ExtraArgTs &&...)
Run this pass over some unit of IR.
void invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Invalidate cached analyses for an IR unit.
const AnalysisManagerT & getManager() const
A special type used by analysis passes to provide an address that identifies that particular analysis...
Statically lint checks LLVM IR
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
bool allAnalysesInSetPreserved() const
Directly test whether a set of analyses is preserved.
void runAfterAnalysis(const PassT &Analysis, const IRUnitT &IR) const
AfterAnalysis instrumentation point - takes Analysis instance that has just been executed and constan...
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...