18 #ifndef LLVM_PASSANALYSISSUPPORT_H 19 #define LLVM_PASSANALYSISSUPPORT_H 55 bool PreservesAll =
false;
64 template<
class PassClass>
70 template<
class PassClass>
87 template<
class PassClass>
106 template<
class PassClass>
136 return RequiredTransitive;
156 Pass *ResultPass =
nullptr;
157 for (
const auto &AnalysisImpl : AnalysisImpls) {
158 if (AnalysisImpl.first == PI) {
159 ResultPass = AnalysisImpl.second;
170 if (findImplPass(PI) == P)
172 std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
173 AnalysisImpls.push_back(pir);
178 AnalysisImpls.clear();
187 std::vector<std::pair<AnalysisID, Pass *>> AnalysisImpls;
200 template<
typename AnalysisType>
206 Pass *ResultPass =
Resolver->getAnalysisIfAvailable(PI,
true);
207 if (!ResultPass)
return nullptr;
219 template<
typename AnalysisType>
221 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
225 template<
typename AnalysisType>
227 assert(PI &&
"getAnalysis for unregistered pass!");
228 assert(
Resolver&&
"Pass has not been inserted into a PassManager object!");
234 "getAnalysis*() called on an analysis that was not " 235 "'required' by pass!");
247 template<
typename AnalysisType>
249 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
254 template<
typename AnalysisType>
256 assert(PI &&
"getAnalysis for unregistered pass!");
257 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
262 assert(ResultPass &&
"Unable to find requested analysis info");
273 #endif // LLVM_PASSANALYSISSUPPORT_H Pass interface - Implemented by all 'passes'.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
This class represents lattice values for constants.
void push_back(const T &Elt)
const VectorType & getUsedSet() const
const VectorType & getRequiredSet() const
AnalysisResolver - Simple interface used by Pass objects to pull all analysis information out of pass...
AnalysisUsage & addRequired()
AnalysisUsage & addPreservedID(char &ID)
const VectorType & getPreservedSet() const
AnalysisUsage & addUsedIfAvailableID(char &ID)
AnalysisUsage & addPreservedID(const void *ID)
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
AnalysisResolver(PMDataManager &P)
AnalysisType & getAnalysisID(AnalysisID PI) const
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Represent the analysis usage information of a pass.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
AnalysisUsage & addUsedIfAvailableID(const void *ID)
print lazy value Lazy Value Info Printer Pass
AnalysisUsage & addRequiredID(const void *ID)
void addAnalysisImplsPair(AnalysisID PI, Pass *P)
void setPreservesCFG()
This function should be called by the pass, iff they do not:
void clearAnalysisImpls()
Clear cache that is used to connect a pass to the analysis (PassInfo).
Pass * findImplPass(AnalysisID PI)
Find pass that is implementing PI.
void setPreservesAll()
Set by analyses that do not transform their input at all.
const VectorType & getRequiredTransitiveSet() const
PMDataManager & getPMDataManager()
AnalysisUsage & addRequiredTransitiveID(char &ID)
AnalysisUsage & addRequiredTransitive()
PMDataManager provides the common place to manage the analysis data used by pass managers.
Loop::LoopBounds::Direction Direction
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AnalysisUsage & addUsedIfAvailable()
Add the specified Pass class to the set of analyses used by this pass.
AnalysisType * getAnalysisIfAvailable() const
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information tha...
virtual void * getAdjustedAnalysisPointer(AnalysisID ID)
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through...
StringRef - Represent a constant reference to a string, i.e.
bool getPreservesAll() const
Determine whether a pass said it does not transform its input at all.