[LegacyPM] Fix pass structure dumping

If module pass uses on-demand function analyses then structure is being
displayed incorrectly because FunctionPassManagerImpl can't dump contained
FPPassManager instances.

Differential revision: https://reviews.llvm.org/D69315
This commit is contained in:
evgeny 2019-11-01 14:43:51 +03:00
parent d835bc004a
commit 87eac7ef6a
6 changed files with 44 additions and 11 deletions

View File

@ -376,6 +376,11 @@ public:
FPPassManager *FP = static_cast<FPPassManager *>(PassManagers[N]);
return FP;
}
void dumpPassStructure(unsigned Offset) override {
for (unsigned I = 0; I < getNumContainedManagers(); ++I)
getContainedManager(I)->dumpPassStructure(Offset);
}
};
void FunctionPassManagerImpl::anchor() {}

View File

@ -66,7 +66,8 @@
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Exception handling preparation
; CHECK-NEXT: AArch64 Promote Constant
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Merge internal globals
; CHECK-NEXT: Safe Stack instrumentation pass

View File

@ -28,11 +28,16 @@
; CHECK-NEXT: Force set function attributes
; CHECK-NEXT: Infer set function attributes
; CHECK-NEXT: Interprocedural Sparse Conditional Constant Propagation
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Called Value Propagation
; CHECK-NEXT: Deduce and propagate attributes
; CHECK-NEXT: Global Variable Optimizer
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Natural Loop Information
; CHECK-NEXT: Branch Probability Analysis
; CHECK-NEXT: Block Frequency Analysis
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Promote Memory to Register
@ -180,7 +185,11 @@
; CHECK-NEXT: CallGraph Construction
; CHECK-NEXT: Deduce function attributes in RPO
; CHECK-NEXT: Global Variable Optimizer
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Natural Loop Information
; CHECK-NEXT: Branch Probability Analysis
; CHECK-NEXT: Block Frequency Analysis
; CHECK-NEXT: Dead Global Elimination
; CHECK-NEXT: CallGraph Construction
; CHECK-NEXT: Globals Alias Analysis

View File

@ -31,11 +31,16 @@
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Call-site splitting
; CHECK-NEXT: Interprocedural Sparse Conditional Constant Propagation
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Called Value Propagation
; CHECK-NEXT: Deduce and propagate attributes
; CHECK-NEXT: Global Variable Optimizer
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Natural Loop Information
; CHECK-NEXT: Branch Probability Analysis
; CHECK-NEXT: Block Frequency Analysis
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Promote Memory to Register
@ -185,7 +190,11 @@
; CHECK-NEXT: CallGraph Construction
; CHECK-NEXT: Deduce function attributes in RPO
; CHECK-NEXT: Global Variable Optimizer
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Natural Loop Information
; CHECK-NEXT: Branch Probability Analysis
; CHECK-NEXT: Block Frequency Analysis
; CHECK-NEXT: Dead Global Elimination
; CHECK-NEXT: CallGraph Construction
; CHECK-NEXT: Globals Alias Analysis

View File

@ -28,11 +28,16 @@
; CHECK-NEXT: Force set function attributes
; CHECK-NEXT: Infer set function attributes
; CHECK-NEXT: Interprocedural Sparse Conditional Constant Propagation
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Called Value Propagation
; CHECK-NEXT: Deduce and propagate attributes
; CHECK-NEXT: Global Variable Optimizer
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Natural Loop Information
; CHECK-NEXT: Branch Probability Analysis
; CHECK-NEXT: Block Frequency Analysis
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Promote Memory to Register
@ -167,7 +172,11 @@
; CHECK-NEXT: CallGraph Construction
; CHECK-NEXT: Deduce function attributes in RPO
; CHECK-NEXT: Global Variable Optimizer
; CHECK-NEXT: Unnamed pass: implement Pass::getPassName()
; CHECK-NEXT: FunctionPass Manager
; CHECK-NEXT: Dominator Tree Construction
; CHECK-NEXT: Natural Loop Information
; CHECK-NEXT: Branch Probability Analysis
; CHECK-NEXT: Block Frequency Analysis
; CHECK-NEXT: Dead Global Elimination
; CHECK-NEXT: CallGraph Construction
; CHECK-NEXT: Globals Alias Analysis

View File

@ -28,7 +28,7 @@
; CHECK-O2: ModulePass Manager
; CHECK-O2-NOT: Manager
; First function pass pipeline just does early opts.
; CHECK-O2: FunctionPass Manager
; CHECK-O2-COUNT-3: FunctionPass Manager
; CHECK-O2-NOT: Manager
; FIXME: It's a bit odd to do dead arg elim in the middle of early opts...
; CHECK-O2: Dead Argument Elimination