Go to the documentation of this file.
18 #if !defined(LLVM_PASS_H) || defined(LLVM_PASSANALYSISSUPPORT_H)
19 #error "Do not include <PassAnalysisSupport.h>; include <Pass.h> instead"
22 #ifndef LLVM_PASSANALYSISSUPPORT_H
23 #define LLVM_PASSANALYSISSUPPORT_H
60 bool PreservesAll =
false;
74 template<
class PassClass>
80 template<
class PassClass>
89 pushUnique(Preserved,
ID);
93 pushUnique(Preserved, &
ID);
97 template<
class PassClass>
108 pushUnique(Used,
ID);
112 pushUnique(Used, &
ID);
116 template<
class PassClass>
146 return RequiredTransitive;
166 Pass *ResultPass =
nullptr;
167 for (
const auto &AnalysisImpl : AnalysisImpls) {
168 if (AnalysisImpl.first == PI) {
169 ResultPass = AnalysisImpl.second;
182 std::pair<AnalysisID, Pass*> pir = std::make_pair(PI,
P);
183 AnalysisImpls.push_back(pir);
188 AnalysisImpls.clear();
197 std::vector<std::pair<AnalysisID, Pass *>> AnalysisImpls;
210 template<
typename AnalysisType>
216 Pass *ResultPass =
Resolver->getAnalysisIfAvailable(PI);
217 if (!ResultPass)
return nullptr;
229 template<
typename AnalysisType>
231 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
235 template<
typename AnalysisType>
237 assert(PI &&
"getAnalysis for unregistered pass!");
238 assert(
Resolver&&
"Pass has not been inserted into a PassManager object!");
244 "getAnalysis*() called on an analysis that was not "
245 "'required' by pass!");
259 template <
typename AnalysisType>
261 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
266 template <
typename AnalysisType>
268 assert(PI &&
"getAnalysis for unregistered pass!");
269 assert(
Resolver &&
"Pass has not been inserted into a PassManager object!");
275 std::tie(ResultPass, LocalChanged) =
Resolver->findImplPass(
this, PI,
F);
277 assert(ResultPass &&
"Unable to find requested analysis info");
279 *Changed |= LocalChanged;
282 "A pass trigged a code update but the update status is lost");
293 #endif // LLVM_PASSANALYSISSUPPORT_H
const VectorType & getRequiredTransitiveSet() const
This is an optimization pass for GlobalISel generic memory operations.
AnalysisType & getAnalysis() const
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information ...
print lazy value Lazy Value Info Printer Pass
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
virtual void * getAdjustedAnalysisPointer(AnalysisID ID)
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through...
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
PMDataManager provides the common place to manage the analysis data used by pass managers.
bool getPreservesAll() const
Determine whether a pass said it does not transform its input at all.
AnalysisUsage & addRequiredTransitiveID(char &ID)
AnalysisType * getAnalysisIfAvailable() const
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information tha...
const VectorType & getUsedSet() const
Represent the analysis usage information of a pass.
AnalysisResolver - Simple interface used by Pass objects to pull all analysis information out of pass...
AnalysisUsage & addUsedIfAvailableID(const void *ID)
AnalysisResolver()=delete
Pass * getAnalysisIfAvailable(AnalysisID ID) const
Return analysis result or null if it doesn't exist.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
const VectorType & getRequiredSet() const
void clearAnalysisImpls()
Clear cache that is used to connect a pass to the analysis (PassInfo).
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Pass * findImplPass(AnalysisID PI)
Find pass that is implementing PI.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AnalysisResolver(PMDataManager &P)
void setPreservesCFG()
This function should be called by the pass, iff they do not:
StringRef - Represent a constant reference to a string, i.e.
AnalysisUsage & addPreservedID(const void *ID)
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
void addAnalysisImplsPair(AnalysisID PI, Pass *P)
Pass interface - Implemented by all 'passes'.
PMDataManager & getPMDataManager()
const VectorType & getPreservedSet() const
AnalysisType & getAnalysisID(AnalysisID PI) const
AnalysisUsage & addRequiredTransitive()
AnalysisUsage & addUsedIfAvailable()
Add the specified Pass class to the set of analyses used by this pass.
AnalysisUsage & addRequiredID(const void *ID)
AnalysisUsage & addUsedIfAvailableID(char &ID)
AnalysisUsage & addRequired()
AnalysisUsage & addPreservedID(char &ID)