GlobalDCE: Improve performance for large modules containing comdats.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 19 Mar 2015 18:23:29 +0000 (18:23 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 19 Mar 2015 18:23:29 +0000 (18:23 +0000)
commitc226d9f334cd4d552d7fc9ceb4cdaf326dd15352
tree5d2fe5d669f69331a0455aa48b727ff8b5b15f4d
parent6e2749c772119f3dae8f100fb6d8d45eb9ddbda7
GlobalDCE: Improve performance for large modules containing comdats.

When we encounter a global with a comdat, rather than iterating over
every global in the module to find globals in the same comdat, store the
members in a multimap. This effectively lowers the complexity to O(N log N),
improving performance significantly for large modules such as might be
encountered during LTO.

It looks like we used to do something like this until r219191.

No functional change.

Differential Revision: http://reviews.llvm.org/D8431

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232743 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/GlobalDCE.cpp