This is an archive of the discontinued LLVM Phabricator instance.

Remove dangling BlockAddresses in GlobalDCE
AbandonedPublic

Authored by bruno on Aug 15 2014, 10:21 AM.

Details

Reviewers
bob.wilson
Summary

Whenever globaldce delete globals vars, it updates their initializers to nullptr and leave underlying constants to be cleaned up later by its uses. However, initializers containing dangling BlockAddresses are never removed because its uses (Functions and Basic Blocks) may still be alive. The presence of dead BlockAddress after globaldce is a bug - the target basic block reference count is never updated - and also prevents other optimizations; e.g. simplifycfg to merge blocks.

This patch fix this issue by removing dead BlockAddresses.

Diff Detail

Event Timeline

bruno updated this revision to Diff 12559.Aug 15 2014, 10:21 AM
bruno retitled this revision from to Remove dangling BlockAddresses in GlobalDCE.
bruno updated this object.
bruno edited the test plan for this revision. (Show Details)
bruno set the repository for this revision to rL LLVM.
bruno added a reviewer: bob.wilson.
bruno added a subscriber: bob.wilson.
bruno added a subscriber: Unknown Object (MLST).
bruno abandoned this revision.Aug 15 2014, 10:53 AM