38 #ifndef LLVM_IR_PASSMANAGER_H 39 #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));
295 return !IsAbandoned && (PA.PreservedIDs.
count(&AllAnalysesKey) ||
296 PA.PreservedIDs.
count(SetID));
323 return NotPreservedAnalysisIDs.empty() &&
324 PreservedIDs.count(&AllAnalysesKey);
338 return NotPreservedAnalysisIDs.empty() &&
339 (PreservedIDs.count(&AllAnalysesKey) || PreservedIDs.count(SetID));
360 template <
typename IRUnitT,
typename... ExtraArgTs>
class AnalysisManager;
369 static_assert(std::is_base_of<PassInfoMixin, DerivedT>::value,
370 "Must pass the derived type as the template argument!");
382 template <
typename DerivedT>
400 static_assert(std::is_base_of<AnalysisInfoMixin, DerivedT>::value,
401 "Must pass the derived type as the template argument!");
410 template <
typename PassT,
typename IRUnitT,
typename AnalysisManagerT,
411 typename... ArgTs,
size_t... Ns>
412 typename PassT::Result
414 std::tuple<ArgTs...>
Args,
417 return AM.template getResult<PassT>(
IR, std::get<Ns>(
Args)...);
425 template <
typename PassT,
typename IRUnitT,
typename... AnalysisArgTs,
426 typename... MainArgTs>
427 typename PassT::Result
429 std::tuple<MainArgTs...>
Args) {
431 PassT, IRUnitT>)(AM,
IR,
Args,
455 template <
typename IRUnitT,
457 typename... ExtraArgTs>
459 PassManager<IRUnitT, AnalysisManagerT, ExtraArgTs...>> {
464 explicit PassManager(
bool DebugLogging =
false) : DebugLogging(DebugLogging) {}
471 : Passes(
std::move(
Arg.Passes)),
472 DebugLogging(
std::move(
Arg.DebugLogging)) {}
475 Passes = std::move(RHS.Passes);
476 DebugLogging = std::move(RHS.DebugLogging);
483 ExtraArgTs... ExtraArgs) {
491 detail::getAnalysisResult<PassInstrumentationAnalysis>(
492 AM,
IR, std::tuple<ExtraArgTs...>(ExtraArgs...));
495 dbgs() <<
"Starting " << getTypeName<IRUnitT>() <<
" pass manager run.\n";
497 for (
unsigned Idx = 0,
Size = Passes.size(); Idx !=
Size; ++Idx) {
498 auto *
P = Passes[Idx].get();
500 dbgs() <<
"Running pass: " <<
P->name() <<
" on " << IR.getName()
517 AM.invalidate(IR, PassPA);
537 dbgs() <<
"Finished " << getTypeName<IRUnitT>() <<
" pass manager run.\n";
547 Passes.emplace_back(
new PassModelT(std::move(Pass)));
554 std::vector<std::unique_ptr<PassConceptT>> Passes;
586 : Callbacks(Callbacks) {}
590 template <
typename IRUnitT,
typename AnalysisManagerT,
typename... ExtraArgTs>
591 Result run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...) {
601 template <
typename IRUnitT,
typename... ExtraArgTs>
class AnalysisManager {
607 using ResultConceptT =
619 using AnalysisResultListT =
620 std::list<std::pair<AnalysisKey *, std::unique_ptr<ResultConceptT>>>;
628 using AnalysisResultMapT =
630 typename AnalysisResultListT::iterator>;
659 template <
typename PassT>
663 PreservedAnalyses, Invalidator>;
665 return invalidateImpl<ResultModelT>(
PassT::ID(),
IR, PA);
675 return invalidateImpl<>(
ID,
IR, PA);
681 template <
typename ResultT = ResultConceptT>
683 const PreservedAnalyses &PA) {
686 auto IMapI = IsResultInvalidated.find(ID);
687 if (IMapI != IsResultInvalidated.end())
688 return IMapI->second;
691 auto RI =
Results.find({ID, &IR});
693 "Trying to invalidate a dependent result that isn't in the " 694 "manager's cache is always an error, likely due to a stale result " 697 auto &Result =
static_cast<ResultT &
>(*RI->second->second);
704 std::tie(IMapI, Inserted) =
705 IsResultInvalidated.insert({
ID, Result.invalidate(IR, PA, *
this)});
707 assert(Inserted &&
"Should not have already inserted this ID, likely " 708 "indicates a dependency cycle!");
709 return IMapI->second;
713 const AnalysisResultMapT &
Results)
714 : IsResultInvalidated(IsResultInvalidated), Results(Results) {}
717 const AnalysisResultMapT &
Results;
729 assert(AnalysisResults.empty() == AnalysisResultLists.empty() &&
730 "The storage and index of analysis results disagree on how many " 732 return AnalysisResults.empty();
742 dbgs() <<
"Clearing all analysis results for: " << Name <<
"\n";
744 auto ResultsListI = AnalysisResultLists.
find(&IR);
745 if (ResultsListI == AnalysisResultLists.end())
748 for (
auto &IDAndResult : ResultsListI->second)
749 AnalysisResults.erase({IDAndResult.first, &IR});
752 AnalysisResultLists.erase(ResultsListI);
762 AnalysisResults.clear();
763 AnalysisResultLists.clear();
769 template <
typename PassT>
770 typename PassT::Result &
getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs) {
772 "This analysis pass was not registered prior to being queried");
774 getResultImpl(
PassT::ID(), IR, ExtraArgs...);
778 PreservedAnalyses, Invalidator>;
780 return static_cast<ResultModelT &
>(ResultConcept).Result;
788 template <
typename PassT>
791 "This analysis pass was not registered prior to being queried");
799 PreservedAnalyses, Invalidator>;
801 return &
static_cast<ResultModelT *
>(ResultConcept)->Result;
821 template <
typename PassBuilderT>
826 Invalidator, ExtraArgTs...>;
828 auto &PassPtr = AnalysisPasses[
PassT::ID()];
844 "This analysis pass was not registered prior to being invalidated");
858 dbgs() <<
"Invalidating all non-preserved analyses for: " << IR.getName()
864 Invalidator Inv(IsResultInvalidated, AnalysisResults);
865 AnalysisResultListT &ResultsList = AnalysisResultLists[&
IR];
866 for (
auto &AnalysisResultPair : ResultsList) {
872 auto &Result = *AnalysisResultPair.second;
874 auto IMapI = IsResultInvalidated.
find(ID);
875 if (IMapI != IsResultInvalidated.
end())
885 IsResultInvalidated.
insert({
ID, Result.invalidate(IR, PA, Inv)})
888 assert(Inserted &&
"Should never have already inserted this ID, likely " 889 "indicates a cycle!");
893 if (!IsResultInvalidated.
empty()) {
894 for (
auto I = ResultsList.begin(),
E = ResultsList.end();
I !=
E;) {
896 if (!IsResultInvalidated.
lookup(ID)) {
902 dbgs() <<
"Invalidating analysis: " << this->lookUpPass(ID).name()
903 <<
" on " << IR.getName() <<
"\n";
905 I = ResultsList.erase(
I);
906 AnalysisResults.erase({
ID, &IR});
910 if (ResultsList.empty())
911 AnalysisResultLists.erase(&IR);
918 assert(PI != AnalysisPasses.end() &&
919 "Analysis passes must be registered prior to being queried!");
926 assert(PI != AnalysisPasses.end() &&
927 "Analysis passes must be registered prior to being queried!");
933 ExtraArgTs... ExtraArgs) {
934 typename AnalysisResultMapT::iterator RI;
936 std::tie(RI, Inserted) = AnalysisResults.insert(std::make_pair(
937 std::make_pair(ID, &IR),
typename AnalysisResultListT::iterator()));
942 auto &
P = this->lookUpPass(ID);
944 dbgs() <<
"Running analysis: " <<
P.name() <<
" on " << IR.getName()
949 PI = getResult<PassInstrumentationAnalysis>(
IR, ExtraArgs...);
953 AnalysisResultListT &ResultList = AnalysisResultLists[&
IR];
954 ResultList.emplace_back(ID,
P.run(IR, *
this, ExtraArgs...));
960 RI = AnalysisResults.find({
ID, &IR});
961 assert(RI != AnalysisResults.end() &&
"we just inserted it!");
963 RI->second = std::prev(ResultList.end());
966 return *RI->second->second;
971 typename AnalysisResultMapT::const_iterator RI =
972 AnalysisResults.find({
ID, &IR});
973 return RI == AnalysisResults.end() ? nullptr : &*RI->second->second;
977 void invalidateImpl(
AnalysisKey *ID, IRUnitT &IR) {
978 typename AnalysisResultMapT::iterator RI =
979 AnalysisResults.find({
ID, &IR});
980 if (RI == AnalysisResults.end())
984 dbgs() <<
"Invalidating analysis: " << this->lookUpPass(ID).name()
985 <<
" on " << IR.getName() <<
"\n";
986 AnalysisResultLists[&
IR].erase(RI->second);
987 AnalysisResults.erase(RI);
1005 AnalysisResultMapT AnalysisResults;
1037 template <
typename AnalysisManagerT,
typename IRUnitT,
typename... ExtraArgTs>
1040 InnerAnalysisManagerProxy<AnalysisManagerT, IRUnitT>> {
1044 explicit Result(AnalysisManagerT &InnerAM) : InnerAM(&InnerAM) {}
1050 Arg.InnerAM =
nullptr;
1064 InnerAM = RHS.InnerAM;
1068 RHS.InnerAM =
nullptr;
1086 IRUnitT &IR,
const PreservedAnalyses &PA,
1090 AnalysisManagerT *InnerAM;
1094 : InnerAM(&InnerAM) {}
1112 AnalysisManagerT *InnerAM;
1115 template <
typename AnalysisManagerT,
typename IRUnitT,
typename... ExtraArgTs>
1127 Module &M,
const PreservedAnalyses &PA,
1153 template <
typename AnalysisManagerT,
typename IRUnitT,
typename... ExtraArgTs>
1156 OuterAnalysisManagerProxy<AnalysisManagerT, IRUnitT, ExtraArgTs...>> {
1161 explicit Result(
const AnalysisManagerT &AM) : AM(&AM) {}
1167 IRUnitT &IRUnit,
const PreservedAnalyses &PA,
1172 for (
auto &KeyValuePair : OuterAnalysisInvalidationMap) {
1174 auto &InnerIDs = KeyValuePair.second;
1176 return Inv.
invalidate(InnerID, IRUnit, PA); }),
1178 if (InnerIDs.empty())
1182 for (
auto OuterID : DeadKeys)
1183 OuterAnalysisInvalidationMap.erase(OuterID);
1191 template <
typename OuterAnalysisT,
typename Inval
idatedAnalysisT>
1196 auto &InvalidatedIDList = OuterAnalysisInvalidationMap[OuterID];
1201 auto InvalidatedIt =
std::find(InvalidatedIDList.begin(),
1202 InvalidatedIDList.end(), InvalidatedID);
1203 if (InvalidatedIt == InvalidatedIDList.end())
1204 InvalidatedIDList.push_back(InvalidatedID);
1211 return OuterAnalysisInvalidationMap;
1215 const AnalysisManagerT *AM;
1220 OuterAnalysisInvalidationMap;
1239 const AnalysisManagerT *AM;
1242 template <
typename AnalysisManagerT,
typename IRUnitT,
typename... ExtraArgTs>
1275 template <
typename FunctionPassT>
1277 :
public PassInfoMixin<ModuleToFunctionPassAdaptor<FunctionPassT>> {
1280 : Pass(
std::move(Pass)) {}
1283 PreservedAnalyses
run(Module &M, ModuleAnalysisManager &AM) {
1284 FunctionAnalysisManager &FAM =
1292 for (Function &
F : M) {
1293 if (
F.isDeclaration())
1301 PreservedAnalyses PassPA =
Pass.run(
F, FAM);
1312 PA.intersect(std::move(PassPA));
1331 template <
typename FunctionPassT>
1346 template <
typename AnalysisT,
typename IRUnitT,
1348 typename... ExtraArgTs>
1350 :
PassInfoMixin<RequireAnalysisPass<AnalysisT, IRUnitT, AnalysisManagerT,
1358 PreservedAnalyses
run(IRUnitT &
Arg, AnalysisManagerT &AM,
1359 ExtraArgTs &&...
Args) {
1360 (void)AM.template getResult<AnalysisT>(Arg,
1361 std::forward<ExtraArgTs>(
Args)...);
1369 template <
typename AnalysisT>
1378 template <
typename IRUnitT,
typename AnalysisManagerT,
typename... ExtraArgTs>
1379 PreservedAnalyses
run(IRUnitT &
Arg, AnalysisManagerT &AM, ExtraArgTs &&...) {
1392 template <
typename IRUnitT,
typename AnalysisManagerT,
typename... ExtraArgTs>
1393 PreservedAnalyses
run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...) {
1402 template <
typename PassT>
1407 template <
typename IRUnitT,
typename AnalysisManagerT,
typename... Ts>
1408 PreservedAnalyses
run(IRUnitT &IR, AnalysisManagerT &AM, Ts &&...
Args) {
1415 detail::getAnalysisResult<PassInstrumentationAnalysis>(
1416 AM,
IR, std::tuple<Ts...>(
Args...));
1419 for (
int i = 0; i < Count; ++i) {
1425 PA.intersect(
P.run(IR, AM, std::forward<Ts>(
Args)...));
1436 template <
typename PassT>
1443 #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. ...
bool invalidate(IRUnitT &IRUnit, const PreservedAnalyses &PA, typename AnalysisManager< IRUnitT, ExtraArgTs... >::Invalidator &Inv)
When invalidation occurs, remove any registered invalidation events.
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.
OuterAnalysisManagerProxy(const AnalysisManagerT &AM)
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.
Alias for the common case of a sequence of size_ts.
AnalysisManagerT & getManager()
Accessor for the analysis manager.
bool empty() const
Returns true if the analysis manager has an empty results cache.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
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")
PassT::Result getAnalysisResultUnpackTuple(AnalysisManagerT &AM, IRUnitT &IR, std::tuple< ArgTs... > Args, llvm::index_sequence< Ns... >)
Actual unpacker of extra arguments in getAnalysisResult, passes only those tuple arguments that are m...
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.
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.
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.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
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.
Creates a compile-time integer sequence for a parameter pack.
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)
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.
amdgpu Simplify well known AMD library false Value Value * Arg
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 &AM)
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.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find(char C, size_t From=0) const
Search for the first character C in the string.
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...