[PATCH] D139573: [FoldingSet] Move compare to header (NFC).

Dawid Jurczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 03:00:35 PST 2022


yurai007 added a comment.

> looking at folding set performance in general

Just as a side note regarding further improvements in future - when I was working on related patches some months ago I noted 2 extra ideas which could be worth exploring:

[1] faster hashing related to FoldingSet* classes family. Symbols like llvm::FoldingSetBase::FindNodeOrInsertPos and llvm::hashing::detail::hash_short are often seen as hot in profiler output (at least were - couple of months ago). There is long-standing task in my queue to try xxHash or even CRC just for FoldingSet and see if it helps.

[2] removing (somehow) indirection related to FoldingSet::NodeEquals in context of following callers: FunctionProtoTypes/PointerTypes/ElaboratedTypes/ParenTypes Profile functions. 
IIRC that indirection made inlining impossible which mattered for projects with compile time highly dominated by frontend. Moving compare operators in this change may help for NodeEquals but I believe there is still some room for improvement.

I'm not sure about [2], but I think that [1] should bring some value even for builds with LTO=ON.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139573



More information about the llvm-commits mailing list