]> granicus.if.org Git - llvm/commit
[PH] Replace uses of AssertingVH from members of analysis results with
authorChandler Carruth <chandlerc@gmail.com>
Tue, 24 Jan 2017 12:55:57 +0000 (12:55 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 24 Jan 2017 12:55:57 +0000 (12:55 +0000)
commit558562623292285e1d0ae0812c3634ac3c727527
treefc80bf37c62f1a31115b90f91ba98d25692d6db8
parent59fff99fc0302e5f6ae40bde0767c4d8fcf48c1e
[PH] Replace uses of AssertingVH from members of analysis results with
a lazy-asserting PoisoningVH.

AssertVH is fundamentally incompatible with cache-invalidation of
analysis results. The invaliadtion happens after the AssertingVH has
already fired. Instead, use a PoisoningVH that will assert if the
dangling handle is ever used rather than merely be assigned or
destroyed.

This patch also removes all of the (numerous) doomed attempts to work
around this fundamental incompatibility. It is a pretty significant
simplification IMO.

The most interesting change is in the Inliner where we still do some
clearing because we don't want to rely on the coarse grained
invalidation strategy of the containing pass manager. However, I prefer
the approach that contains this logic to the cleanup phase of the
Inliner, and I think we could enhance the CGSCC analysis management
layer to make this even better in the future if desired.

The rest is straight cleanup.

I've also added a test for one of the harder cases to work around: when
a *module analysis* contains many AssertingVHes pointing at functions.

Differential Revision: https://reviews.llvm.org/D29006

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292928 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/llvm/Analysis/CallGraph.h
include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/LazyValueInfo.cpp
lib/Transforms/IPO/FunctionAttrs.cpp
lib/Transforms/IPO/GlobalDCE.cpp
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
lib/Transforms/Scalar/NaryReassociate.cpp
lib/Transforms/Utils/LoopSimplify.cpp
test/Other/new-pm-defaults.ll
test/Other/new-pm-lto-defaults.ll
test/Transforms/GlobalDCE/crash-assertingvh.ll
test/Transforms/Inline/clear-analyses.ll