mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-12 14:20:33 +00:00
Add preparePassManager() hook. This allows each pass to check whether
current active pass manager is appropriate or not. A loop pass may consider current LPPassManager in appropraite if loop pass is not preserving analysis information that is used by other passes managed by current LPPassManager. In such situation, loop pass can pop current LPPassManager from the PMStack using this hook and use new LPPassManager for itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34941 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b9a7bea99c
commit
22a1cf9d3a
@ -119,8 +119,13 @@ public:
|
||||
void print(std::ostream *O, const Module *M) const { if (O) print(*O, M); }
|
||||
void dump() const; // dump - call print(std::cerr, 0);
|
||||
|
||||
/// Each pass is responsible for assigning a pass manager to itself.
|
||||
/// PMS is the stack of available pass manager.
|
||||
virtual void assignPassManager(PMStack &PMS,
|
||||
PassManagerType T = PMT_Unknown) {}
|
||||
/// Check if available pass managers are suitable for this pass or not.
|
||||
virtual void preparePassManager(PMStack &PMS) {}
|
||||
|
||||
// Access AnalysisResolver
|
||||
inline void setResolver(AnalysisResolver *AR) { Resolver = AR; }
|
||||
inline AnalysisResolver *getResolver() { return Resolver; }
|
||||
|
@ -385,6 +385,9 @@ void PMTopLevelManager::schedulePass(Pass *P) {
|
||||
if (findAnalysisPass(P->getPassInfo()))
|
||||
return;
|
||||
|
||||
// Give pass a chance to prepare the stage.
|
||||
P->preparePassManager(activeStack);
|
||||
|
||||
AnalysisUsage AnUsage;
|
||||
P->getAnalysisUsage(AnUsage);
|
||||
const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet();
|
||||
|
Loading…
Reference in New Issue
Block a user