This is an archive of the discontinued LLVM Phabricator instance.

[GMR] Fix a long-standing bug in GlobalsModRef where it failed to clear out the per-function modref data structures when functions were deleted or when globals were deleted.
ClosedPublic

Authored by chandlerc on Jul 23 2015, 2:02 AM.

Details

Summary

I don't actually know how the global deletion side of this bug hasn't
been hit before, but for the other it just-so-happens that functions
aren't likely to be deleted in the particular part of the LTO pipeline
where we currently enable GMR, so we got lucky.

With this patch, I can self-host with GMR enabled in the normal pass
pipeline!

I was a bit concerned about the compile-time impact of this chang, which
is part of what motivated my prior string of patches to make the
per-function datastructure very dense and fast to walk. With those
changes in place, I can't measure a significant compile time difference
(the difference is around 0.1% which is *way* below the noise) before
and after this patch when building a linked bitcode for all of Clang.

Diff Detail

Event Timeline

chandlerc updated this revision to Diff 30462.Jul 23 2015, 2:02 AM
chandlerc retitled this revision from to [GMR] Fix a long-standing bug in GlobalsModRef where it failed to clear out the per-function modref data structures when functions were deleted or when globals were deleted..
chandlerc updated this object.
chandlerc added a reviewer: hfinkel.
chandlerc added a subscriber: llvm-commits.

Ping.

While I CC'ed Hal on this directly because I know he's interested in AA
stuff, if anyone else has time to review, it would definitely be
appreciated.

hfinkel accepted this revision.Jul 25 2015, 10:43 AM
hfinkel edited edge metadata.

LGTM.

lib/Analysis/IPA/GlobalsModRef.cpp
241

tihs -> this

This revision is now accepted and ready to land.Jul 25 2015, 10:43 AM
This revision was automatically updated to reflect the committed changes.