19 #ifndef LLVM_PASSANALYSISSUPPORT_H 20 #define LLVM_PASSANALYSISSUPPORT_H 56 bool PreservesAll =
false;
65 template<
class PassClass>
71 template<
class PassClass>
88 template<
class PassClass>
107 template<
class PassClass>
137 return RequiredTransitive;
157 Pass *ResultPass =
nullptr;
158 for (
const auto &AnalysisImpl : AnalysisImpls) {
159 if (AnalysisImpl.first == PI) {
160 ResultPass = AnalysisImpl.second;
171 if (findImplPass(PI) == P)
173 std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,P);
174 AnalysisImpls.push_back(pir);
179 AnalysisImpls.clear();
188 std::vector<std::pair<AnalysisID, Pass *>> AnalysisImpls;
201 template<
typename AnalysisType>
207 Pass *ResultPass =
Resolver->getAnalysisIfAvailable(PI,
true);
208 if (!ResultPass)
return nullptr;
220 template<
typename AnalysisType>
222 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
226 template<
typename AnalysisType>
228 assert(PI &&
"getAnalysis for unregistered pass!");
229 assert(
Resolver&&
"Pass has not been inserted into a PassManager object!");
235 "getAnalysis*() called on an analysis that was not " 236 "'required' by pass!");
248 template<
typename AnalysisType>
250 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
255 template<
typename AnalysisType>
257 assert(PI &&
"getAnalysis for unregistered pass!");
258 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
263 assert(ResultPass &&
"Unable to find requested analysis info");
274 #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.
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
amdgpu Simplify well known AMD library false Value Value * Arg
PMDataManager & getPMDataManager()
AnalysisUsage & addRequiredTransitiveID(char &ID)
AnalysisUsage & addRequiredTransitive()
PMDataManager provides the common place to manage the analysis data used by pass managers.
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.