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

Ivan Krasin via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 11:11:21 PDT 2015


krasin added a comment.

Please, take another look.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.h:313
@@ -312,2 +312,3 @@
   ImportedEntityMap;
   ImportedEntityMap ScopesWithImportedEntities;
+  bool IsScopesWithImportedEntitiesSorted;
----------------
pcc wrote:
> You might consider `llvm::DenseMap<const MDNode *, llvm::SmallVector<const MDNode *, 4>>` as a better data structure for this. That way, you won't need to maintain an ordering.
If tried that. The build time is 5 minutes larger than the code I currently have.
Your proposal might be better for the case, when all debug info is actually needed, but in this case (given the importance of having this part as fast as possible), the right approach would be to store these entries in a vector, and then create a DenseMap, if needed. That would also be faster overall, since the number of buckets for the DenseMap will be known.

I propose to go with the current patch, as it provides the largest speed gains.


http://reviews.llvm.org/D13743





More information about the llvm-commits mailing list