[PATCH] D23256: Teach the analysis manager about dependencies.
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 7 23:08:24 PDT 2016
silvas created this revision.
silvas added reviewers: chandlerc, mehdi_amini, hfinkel, davidxl.
silvas added a subscriber: llvm-commits.
Herald added subscribers: mzolotukhin, mehdi_amini, sanjoy.
This unifies analysis management for all IRUnitT's and adds dependency tracking.
The two are fairly of interrelated, since recursively invalidating transitive dependencies is difficult to do across separate analysis managers. Also, keeping track of the stack of analyses we are currently computing is difficult across separate analysis managers.
test/Other/analysis-manager/transitive-invalidation.ll shows a compelling test case.
I've used this in combination with http://reviews.llvm.org/D21921 to run the LTO pipeline on test-suite + SPEC cpu2006 with Asserts+ASan.
The two failures that remain are not related to this patch or approach (https://llvm.org/bugs/show_bug.cgi?id=28825 and https://llvm.org/bugs/show_bug.cgi?id=28888).
I've tried to retain the basic structure of the existing analysis manager code, but it still required touching quite a few lines and so the diff makes it look like it was totally rewritten.
A more incremental view of the patch can be seen here: https://github.com/llvm-mirror/llvm/compare/master...chisophugis:analysis-manager?expand=1
This patch requires making a small adjustment to every analysis and transform pass in tree (mostly, removing template parameters from AnalysisManager, and also removing use of the proxies), so there's a large number of mechanical changes.
This tracks downward invalidation using a dummy analysis called ParentIRUnitTrackingAnalysis.
By reusing the dependency tracking machinery, we get fine-grained invalidation of inner IRUnit's.
E.g. invaliding analyses on a single function doesn't invalidate loop analyses on all functions, which is a bug / fallout of the proxy approach (the InnerAnalysisManagerProxy calls "clear" on the entire LoopAnalysisManager).
TODO: test case for that
https://reviews.llvm.org/D23256
Files:
include/llvm/Analysis/AliasAnalysis.h
include/llvm/Analysis/AliasAnalysisEvaluator.h
include/llvm/Analysis/AssumptionCache.h
include/llvm/Analysis/BasicAliasAnalysis.h
include/llvm/Analysis/BlockFrequencyInfo.h
include/llvm/Analysis/BranchProbabilityInfo.h
include/llvm/Analysis/CFLAndersAliasAnalysis.h
include/llvm/Analysis/CFLSteensAliasAnalysis.h
include/llvm/Analysis/CGSCCPassManager.h
include/llvm/Analysis/CallGraph.h
include/llvm/Analysis/DemandedBits.h
include/llvm/Analysis/DependenceAnalysis.h
include/llvm/Analysis/DominanceFrontier.h
include/llvm/Analysis/GlobalsModRef.h
include/llvm/Analysis/IVUsers.h
include/llvm/Analysis/LazyCallGraph.h
include/llvm/Analysis/LazyValueInfo.h
include/llvm/Analysis/LoopAccessAnalysis.h
include/llvm/Analysis/LoopInfo.h
include/llvm/Analysis/LoopPassManager.h
include/llvm/Analysis/MemoryDependenceAnalysis.h
include/llvm/Analysis/ObjCARCAliasAnalysis.h
include/llvm/Analysis/OptimizationDiagnosticInfo.h
include/llvm/Analysis/PostDominators.h
include/llvm/Analysis/ProfileSummaryInfo.h
include/llvm/Analysis/RegionInfo.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
include/llvm/Analysis/ScopedNoAliasAA.h
include/llvm/Analysis/TargetLibraryInfo.h
include/llvm/Analysis/TargetTransformInfo.h
include/llvm/Analysis/TypeBasedAliasAnalysis.h
include/llvm/Bitcode/BitcodeWriterPass.h
include/llvm/CodeGen/PreISelIntrinsicLowering.h
include/llvm/CodeGen/UnreachableBlockElim.h
include/llvm/IR/Dominators.h
include/llvm/IR/IRPrintingPasses.h
include/llvm/IR/PassManager.h
include/llvm/IR/PassManagerInternal.h
include/llvm/IR/Verifier.h
include/llvm/Passes/PassBuilder.h
include/llvm/Transforms/GCOVProfiler.h
include/llvm/Transforms/IPO/ConstantMerge.h
include/llvm/Transforms/IPO/CrossDSOCFI.h
include/llvm/Transforms/IPO/DeadArgumentElimination.h
include/llvm/Transforms/IPO/ElimAvailExtern.h
include/llvm/Transforms/IPO/ForceFunctionAttrs.h
include/llvm/Transforms/IPO/FunctionAttrs.h
include/llvm/Transforms/IPO/FunctionImport.h
include/llvm/Transforms/IPO/GlobalDCE.h
include/llvm/Transforms/IPO/GlobalOpt.h
include/llvm/Transforms/IPO/InferFunctionAttrs.h
include/llvm/Transforms/IPO/Internalize.h
include/llvm/Transforms/IPO/LowerTypeTests.h
include/llvm/Transforms/IPO/PartialInlining.h
include/llvm/Transforms/IPO/SCCP.h
include/llvm/Transforms/IPO/StripDeadPrototypes.h
include/llvm/Transforms/IPO/WholeProgramDevirt.h
include/llvm/Transforms/InstCombine/InstCombine.h
include/llvm/Transforms/InstrProfiling.h
include/llvm/Transforms/PGOInstrumentation.h
include/llvm/Transforms/SampleProfile.h
include/llvm/Transforms/Scalar/ADCE.h
include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h
include/llvm/Transforms/Scalar/BDCE.h
include/llvm/Transforms/Scalar/ConstantHoisting.h
include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h
include/llvm/Transforms/Scalar/DCE.h
include/llvm/Transforms/Scalar/DeadStoreElimination.h
include/llvm/Transforms/Scalar/EarlyCSE.h
include/llvm/Transforms/Scalar/Float2Int.h
include/llvm/Transforms/Scalar/GVN.h
include/llvm/Transforms/Scalar/GuardWidening.h
include/llvm/Transforms/Scalar/IndVarSimplify.h
include/llvm/Transforms/Scalar/JumpThreading.h
include/llvm/Transforms/Scalar/LICM.h
include/llvm/Transforms/Scalar/LoopDeletion.h
include/llvm/Transforms/Scalar/LoopDistribute.h
include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
include/llvm/Transforms/Scalar/LoopInstSimplify.h
include/llvm/Transforms/Scalar/LoopRotation.h
include/llvm/Transforms/Scalar/LoopSimplifyCFG.h
include/llvm/Transforms/Scalar/LoopStrengthReduce.h
include/llvm/Transforms/Scalar/LoopUnrollPass.h
include/llvm/Transforms/Scalar/LowerAtomic.h
include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h
include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h
include/llvm/Transforms/Scalar/MemCpyOptimizer.h
include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h
include/llvm/Transforms/Scalar/NaryReassociate.h
include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h
include/llvm/Transforms/Scalar/Reassociate.h
include/llvm/Transforms/Scalar/SCCP.h
include/llvm/Transforms/Scalar/SROA.h
include/llvm/Transforms/Scalar/SimplifyCFG.h
include/llvm/Transforms/Scalar/Sink.h
include/llvm/Transforms/Scalar/SpeculativeExecution.h
include/llvm/Transforms/Scalar/TailRecursionElimination.h
include/llvm/Transforms/Utils/AddDiscriminators.h
include/llvm/Transforms/Utils/BreakCriticalEdges.h
include/llvm/Transforms/Utils/LCSSA.h
include/llvm/Transforms/Utils/LoopSimplify.h
include/llvm/Transforms/Utils/Mem2Reg.h
include/llvm/Transforms/Utils/MemorySSA.h
include/llvm/Transforms/Utils/SimplifyInstructions.h
include/llvm/Transforms/Utils/SymbolRewriter.h
include/llvm/Transforms/Vectorize/LoopVectorize.h
include/llvm/Transforms/Vectorize/SLPVectorizer.h
lib/Analysis/AliasAnalysisEvaluator.cpp
lib/Analysis/AssumptionCache.cpp
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/BlockFrequencyInfo.cpp
lib/Analysis/BranchProbabilityInfo.cpp
lib/Analysis/CFLAndersAliasAnalysis.cpp
lib/Analysis/CFLSteensAliasAnalysis.cpp
lib/Analysis/CGSCCPassManager.cpp
lib/Analysis/CallGraph.cpp
lib/Analysis/DemandedBits.cpp
lib/Analysis/DependenceAnalysis.cpp
lib/Analysis/DominanceFrontier.cpp
lib/Analysis/GlobalsModRef.cpp
lib/Analysis/IVUsers.cpp
lib/Analysis/LazyCallGraph.cpp
lib/Analysis/LazyValueInfo.cpp
lib/Analysis/LoopAccessAnalysis.cpp
lib/Analysis/LoopInfo.cpp
lib/Analysis/LoopPass.cpp
lib/Analysis/LoopPassManager.cpp
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Analysis/ObjCARCAliasAnalysis.cpp
lib/Analysis/OptimizationDiagnosticInfo.cpp
lib/Analysis/PostDominators.cpp
lib/Analysis/ProfileSummaryInfo.cpp
lib/Analysis/RegionInfo.cpp
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
lib/Analysis/ScopedNoAliasAA.cpp
lib/Analysis/TargetLibraryInfo.cpp
lib/Analysis/TargetTransformInfo.cpp
lib/Analysis/TypeBasedAliasAnalysis.cpp
lib/Bitcode/Writer/BitcodeWriterPass.cpp
lib/CodeGen/PreISelIntrinsicLowering.cpp
lib/CodeGen/UnreachableBlockElim.cpp
lib/IR/Dominators.cpp
lib/IR/IRPrintingPasses.cpp
lib/IR/PassManager.cpp
lib/IR/Verifier.cpp
lib/Passes/PassBuilder.cpp
lib/Passes/PassRegistry.def
lib/Transforms/IPO/ConstantMerge.cpp
lib/Transforms/IPO/CrossDSOCFI.cpp
lib/Transforms/IPO/DeadArgumentElimination.cpp
lib/Transforms/IPO/ElimAvailExtern.cpp
lib/Transforms/IPO/ForceFunctionAttrs.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
lib/Transforms/IPO/FunctionImport.cpp
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/IPO/GlobalOpt.cpp
lib/Transforms/IPO/InferFunctionAttrs.cpp
lib/Transforms/IPO/Internalize.cpp
lib/Transforms/IPO/LowerTypeTests.cpp
lib/Transforms/IPO/PartialInlining.cpp
lib/Transforms/IPO/SampleProfile.cpp
lib/Transforms/IPO/StripDeadPrototypes.cpp
lib/Transforms/IPO/WholeProgramDevirt.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
lib/Transforms/Instrumentation/GCOVProfiling.cpp
lib/Transforms/Instrumentation/IndirectCallPromotion.cpp
lib/Transforms/Instrumentation/InstrProfiling.cpp
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
lib/Transforms/Scalar/BDCE.cpp
lib/Transforms/Scalar/ConstantHoisting.cpp
lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
lib/Transforms/Scalar/DCE.cpp
lib/Transforms/Scalar/DeadStoreElimination.cpp
lib/Transforms/Scalar/EarlyCSE.cpp
lib/Transforms/Scalar/Float2Int.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/GVNHoist.cpp
lib/Transforms/Scalar/GuardWidening.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/JumpThreading.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/LoopDeletion.cpp
lib/Transforms/Scalar/LoopDistribute.cpp
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
lib/Transforms/Scalar/LoopInstSimplify.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/LoopSimplifyCFG.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Scalar/LowerAtomic.cpp
lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
lib/Transforms/Scalar/LowerGuardIntrinsic.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
lib/Transforms/Scalar/NaryReassociate.cpp
lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
lib/Transforms/Scalar/Reassociate.cpp
lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Scalar/SROA.cpp
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Scalar/Sink.cpp
lib/Transforms/Scalar/SpeculativeExecution.cpp
lib/Transforms/Scalar/TailRecursionElimination.cpp
lib/Transforms/Utils/AddDiscriminators.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp
lib/Transforms/Utils/LCSSA.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/Mem2Reg.cpp
lib/Transforms/Utils/MemorySSA.cpp
lib/Transforms/Utils/SimplifyInstructions.cpp
lib/Transforms/Utils/SymbolRewriter.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Other/analysis-manager/transitive-invalidation.ll
test/Other/new-pass-manager.ll
tools/opt/NewPMDriver.cpp
unittests/Analysis/CGSCCPassManagerTest.cpp
unittests/Analysis/LoopPassManagerTest.cpp
unittests/IR/PassManagerTest.cpp
unittests/IR/VerifierTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23256.67125.patch
Type: text/x-patch
Size: 240942 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160808/63360164/attachment-0001.bin>
More information about the llvm-commits
mailing list