Page MenuHomePhabricator

[PM/AA] Replace the only use of the AliasAnalysis::deleteValue API (in GlobalsModRef) with CallbackVHs that trigger the same behavior.
ClosedPublic

Authored by chandlerc on Jul 18 2015, 2:30 AM.

Details

Summary

This is technically more expensive, but in benchmarking some LTO runs,
it seems unlikely to even be above the noise floor. The only way I was
able to measure the performance of GMR at all was to run nothing else
but this one analysis on a linked clang bitcode file. The call graph
analysis still took 5x more time than GMR, and this change at most made
GMR 2% slower (this is well within the noise, so its hard for me to be
sure that this is an actual change). However, in a real LTO run over the
same bitcode, the GMR run takes so little time that the pass timers
don't measure it.

With this, I can remove the last update API from the AliasAnalysis
interface, but I'll actually remove the interface hook point in
a follow-up commit.

Diff Detail

Event Timeline

chandlerc updated this revision to Diff 30076.Jul 18 2015, 2:30 AM
chandlerc retitled this revision from to [PM/AA] Replace the only use of the AliasAnalysis::deleteValue API (in GlobalsModRef) with CallbackVHs that trigger the same behavior..
chandlerc updated this object.
chandlerc added a subscriber: llvm-commits.
This revision was automatically updated to reflect the committed changes.
kimgr added a subscriber: kimgr.Jul 22 2015, 3:37 AM
kimgr added inline comments.Jul 22 2015, 3:39 AM
llvm/trunk/lib/Analysis/IPA/GlobalsModRef.cpp
106–114 ↗(On Diff #30331)

This doesn't compile on my FreeBSD 10.1 rig;

In file included from /home/kimgr/code/llvm-trunk/llvm/lib/Analysis/IPA/GlobalsModRef.cpp:32:
/usr/include/c++/v1/list:227:9: error: field has incomplete type '<anonymous>::GlobalsModRef::DeletionCallbackHandle'
    _Tp __value_;
        ^
/usr/include/c++/v1/type_traits:1994:27: note: in instantiation of template class 'std::__1::__list_node<<anonymous>::GlobalsModRef::DeletionCallbackHandle, void *>' requested here
                 decltype(__is_constructible_test(declval<_Tp>(), declval<_Args>()...))

$ clang --version
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.1
Thread model: posix

Not sure which libc++ version came with this system. I've confirmed that moving the full DeletionCallbackHandle definition up in place of the forward decl resolves the problem.

The Clang version is getting old, but this is FreeBSD's latest production release, so it would be nice if it could be supported.

Thanks!