Change how we manage groups in ICF.
authorRui Ueyama <ruiu@google.com>
Wed, 30 Nov 2016 01:50:03 +0000 (01:50 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 30 Nov 2016 01:50:03 +0000 (01:50 +0000)
commit9dedfb1fa8cf6d54d35fd1ec1e01c44429325076
tree13efc4b8e750a5dce0a46205f067d591398a044c
parent68c4bb5dda3b615e37c0775b8625e80a809f13a9
Change how we manage groups in ICF.

Previously, on each iteration in ICF, we scan the entire vector of
input sections to find boundaries of groups having the same ID.

This patch changes the algorithm so that we now have a vector of ranges.
Each range contains a starting index and an ending index of the group.
So we no longer have to search boundaries on each iteration.

Performance-wise, this seems neutral. Instead of searching boundaries,
we now have to maintain ranges. But I think this is more readable
than the previous implementation.

Moreover, this makes easy to parallelize the main loop of ICF,
which I'll do in a follow-up patch.

llvm-svn: 288228
lld/ELF/ICF.cpp