[PATCH] D13743: Lazily sort ScopesWithImportedEntities to speed up LTO linking.

Ivan Krasin via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 15:07:01 PDT 2015


krasin added a comment.

In http://reviews.llvm.org/D13743#270549, @dblaikie wrote:

> It'd be nice if we could sort immediately after populating - but the issue
>  you've identified is that we use it within the body of the for(CUs) loop
>  after we've added them for one CU?


This is correct.

> What about if we sunk the data structure down into the DwarfUnit (actually

>  we should be able to sink it into DwarfCompileUnit - these specific scopes

>  should never appear in DwarfTypeUnits)? Then we would reduce the size of

>  the data structure to search through (since each query should know which

>  unit it's for - effectively bucketizing it) & be able to sort immediately

>  after populating, since it'll be "populate the map for this CU, sort it,

>  then never touch it again"?


I tried that, see http://reviews.llvm.org/D13918. I did't optimize it for speed, it only loses a minute comparing to the current CL anyway.
The problem is that the resultant binary is different. My understanding is that it could not find some of the imported entries for the given scope, because they could end up in a different DwarfCompileUnit.

Have I understood your suggestion right?


http://reviews.llvm.org/D13743





More information about the llvm-commits mailing list