Skip to content

[llvm] Cherry-pick StringMap performance improvements #7211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jansvoboda11
Copy link

No description provided.

… -analyzer-config

I am working on another patch that changes StringMap's hash function,
which changes the iteration order here, and breaks some tests,
specifically:

    clang/test/Analysis/NSString.m
    clang/test/Analysis/shallow-mode.m

with errors like:

    generated arguments do not match in round-trip
    generated arguments #1 in round-trip: <...> "-analyzer-config" "ipa=inlining" "-analyzer-config" "max-nodes=75000" <...>
    generated arguments #2 in round-trip: <...> "-analyzer-config" "max-nodes=75000" "-analyzer-config" "ipa=inlining" <...>

To avoid this, sort the options by key, instead of using the default map
iteration order.

Reviewed By: jansvoboda11, MaskRay

Differential Revision: https://reviews.llvm.org/D142861

(cherry picked from commit 06be346)
…Hash"

This reverts commit 37eb9d1.

Test failures have been fixed:

- ubsan failure fixed by 72eac42
- warn-unsafe-buffer-usage-fixits-local-var-span.cpp fixed by
  03cc52d (wasn't related)
- test-output-format.ll failure was spurious, build failed at
  https://lab.llvm.org/buildbot/#/builders/54/builds/3545 (b4431b2)
  but passed at
  https://lab.llvm.org/buildbot/#/builders/54/builds/3546 (5ae99be)
  which is before my revert
  llvm/llvm-project@b4431b2...5ae99be

Original commit message:

    Depends on https://reviews.llvm.org/D142861.

    Alternative to https://reviews.llvm.org/D137601.

    xxHash is much faster than djbHash. This makes a simple Rust test case with a large constant string 10% faster to compile.

    Previous attempts at changing this hash function (e.g. https://reviews.llvm.org/D97396) had to be reverted due to breaking tests that depended on iteration order.
    No additional tests fail with this patch compared to `main` when running `check-all` with `-DLLVM_ENABLE_PROJECTS="all"` (on a Linux host), so I hope I found everything that needs to be changed.

    Differential Revision: https://reviews.llvm.org/D142862

(cherry picked from commit 87d02e0)
@jansvoboda11
Copy link
Author

@swift-ci please test

@ahoppen ahoppen merged commit 979f2de into stable/20221013 Aug 11, 2023
@jansvoboda11 jansvoboda11 deleted the jan_svoboda/stable-20221013-string-map-perf-cherry-pick branch August 15, 2023 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants