mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01: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. llvm-svn: 34941
This commit is contained in:
parent
26a5492049
commit
edbde240be
@ -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…
x
Reference in New Issue
Block a user