Skip to content
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

More aggressively deduplicate global warnings based on contents. (#1… #9450

Merged

Conversation

adrian-prantl
Copy link

…12801)

I've been getting complaints from users being spammed by -gmodules missing file warnings going out of control because each object file depends on an entire DAG of PCM files that usually are all missing at once. To reduce this problem, this patch does two things:

  1. Module now maintains a DenseMap<hash, once> that is used to display each warning only once, based on its actual text.

  2. The PCM warning itself is reworded to include less details, such as the DIE offset, which is only useful to LLDB developers, who can get this from the dwarf log if they need it. Because the detail is omitted the hashing from (1) deduplicates the warnings.

rdar://138144624
(cherry picked from commit 697a455)

Conflicts:
lldb/include/lldb/Core/Module.h

…m#112801)

I've been getting complaints from users being spammed by -gmodules
missing file warnings going out of control because each object file
depends on an entire DAG of PCM files that usually are all missing at
once. To reduce this problem, this patch does two things:

1. Module now maintains a DenseMap<hash, once> that is used to display
each warning only once, based on its actual text.

2. The PCM warning itself is reworded to include less details, such as
the DIE offset, which is only useful to LLDB developers, who can get
this from the dwarf log if they need it. Because the detail is omitted
the hashing from (1) deduplicates the warnings.

rdar://138144624
(cherry picked from commit 697a455)

 Conflicts:
	lldb/include/lldb/Core/Module.h
@adrian-prantl
Copy link
Author

@swift-ci test

MaskRay and others added 4 commits October 21, 2024 09:08
FNV, used by stable_hash_combine_string is extremely slow. For string
hashing with good avalanche effects, we prefer xxh3_64bits.

StableHashing.h might still be useful as it provides a stable
hash_combine while Hashing.h's might be non-deterministic (llvm#96282).

Pull Request: llvm#100668

(cherry picked from commit c538434)
I found the current stable hash is not deterministic across multiple
runs on a specific platform. This is because it uses `hash_combine`
instead of `stable_hash_combine`.

(cherry picked from commit c9b6339)
This is a follow-up to address a suggestion from
llvm#105619.
The main goal of this change is to efficiently implement stable hash
functions using the xxh3 64bits API.
`stable_hash_combine_range` and `stable_hash_combine_array` functions
are removed and consolidated into a more general `stable_hash_combine`
function that takes an `ArrayRef<stable_hash>` as input.

(cherry picked from commit 7615c0b)
…lvm#106156)

LLVM often extends global names by adding suffixes to distinguish unique
identities. However, these suffixes are not always stable across
different runs and build environments. To address this issue, I
implemented `get_stable_name` to ignore such suffixes and obtain the
original name. This approach is not new, as PGO or Bolt already handle
this issue similarly. Using the stable name obtained from
`get_stable_name`, I implemented `stable_hash_name` while utilizing the
same underlying `xxh3_64bit` algorithm as before.

(cherry picked from commit f9ad249)
@adrian-prantl
Copy link
Author

@swift-ci test

FNV is slow and the name StableHashing.h might be misleading. Just use
xxh3_64bits, which has been adopted in many places.

(cherry picked from commit 7b1bb2b)
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test linux

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl
Copy link
Author

@swift-ci test linux

@adrian-prantl
Copy link
Author

@swift-ci test windows

1 similar comment
@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl adrian-prantl merged commit e2db10a into swiftlang:stable/20240723 Oct 22, 2024
2 of 3 checks passed
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