30 for (
const auto &
F : M) {
31 if (
F.isDeclaration() || !
F.hasGC())
44 auto &Map = R.StrategyMap;
46 if (
F.isDeclaration() || !
F.hasGC())
48 if (
auto GCName =
F.getGC(); !Map.contains(GCName))
58 assert(!
F.isDeclaration() &&
"Can only get GCFunctionInfo for a definition!");
59 assert(
F.hasGC() &&
"Function doesn't have GC!");
64 "This pass need module analysis `collector-metadata`!");
73 "Create Garbage Collector Module Metadata",
false,
false)
78 :
F(
F), S(S), FrameSize(~0LL) {}
97 assert(!
F.isDeclaration() &&
"Can only get GCFunctionInfo for a definition!");
101 if (
I != FInfoMap.
end())
105 Functions.push_back(std::make_unique<GCFunctionInfo>(
F, *S));
114 GCStrategyList.clear();
123 return NMI->getValue();
126 S->Name = std::string(
Name);
128 GCStrategyList.push_back(std::move(S));
129 return GCStrategyList.back().get();
Analysis containing CSE Info
Module.h This file contains the declarations for the Module class.
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This templated class represents "all analyses that operate over <a particular IR unit>" (e....
API to communicate dependencies between analyses during invalidation.
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
iterator find(const_arg_type_t< KeyT > Val)
An analysis pass which caches information about the Function.
Result run(Function &F, FunctionAnalysisManager &FAM)
Garbage collection metadata for a single function.
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
Handle invalidation explicitly.
An analysis pass which caches information about the entire Module.
GCFunctionInfo & getFunctionInfo(const Function &F)
get - Look up function metadata.
void clear()
clear - Resets the pass.
GCStrategy * getGCStrategy(const StringRef Name)
Lookup the GCStrategy object associated with the given gc name.
GCStrategy describes a garbage collector algorithm's code generation requirements,...
ImmutablePass class - This class is used to provide information that does not need to be run.
A Module instance is used to store all the information related to an LLVM module.
An analysis over an "inner" IR unit that provides access to an analysis manager over a "outer" IR uni...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A set of analyses that are preserved following a run of a transformation pass.
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
void initializeGCModuleInfoPass(PassRegistry &)
std::unique_ptr< GCStrategy > getGCStrategy(const StringRef Name)
Lookup the GCStrategy object associated with the given gc name.
A special type used by analysis passes to provide an address that identifies that particular analysis...
bool invalidate(Module &M, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &Inv)
Handle invalidation explicitly.
StringMap< std::unique_ptr< GCStrategy > > StrategyMap