This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Move Diags.isIgnored() checks off hot paths, it's not free. NFC
ClosedPublic

Authored by sammccall on Jul 13 2022, 12:12 PM.

Details

Summary

This speeds up clangd's buildAST() (i.e. parsing with a preamble) by 5% on
clangd/AST.cpp, by avoiding filling up the diagnostic state map with entries for
all the files where templates are being instantiated from.

(I would assume it has a similar effect on PCH and modules compiles).

This approach is obviously pretty fragile, and we should find ways to make
isIgnored() cheaper instead. But these changes in particular don't seem to make
the code worse in any case.

Diff Detail

Event Timeline

sammccall created this revision.Jul 13 2022, 12:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 12:12 PM
Herald added a subscriber: usaxena95. · View Herald Transcript
sammccall requested review of this revision.Jul 13 2022, 12:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 12:12 PM
kadircet accepted this revision.Jul 14 2022, 2:06 AM
This revision is now accepted and ready to land.Jul 14 2022, 2:06 AM
This revision was landed with ongoing or failed builds.Sep 7 2022, 7:18 AM
This revision was automatically updated to reflect the committed changes.