diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2017-07-09 03:59:31 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2017-07-09 03:59:31 +0000 |
| commit | bd9c29039e390189cacbc28d81214c5e10b90017 (patch) | |
| tree | c5ce19b94b8604ac0fb8a55abb1cc6ae949f81bd /llvm/test | |
| parent | e79b3e7d9a26808b3e0b58a73076cf2bb9a1c9cc (diff) | |
| download | bcm5719-llvm-bd9c29039e390189cacbc28d81214c5e10b90017.tar.gz bcm5719-llvm-bd9c29039e390189cacbc28d81214c5e10b90017.zip | |
[PM] Finish implementing and fix a chain of bugs uncovered by testing
the invalidation propagation logic from an SCC to a Function.
I wrote the infrastructure to test this but didn't actually use it in
the unit test where it was designed to be used. =[ My bad. Once
I actually added it to the test case I discovered that it also hadn't
been properly implemented, so I've implemented it. The logic in the FAM
proxy for an SCC pass to propagate invalidation follows the same ideas
as the FAM proxy for a Module pass, but the implementation is a bit
different to reflect the fact that it is forwarding just for an SCC.
However, implementing this correctly uncovered a surprising "bug" (it
was conservatively correct but relatively very expensive) in how we
handle invalidation when splitting one SCC into multiple SCCs. We did an
eager invalidation when in reality we should be deferring invaliadtion
for the *current* SCC to the CGSCC pass manager and just invaliating the
newly constructed SCCs. Otherwise we end up invalidating too much too
soon. This was exposed by the inliner test case that I've updated. Now,
we invalidate *just* the split off '(test1_f)' SCC when doing the CG
update, and then the inliner finishes and invalidates the '(test1_g,
test1_h)' SCC's analyses. The first few attempts at fixing this hit
still more bugs, but all of those are covered by existing tests. For
example, the inliner should also preserve the FAM proxy to avoid
unnecesasry invalidation, and this is safe because the CG update
routines it uses handle any necessary adjustments to the FAM proxy.
Finally, the unittests for the CGSCC pass manager needed a bunch of
updates where we weren't correctly preserving the FAM proxy because it
hadn't been fully implemented and failing to preserve it didn't matter.
Note that this doesn't yet fix the current crasher due to MemSSA finding
a stale dominator tree, but without this the fix to that crasher doesn't
really make any sense when testing because it relies on the proxy
behavior.
llvm-svn: 307487
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/Inline/cgscc-incremental-invalidate.ll | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/llvm/test/Transforms/Inline/cgscc-incremental-invalidate.ll b/llvm/test/Transforms/Inline/cgscc-incremental-invalidate.ll index 82d321ccf22..f5892e80c31 100644 --- a/llvm/test/Transforms/Inline/cgscc-incremental-invalidate.ll +++ b/llvm/test/Transforms/Inline/cgscc-incremental-invalidate.ll @@ -11,17 +11,35 @@ ; CHECK: Running analysis: FunctionAnalysisManagerCGSCCProxy on (test1_f, test1_g, test1_h) ; CHECK: Running analysis: DominatorTreeAnalysis on test1_f ; CHECK: Running analysis: DominatorTreeAnalysis on test1_g -; CHECK: Invalidating all non-preserved analyses for: (test1_f, test1_g, test1_h) +; CHECK: Invalidating all non-preserved analyses for: (test1_f) ; CHECK: Invalidating all non-preserved analyses for: test1_f ; CHECK: Invalidating analysis: DominatorTreeAnalysis on test1_f +; CHECK: Invalidating analysis: LoopAnalysis on test1_f +; CHECK: Invalidating analysis: BranchProbabilityAnalysis on test1_f +; CHECK: Invalidating analysis: BlockFrequencyAnalysis on test1_f +; CHECK: Invalidating all non-preserved analyses for: (test1_g, test1_h) ; CHECK: Invalidating all non-preserved analyses for: test1_g ; CHECK: Invalidating analysis: DominatorTreeAnalysis on test1_g -; CHECK: Invalidating all non-preserved analyses for: test1_h -; CHECK-NOT: Invalidating anaylsis: -; CHECK: Running analysis: DominatorTreeAnalysis on test1_h -; CHECK: Invalidating all non-preserved analyses for: (test1_g, test1_h) +; CHECK: Invalidating analysis: LoopAnalysis on test1_g +; CHECK: Invalidating analysis: BranchProbabilityAnalysis on test1_g +; CHECK: Invalidating analysis: BlockFrequencyAnalysis on test1_g ; CHECK: Invalidating all non-preserved analyses for: test1_h ; CHECK: Invalidating analysis: DominatorTreeAnalysis on test1_h +; CHECK: Invalidating analysis: LoopAnalysis on test1_h +; CHECK: Invalidating analysis: BranchProbabilityAnalysis on test1_h +; CHECK: Invalidating analysis: BlockFrequencyAnalysis on test1_h +; CHECK-NOT: Invalidating analysis: +; CHECK: Starting llvm::Function pass manager run. +; CHECK-NEXT: Running pass: DominatorTreeVerifierPass on test1_g +; CHECK-NEXT: Running analysis: DominatorTreeAnalysis on test1_g +; CHECK-NEXT: Finished llvm::Function pass manager run. +; CHECK-NEXT: Starting llvm::Function pass manager run. +; CHECK-NEXT: Running pass: DominatorTreeVerifierPass on test1_h +; CHECK-NEXT: Running analysis: DominatorTreeAnalysis on test1_h +; CHECK-NEXT: Finished llvm::Function pass manager run. +; CHECK-NOT: Invalidating analysis: +; CHECK: Running pass: DominatorTreeVerifierPass on test1_f +; CHECK-NEXT: Running analysis: DominatorTreeAnalysis on test1_f ; An external function used to control branches. declare i1 @flag() |

