[PATCH] D124422: [Serialization] Improve encoding of small SourceRanges.

2022-04-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D124422#3474110 , @ilya-biryukov wrote: > Yeah, that sounds promising. Various source locations inside the same nodes > are probably very close. Probably even across nodes. Yeah. The reason to avoid compressing across node

[PATCH] D124422: [Serialization] Improve encoding of small SourceRanges.

2022-04-26 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Yeah, that sounds promising. Various source locations inside the same nodes are probably very close. Probably even across nodes. If we are willing to take on a bit more complexity, we could probably get even bigger wins by storing all source locations in a single a

[PATCH] D124422: [Serialization] Improve encoding of small SourceRanges.

2022-04-26 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D124422#3474003 , @ilya-biryukov wrote: > Overall LGTM, but I didn't look closely if there are cases that break now. > Do we have any tests to check this? Serialization tests do exist, though I think coverage isn't amazing.

[PATCH] D124422: [Serialization] Improve encoding of small SourceRanges.

2022-04-26 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. Overall LGTM, but I didn't look closely if there are cases that break now. Do we have any tests to check this? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D124422: [Serialization] Improve encoding of small SourceRanges.

2022-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 425089. sammccall added a comment. Switch reader/writer to use sourcerange encoding for all "obvious" ranges. Gain is now 1.75% in my test PCH. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124422/new/ https

[PATCH] D124422: [Serialization] Improve encoding of small SourceRanges.

2022-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Bad news: this isn't ready, there are places where ASTWriter calls AddSourceLocation() twice and ASTReader calls ReadSourceRange(). After this change, those are no longer compatible so we have to make them match, and have to audit them all. Good news, there's a bunch

[PATCH] D124422: [Serialization] Improve encoding of small SourceRanges.

2022-04-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: ilya-biryukov. Herald added subscribers: usaxena95, kadircet. Herald added a project: All. sammccall requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Instead of encoding as (start,