This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Move FoldingSetNodeIDRef::ComputeHash and FoldingSetNodeID::ComputeHash definitions to header
ClosedPublic

Authored by yurai007 on Jan 31 2022, 7:49 AM.

Details

Summary

Lack of ComputeHash inlining slows down slightly FoldingSetBase::FindNodeOrInsertPos calls.
Inlining makes it faster which matters in particular for FoldingSet users in ASTContext.

Extracted from: https://reviews.llvm.org/D118385

Diff Detail

Event Timeline

yurai007 created this revision.Jan 31 2022, 7:49 AM
yurai007 requested review of this revision.Jan 31 2022, 7:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2022, 7:49 AM
serge-sans-paille accepted this revision.Feb 2 2022, 5:26 AM

Not a big fan of moving Hashing.h to the header, but performance >> compilation time, so I'm fine with that patch (backed by the benchmark @nikic ran https://reviews.llvm.org/D118385#3281620)

This revision is now accepted and ready to land.Feb 2 2022, 5:26 AM

if you want the most performance, shouldn't you be building with ThinLTO -DLLVM_ENABLE_LTO=Thin? or is this helping even with LTO?

if you want the most performance, shouldn't you be building with ThinLTO -DLLVM_ENABLE_LTO=Thin? or is this helping even with LTO?

We discussed LTO topic a bit here: https://reviews.llvm.org/D118385#3278901 On my local build I can use LTO but in general not all distros enable it for Clang/LLVM packages. I'm not sure whether change would give any gains on top of LTO build.

This revision was landed with ongoing or failed builds.Feb 4 2022, 9:05 AM
This revision was automatically updated to reflect the committed changes.