llvm/test/Transforms/GlobalDCE
Chandler Carruth 5585626232 [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
2017-01-24 12:55:57 +00:00
..
2002-07-17-CastRef.ll
2002-07-17-ConstantRef.ll
2002-08-17-FunctionDGE.ll [GlobalDCE] Modernize. Use FileCheck instead of grep. 2016-05-01 22:51:14 +00:00
2002-08-17-WorkListTest.ll [GlobalDCE] Modernize. Use FileCheck instead of grep. 2016-05-01 22:51:14 +00:00
2002-09-12-Redeletion.ll
2003-07-01-SelfReference.ll [GlobalDCE] Modernize. Use FileCheck instead of grep. 2016-05-01 22:51:14 +00:00
2003-10-09-PreserveWeakGlobals.ll [GlobalDCE] Modernize. Use FileCheck instead of grep. 2016-05-01 22:51:14 +00:00
2009-01-05-DeadAliases.ll
2009-02-17-AliasUsesAliasee.ll
basicvariabletest.ll [IPO/GlobalDCE] Port to the new pass manager. 2016-05-03 19:39:15 +00:00
comdats.ll Test the different scenarios of GlobalDCE and comdats more 2016-12-26 08:54:01 +00:00
complex-constantexpr.ll
crash-assertingvh.ll [PH] Replace uses of AssertingVH from members of analysis results with 2017-01-24 12:55:57 +00:00
deadblockaddr.ll
externally_available.ll [GlobalDCE] Modernize. Use FileCheck instead of grep. 2016-05-01 22:51:14 +00:00
global_ctors_integration.ll
global_ctors.ll
global-ifunc.ll [GlobalDCE, Misc] Don't remove functions referenced by ifuncs 2016-05-04 00:20:48 +00:00
indirectbr.ll