weiwang added a comment.

Tried to make `Sema::DeclsToCheckForDeferredDiags` `llvm::SmallSetVector`. The 
heap RSS did drop significantly (from peak 100GB to 59GB) , but not as good as 
the current fix (peak 26GB), which makes 
`ASTReader::DeclsToCheckForDeferredDiags` `llvm::SmallSetVector`.

I think the reason is that the duplicated decls are read from multiple module 
file sources (`ASTReader::ReadAST()` -> `ASTReader::ReadASTBlock()`), then 
stored into `ASTReader::DeclsToCheckForDeferredDiags`, then goes into 
`Sema::DeclsToCheckForDeferredDiags` in 
`ASTReader::ReadDeclsToCheckForDeferredDiags()`. Doing dedup at the early stage 
when the decls were just read in `ASTReader` is more effective at reducing RSS.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101793/new/

https://reviews.llvm.org/D101793

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to